You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steve Duran <st...@nmmcc.com> on 2006/11/15 02:19:09 UTC

struts 1.3.5 tiles question

 
  I have been unable to get Tiles to work under Struts 1.3.5.  I also
noticed that none of the Struts 1.3.5 examples use Tiles.   Below is a
summary of the problem.  The only place where my implementation deviates
from the documentation is in the tiles-defs.xml file.  If anyone know
what I need to do to get it to work, it would be appreciated.  Thanks.
 
==========
 
  I installed Tomcat 5.5.20 onto a Red Hat Linux 4.0 box.  I opened up
the "blank.war" app that comes with Struts 1.3.5.  I modified web.xml
and struts-config.xml as specified in the Struts 1.3.5 Tiles
documentation.
 
  Here's my test JSP:
 
  <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
 
<html>
  <head>
    <title>FooBar</title>
  </head>
  <body>
<tiles:insert attribute="foo"/>
  </body>
</html>
 
 
  Here's my tiles-defs.xml:
 
<?xml version="1.0" encoding="ISO-8859-1" ?>
    
    <!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
       "http://struts.apache.org/dtds/tiles-config_1_3.dtd">  
 
    <tiles-definitions>    
    <definition name="foo" path="/bar.jsp" >
    </definition>        
    </tiles-definitions>
 
 
  I get this error:
 
org.apache.jasper.JasperException: Exception in JSP: /parent.jsp:8

5:     <title>FooBar</title>
6:   </head>
7:   <body>
8: <tiles:insert attribute="foo"/>
9:   </body>
10: </html>


Stacktrace:
	
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServle
tWrapper.java:506)
	
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:395)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause 

java.lang.NullPointerException
	
org.apache.struts.tiles.taglib.InsertTag.processAttribute(InsertTag.java
:687)
	
org.apache.struts.tiles.taglib.InsertTag.createTagHandler(InsertTag.java
:478)
	
org.apache.struts.tiles.taglib.InsertTag.doStartTag(InsertTag.java:438)
	
org.apache.jsp.parent_jsp._jspx_meth_tiles_insert_0(parent_jsp.java:85)
	org.apache.jsp.parent_jsp._jspService(parent_jsp.java:59)
	
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:334)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

**************************************************************************************************
CONFIDENTALITY NOTICE: This e-mail communication and any attachments may contain confidential and 
privileged information protected from disclosure by law. It is intended only for the use of the specified 
recipients.  Any unauthorized review, use, disclosure, distribution or any action based on this material is 
prohibited.  If you are not the intended recipient, please contact the sender by reply e-mail and destroy all 
copies of the original message.
**************************************************************************************************

Re: struts 1.3.5 tiles question

Posted by Antonio Petrelli <ap...@apache.org>.
Steve Duran ha scritto:
> "bar.jsp" contains only the string "testing" - no XML, JSP, HTML.
>
>   The reason I did not put <tiles:insert definition="foo"> in the JSP is
> because on this page:
>
> http://struts.apache.org/1.3.5/struts-tiles/examples.html
>
>   it recommends that the definitions be put in tiles-defs.xml, not in
> the JSP, which is what I did in Struts 1.2.9
>   

You are confusing <tiles:insert definition="xxx"/> with
<tiles:definition name="xxx" />. The first insert a configured
definition (or a definition defined with <tiles:definition>) in the
page, the second defines the definition itself. It's the latter that the
page you mentioned refers to.
If you define a definition inside tiles-defs.xml, you HAVE TO insert it
with <tiles:insert name="xxx" />, or forward to the definition itself.

Ciao
Antonio



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: struts 1.3.5 tiles question

Posted by Steve Duran <st...@nmmcc.com>.
>There are some missing details. But here I am supposing that "bar.jsp" 
>is your test JSP page and "parent.jsp" is the page where you put 
><tiles:insert definition="foo" />. If this is not the case please let
me 
>know.
>Well, in this case, you forgot to fillup the "foo" attribute in
"bar.jsp"
 
  "parent.jsp" is a test page where I want to import the content of
"bar.jsp".
 
  "bar.jsp" contains only the string "testing" - no XML, JSP, HTML.

  The reason I did not put <tiles:insert definition="foo"> in the JSP is
because on this page:

http://struts.apache.org/1.3.5/struts-tiles/examples.html

  it recommends that the definitions be put in tiles-defs.xml, not in
the JSP, which is what I did in Struts 1.2.9

  Steve

-----Original Message-----
From: Antonio Petrelli [mailto:apetrelli@apache.org] 
Sent: Wednesday, November 15, 2006 12:52 AM
To: Struts Users Mailing List
Subject: Re: struts 1.3.5 tiles question


Steve Duran ha scritto:
>    <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"

> %>
>  
> <html>
>   <head>
>     <title>FooBar</title>
>   </head>
>   <body>
> <tiles:insert attribute="foo"/>
>   </body>
> </html>
>  
>  
>   Here's my tiles-defs.xml:
>  
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>     
>     <!DOCTYPE tiles-definitions PUBLIC
>        "-//Apache Software Foundation//DTD Tiles Configuration
1.3//EN"
>        "http://struts.apache.org/dtds/tiles-config_1_3.dtd">
>  
>     <tiles-definitions>    
>     <definition name="foo" path="/bar.jsp" >
>     </definition>        
>     </tiles-definitions>
> ...
>
> root cause
>
> java.lang.NullPointerException
> 	
> org.apache.struts.tiles.taglib.InsertTag.processAttribute(InsertTag.ja
> va
> :687)
>   


There are some missing details. But here I am supposing that "bar.jsp" 
is your test JSP page and "parent.jsp" is the page where you put 
<tiles:insert definition="foo" />. If this is not the case please let me

know.
Well, in this case, you forgot to fillup the "foo" attribute in
"bar.jsp"

HTH
Antonio
**************************************************************************************************
CONFIDENTALITY NOTICE: This e-mail communication and any attachments may contain confidential and 
privileged information protected from disclosure by law. It is intended only for the use of the specified 
recipients.  Any unauthorized review, use, disclosure, distribution or any action based on this material is 
prohibited.  If you are not the intended recipient, please contact the sender by reply e-mail and destroy all 
copies of the original message.
**************************************************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts 1.3.5 tiles question

Posted by Antonio Petrelli <ap...@apache.org>.
Steve Duran ha scritto:
>    <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
>  
> <html>
>   <head>
>     <title>FooBar</title>
>   </head>
>   <body>
> <tiles:insert attribute="foo"/>
>   </body>
> </html>
>  
>  
>   Here's my tiles-defs.xml:
>  
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>     
>     <!DOCTYPE tiles-definitions PUBLIC
>        "-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
>        "http://struts.apache.org/dtds/tiles-config_1_3.dtd">  
>  
>     <tiles-definitions>    
>     <definition name="foo" path="/bar.jsp" >
>     </definition>        
>     </tiles-definitions>
> ... 
>
> root cause 
>
> java.lang.NullPointerException
> 	
> org.apache.struts.tiles.taglib.InsertTag.processAttribute(InsertTag.java
> :687)
>   


There are some missing details. But here I am supposing that "bar.jsp" 
is your test JSP page and "parent.jsp" is the page where you put 
<tiles:insert definition="foo" />. If this is not the case please let me 
know.
Well, in this case, you forgot to fillup the "foo" attribute in "bar.jsp"

HTH
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org