You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Appel, Jeremy D" <je...@qwest.com> on 2003/05/03 18:17:13 UTC
Tiles newbie
Hi,
I am new user to Struts/Tiles and am trying to get some TIles
definitions to work in JSP. I am receiving the following error:
java.lang.NullPointerException
at org.apache.struts.taglib.tiles.InsertTag.processName(InsertTag.java)
at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java)
at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java)
at jsp.index._jspService(index.java)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java)
Here are samples of the related files:
struts-config.xml:
<plug-in
className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml"/>
<set-property property="definitions-debug" value="2"/>
<set-property property="definitions-parser-details" value="2"/>
<set-property property="definitions-parser-validate" value="true"/>
</plug-in>
tiles-defs.xml:
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="RUL.default" path="/RULLayout">
<put name="body" value="/submit" />
<put name="footer" value="/footer" />
</definition>
</tiles-definitions>
index.jsp:
<%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<tiles:insert name="RUL.default" />
My suspicion is that the tiles-def.xml file is not being loaded. Is there
anyway I can tel? In Tomcat's startup log, I see the TilesPlugin being
initialized.
Any ideas?
TIA,
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Tiles newbie
Posted by Hue Holleran <hu...@openAction.net>.
(SEE NOTE AT END!)
Well, the tiles-defs.xml looks OK, although my plug-in definition in
struts-config is slightly different (mines probably older, but still does
work) - NB: tiles-defs.xml is in a sub-directory "config" under WEB-INF:
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
value="/WEB-INF/config/tiles-defs.xml" />
<set-property property="definitions-debug" value="1" />
<set-property property="definitions-parser-details" value="0" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
My tiles def has the following header but I think this is quite old also:
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config.dtd">
When inserting, I personally use the format:
<tiles:insert definition="xxx" ...
... but from the taglib definition it seems "name" can be used in the same
way - but never tried this!
What version of tiles are you using - you may want to try rc1 or
alternatively a nightly - I had several problems with NPEs on b2?
NOTE: BTW, just noticed:
<definition name="RUL.default" path="/RULLayout">
The path should reference a JSP - does this just need .jsp at the end?
(sorry about the previous cr*p - didn't see this 'til the end).
H.
> -----Original Message-----
> From: Appel, Jeremy D [mailto:jeremy.appel@qwest.com]
> Sent: 03 May 2003 17:17
> To: 'struts-user@jakarta.apache.org'
> Subject: Tiles newbie
>
>
> Hi,
>
> I am new user to Struts/Tiles and am trying to get some TIles
> definitions to work in JSP. I am receiving the following error:
>
> java.lang.NullPointerException
> at org.apache.struts.taglib.tiles.InsertTag.processName(InsertTag.java)
> at
> org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java)
>
> at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java)
> at jsp.index._jspService(index.java)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java)
>
> Here are samples of the related files:
> struts-config.xml:
> <plug-in
> className="org.apache.struts.tiles.TilesPlugin">
> <set-property property="definitions-config"
> value="/WEB-INF/tiles-defs.xml"/>
> <set-property property="definitions-debug" value="2"/>
> <set-property property="definitions-parser-details" value="2"/>
> <set-property property="definitions-parser-validate" value="true"/>
> </plug-in>
>
> tiles-defs.xml:
>
> <!DOCTYPE tiles-definitions PUBLIC
> "-//Apache Software Foundation//DTD Tiles Configuration//EN"
> "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
>
> <tiles-definitions>
> <definition name="RUL.default" path="/RULLayout">
> <put name="body" value="/submit" />
> <put name="footer" value="/footer" />
> </definition>
> </tiles-definitions>
>
> index.jsp:
>
> <%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
> <tiles:insert name="RUL.default" />
>
>
> My suspicion is that the tiles-def.xml file is not being loaded. Is there
> anyway I can tel? In Tomcat's startup log, I see the TilesPlugin being
> initialized.
>
> Any ideas?
>
> TIA,
> Jeremy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.474 / Virus Database: 272 - Release Date: 18/04/2003
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.474 / Virus Database: 272 - Release Date: 18/04/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org