You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Reumann <ri...@gmail.com> on 2006/04/14 22:04:22 UTC
Tiles headaches - should be simple - driving me nuts here...
I've used Tiles in the past. Started to implement it in this new app,
and I keep getting error messages like...
javax.servlet.jsp.JspException: Error - Tag Insert : No value found
for attribute 'header'.
at org.apache.struts.taglib.tiles.InsertTag.processAttribute(InsertTag.java:690)
at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:478)
<snip/>
Basically it seems as if none of the attributes I define in my tiles
definition file are being able to be picked up by the main layout. I'm
hoping someone can pick up something that I'm doing really dumb here.
Here's some info..
Tiles Definition
---------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="main.layout" path="/mainLayout.jsp">
<put name="header" value="/WEB-INF/jsp/header.jsp"/>
<put name="content" value="yrdy"/>
</definition>
<definition name="main.page" extends="main.layout">
<put name="content" value="/WEB-INF/jsp/main.jsp"/>
</definition>
</tiles-definitions>
(files header.jsp and main.jsp exist. mainLayout.jsp displays fine
also when I remove the tiles:insert sections.) I've also tried the
above 1_3.dtd defintion, but I think that gave me other problems. I
know the above 1_1 version was working in another app that I believe
had my 1.2.7 struts jar.
mainLayout.jsp
---------------------
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
<---- snipped out extra html junk ----->
<body>
<div id="contents">
<tiles:insert attribute="header"/>
<div id="main-content-box">
<tiles:insert attribute="content"/>
</div>
</div>
Again, if I comment out the above tiles:insert lines this page will
display (minus the tiles content I'm trying to add of course).
struts-config
-----------------
The docs are a bit confusing on this, since in the docs it says you should add
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"></controller>
I've tried including and remove the above.
I also include the plugin definition:
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config"
value="/WEB-INF/tiles-definitions.xml"/>
<set-property property="moduleAware" value="true"/>
<set-property property="definitions-parser-validate" value="true"/>
</plug-in>
Other thoughts
---------------------
I removed all filters that I have running, thinking maybe they were
mangling some request or session parameters.
The test i'm doing from the index page just has
<a href="authenticate.do">clickme</a>
And the action-mapping for it:
<action
path="/authenticate"
type="com.nielsenmedia.npn.action.AuthenticateAction"
>
<forward name="success" path="main.page"/>
</action>
The AuthenticatAction has been stripped down to simply return
"success" (It doesn't do anything).
I'm using Struts 1.2.9 but also tried some older jars like 1.2.7.
At 4:00 on a Friday I'm not happy that I can't get this basic Tiles
stuff working. Any ideas what I might be doing wrong?
Thanks,
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
narrowed it down to converter Re: Tiles headaches - should be simple
- driving me nuts here...
Posted by Rick Reumann <ri...@gmail.com>.
Rick Reumann wrote:
> I've used Tiles in the past. Started to implement it in this new app,
> and I keep getting error messages like...
>
> javax.servlet.jsp.JspException: Error - Tag Insert : No value found
> for attribute 'header'.
> at org.apache.struts.taglib.tiles.InsertTag.processAttribute(InsertTag.java:690)
> at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:478)
> <snip/>
>
> Basically it seems as if none of the attributes I define in my tiles
> definition file are being able to be picked up by the main layout. I'm
> hoping someone can pick up something that I'm doing really dumb here.
Finally tracked down the main problem to my ServletContext listener. I
thought I had commented it out but I hadn't and never thought anything
in there could be screwing things up. Apparently Tiles gets screwed up
somehow based on a Converter I registered in my context listener class.
The one messing it up was the one that I declared as...
ConvertUtils.register(new CustomValueToStringConverter("MM/dd/yy"),
String.class);
Initially I was using it for dealing with some date stuff also but at
this time it's only doing:
public Object convert(Class type, Object value) {
Object returnValue = null;
if (value != null && type == String.class ) {
if ( value instanceof String) {
if ( value.toString().trim().length() == 0 ) {
returnValue = null;
} else {
returnValue = value.toString().trim();
}
}
//process String using standard converter
else {
returnValue = stringConverter.convert(type, value);
}
}
return returnValue;
}
I could work around not using this converter. I'm just curious why this
causes Tiles to blow up on setting attributes. I'm sure it's related to
BeanUtils and something I'm doing wrong.
Anyway, thanks guys for bearing with me. I should have commented out
that listener earlier on before posting, but I missed it. I'm just upset
it took me so long to track down the issue.
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles headaches - should be simple - driving me nuts here...
Posted by Aladin Alaily <st...@aladin.ca>.
Rick Reumann wrote:
> Aladin Alaily wrote:
>
>>
>> Did you revert back to 1.2.7 or is this message appearing with 1.2.9?
>
>
> I'm getting the same error with 1.2.7 or 1.2.9. It's so frustrating
> because I'm comparing the jars between an app where I have things
> working and this current one and they seem to be the same - but I'm
> still getting that dependency error. I'm going to take a few minutes now
> and build an almost blank app and try the same jars just to see what
> happens.
>
hmmm... strange indeed.
Good luck, I'm sure that building the app from scratch will yield something.
Aladin
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles headaches - should be simple - driving me nuts here...
Posted by Rick Reumann <ri...@gmail.com>.
Aladin Alaily wrote:
>
> Did you revert back to 1.2.7 or is this message appearing with 1.2.9?
I'm getting the same error with 1.2.7 or 1.2.9. It's so frustrating
because I'm comparing the jars between an app where I have things
working and this current one and they seem to be the same - but I'm
still getting that dependency error. I'm going to take a few minutes now
and build an almost blank app and try the same jars just to see what
happens.
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles headaches - should be simple - driving me nuts here...
Posted by Aladin Alaily <st...@aladin.ca>.
Rick Reumann wrote:
> Aladin Alaily wrote:
>
>> Hi Rick,
>>
>> Your configuration looks okay to me (for a 1.2.7 struts app - I don't
>> know about 1.2.9 because I haven't made the jump yet).
>>
>> What kind of errors did you get when you put:
>>
>> <!DOCTYPE tiles-definitions PUBLIC
>> "-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
>> "http://struts.apache.org/dtds/tiles-config_1_3.dtd">
>>
>> in your tiles-definitions.xml?
>>
>> The errors may be indicative of what's going wrong with your app...
>> because the above should not break anything.
>
>
> When I switch to that dtd definition I end up with the error:
>
> ERROR [main] org.apache.struts.tiles.TilesPlugin initDefinitionsFactory-
> Can't create Tiles definition factory for module ''.
> ERROR [main] org.apache.struts.action.ActionServlet init- Unable to
> initialize Struts ActionServlet due to an unexpected
> exception or error thrown, so marking the servlet as unavailable. Most
> likely, this is due to an incorrect or missing
> library dependency.
> javax.servlet.ServletException: IO Error while parsing file
> '/WEB-INF/tiles-definitions.xml'. Connection refused: connec
> t
> at
> org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:233)
>
> at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:137)
> at
> org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
>
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
> at javax.servlet.GenericServlet.init(GenericServlet.java:211)
> at
> <snip>
>
>
> I'll keep working on it, but any ideas what could be wrong?
>
Did you revert back to 1.2.7 or is this message appearing with 1.2.9?
Aladin
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles headaches - should be simple - driving me nuts here...
Posted by Rick Reumann <ri...@gmail.com>.
Aladin Alaily wrote:
> Hi Rick,
>
> Your configuration looks okay to me (for a 1.2.7 struts app - I don't
> know about 1.2.9 because I haven't made the jump yet).
>
> What kind of errors did you get when you put:
>
> <!DOCTYPE tiles-definitions PUBLIC
> "-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
> "http://struts.apache.org/dtds/tiles-config_1_3.dtd">
>
> in your tiles-definitions.xml?
>
> The errors may be indicative of what's going wrong with your app...
> because the above should not break anything.
When I switch to that dtd definition I end up with the error:
ERROR [main] org.apache.struts.tiles.TilesPlugin initDefinitionsFactory-
Can't create Tiles definition factory for module ''.
ERROR [main] org.apache.struts.action.ActionServlet init- Unable to
initialize Struts ActionServlet due to an unexpected
exception or error thrown, so marking the servlet as unavailable.
Most likely, this is due to an incorrect or missing
library dependency.
javax.servlet.ServletException: IO Error while parsing file
'/WEB-INF/tiles-definitions.xml'. Connection refused: connec
t
at
org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:233)
at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:137)
at
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at
<snip>
I'll keep working on it, but any ideas what could be wrong?
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles headaches - should be simple - driving me nuts here...
Posted by Aladin Alaily <st...@aladin.ca>.
Hi Rick,
Your configuration looks okay to me (for a 1.2.7 struts app - I don't
know about 1.2.9 because I haven't made the jump yet).
What kind of errors did you get when you put:
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
"http://struts.apache.org/dtds/tiles-config_1_3.dtd">
in your tiles-definitions.xml?
The errors may be indicative of what's going wrong with your app...
because the above should not break anything.
Must be something really subtle....
Aladin
Rick Reumann wrote:
> I've used Tiles in the past. Started to implement it in this new app,
> and I keep getting error messages like...
>
> javax.servlet.jsp.JspException: Error - Tag Insert : No value found
> for attribute 'header'.
> at org.apache.struts.taglib.tiles.InsertTag.processAttribute(InsertTag.java:690)
> at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:478)
> <snip/>
>
> Basically it seems as if none of the attributes I define in my tiles
> definition file are being able to be picked up by the main layout. I'm
> hoping someone can pick up something that I'm doing really dumb here.
>
> Here's some info..
>
> Tiles Definition
> ---------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE tiles-definitions PUBLIC
> "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
> "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
> <tiles-definitions>
>
> <definition name="main.layout" path="/mainLayout.jsp">
> <put name="header" value="/WEB-INF/jsp/header.jsp"/>
> <put name="content" value="yrdy"/>
> </definition>
> <definition name="main.page" extends="main.layout">
> <put name="content" value="/WEB-INF/jsp/main.jsp"/>
> </definition>
>
> </tiles-definitions>
>
> (files header.jsp and main.jsp exist. mainLayout.jsp displays fine
> also when I remove the tiles:insert sections.) I've also tried the
> above 1_3.dtd defintion, but I think that gave me other problems. I
> know the above 1_1 version was working in another app that I believe
> had my 1.2.7 struts jar.
>
> mainLayout.jsp
> ---------------------
>
> <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
> <---- snipped out extra html junk ----->
> <body>
> <div id="contents">
> <tiles:insert attribute="header"/>
>
> <div id="main-content-box">
> <tiles:insert attribute="content"/>
> </div>
> </div>
>
> Again, if I comment out the above tiles:insert lines this page will
> display (minus the tiles content I'm trying to add of course).
>
> struts-config
> -----------------
> The docs are a bit confusing on this, since in the docs it says you should add
>
> <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"></controller>
>
> I've tried including and remove the above.
>
> I also include the plugin definition:
>
> <plug-in className="org.apache.struts.tiles.TilesPlugin">
> <set-property property="definitions-config"
> value="/WEB-INF/tiles-definitions.xml"/>
> <set-property property="moduleAware" value="true"/>
> <set-property property="definitions-parser-validate" value="true"/>
> </plug-in>
>
>
> Other thoughts
> ---------------------
> I removed all filters that I have running, thinking maybe they were
> mangling some request or session parameters.
>
> The test i'm doing from the index page just has
>
> <a href="authenticate.do">clickme</a>
>
> And the action-mapping for it:
>
> <action
> path="/authenticate"
> type="com.nielsenmedia.npn.action.AuthenticateAction"
> >
> <forward name="success" path="main.page"/>
> </action>
>
> The AuthenticatAction has been stripped down to simply return
> "success" (It doesn't do anything).
>
> I'm using Struts 1.2.9 but also tried some older jars like 1.2.7.
>
>
>
> At 4:00 on a Friday I'm not happy that I can't get this basic Tiles
> stuff working. Any ideas what I might be doing wrong?
>
> Thanks,
> Rick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles headaches - should be simple - driving me nuts here...
Posted by Hubert Rabago <hr...@gmail.com>.
Rick,
My tiles:insert uses name instead of attribute.
<tiles:insert name="header" flush="false"/>
Then again, I'm no Tiles expert and I don't know what attribute is for.
Hubert
On 4/14/06, Rick Reumann <ri...@gmail.com> wrote:
> I've used Tiles in the past. Started to implement it in this new app,
> and I keep getting error messages like...
>
> javax.servlet.jsp.JspException: Error - Tag Insert : No value found
> for attribute 'header'.
> at org.apache.struts.taglib.tiles.InsertTag.processAttribute(InsertTag.java:690)
> at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:478)
> <snip/>
>
> Basically it seems as if none of the attributes I define in my tiles
> definition file are being able to be picked up by the main layout. I'm
> hoping someone can pick up something that I'm doing really dumb here.
>
> Here's some info..
>
> Tiles Definition
> ---------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE tiles-definitions PUBLIC
> "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
> "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
> <tiles-definitions>
>
> <definition name="main.layout" path="/mainLayout.jsp">
> <put name="header" value="/WEB-INF/jsp/header.jsp"/>
> <put name="content" value="yrdy"/>
> </definition>
> <definition name="main.page" extends="main.layout">
> <put name="content" value="/WEB-INF/jsp/main.jsp"/>
> </definition>
>
> </tiles-definitions>
>
> (files header.jsp and main.jsp exist. mainLayout.jsp displays fine
> also when I remove the tiles:insert sections.) I've also tried the
> above 1_3.dtd defintion, but I think that gave me other problems. I
> know the above 1_1 version was working in another app that I believe
> had my 1.2.7 struts jar.
>
> mainLayout.jsp
> ---------------------
>
> <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
> <---- snipped out extra html junk ----->
> <body>
> <div id="contents">
> <tiles:insert attribute="header"/>
>
> <div id="main-content-box">
> <tiles:insert attribute="content"/>
> </div>
> </div>
>
> Again, if I comment out the above tiles:insert lines this page will
> display (minus the tiles content I'm trying to add of course).
>
> struts-config
> -----------------
> The docs are a bit confusing on this, since in the docs it says you should add
>
> <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"></controller>
>
> I've tried including and remove the above.
>
> I also include the plugin definition:
>
> <plug-in className="org.apache.struts.tiles.TilesPlugin">
> <set-property property="definitions-config"
> value="/WEB-INF/tiles-definitions.xml"/>
> <set-property property="moduleAware" value="true"/>
> <set-property property="definitions-parser-validate" value="true"/>
> </plug-in>
>
>
> Other thoughts
> ---------------------
> I removed all filters that I have running, thinking maybe they were
> mangling some request or session parameters.
>
> The test i'm doing from the index page just has
>
> <a href="authenticate.do">clickme</a>
>
> And the action-mapping for it:
>
> <action
> path="/authenticate"
> type="com.nielsenmedia.npn.action.AuthenticateAction"
> >
> <forward name="success" path="main.page"/>
> </action>
>
> The AuthenticatAction has been stripped down to simply return
> "success" (It doesn't do anything).
>
> I'm using Struts 1.2.9 but also tried some older jars like 1.2.7.
>
>
>
> At 4:00 on a Friday I'm not happy that I can't get this basic Tiles
> stuff working. Any ideas what I might be doing wrong?
>
> Thanks,
> Rick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Tiles headaches - should be simple - driving me nuts here...
Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Hi Rick,
I can't see anything that looks wrong but a couple of ideas might throw
something up:
- mainLayout.jsp is in / but your other jsps are in WEB-INF/jsp/ - is
that right?
- try renaming your tiles 'put-names', e.g. header -> headerTile (I find
this gives more readily comprehensible errors from Struts)
- check that each module's struts-config either contains the correct
tiles plugin reference, or doesn't contain one at all
Intriguing!
rgds
Adam
Rick Reumann on 14/04/06 21:04, wrote:
> I've used Tiles in the past. Started to implement it in this new app,
> and I keep getting error messages like...
>
> javax.servlet.jsp.JspException: Error - Tag Insert : No value found
> for attribute 'header'.
> at org.apache.struts.taglib.tiles.InsertTag.processAttribute(InsertTag.java:690)
> at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:478)
> <snip/>
>
> Basically it seems as if none of the attributes I define in my tiles
> definition file are being able to be picked up by the main layout. I'm
> hoping someone can pick up something that I'm doing really dumb here.
>
> Here's some info..
>
> Tiles Definition
> ---------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE tiles-definitions PUBLIC
> "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
> "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
> <tiles-definitions>
>
> <definition name="main.layout" path="/mainLayout.jsp">
> <put name="header" value="/WEB-INF/jsp/header.jsp"/>
> <put name="content" value="yrdy"/>
> </definition>
> <definition name="main.page" extends="main.layout">
> <put name="content" value="/WEB-INF/jsp/main.jsp"/>
> </definition>
>
> </tiles-definitions>
>
> (files header.jsp and main.jsp exist. mainLayout.jsp displays fine
> also when I remove the tiles:insert sections.) I've also tried the
> above 1_3.dtd defintion, but I think that gave me other problems. I
> know the above 1_1 version was working in another app that I believe
> had my 1.2.7 struts jar.
>
> mainLayout.jsp
> ---------------------
>
> <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
> <---- snipped out extra html junk ----->
> <body>
> <div id="contents">
> <tiles:insert attribute="header"/>
>
> <div id="main-content-box">
> <tiles:insert attribute="content"/>
> </div>
> </div>
>
> Again, if I comment out the above tiles:insert lines this page will
> display (minus the tiles content I'm trying to add of course).
>
> struts-config
> -----------------
> The docs are a bit confusing on this, since in the docs it says you should add
>
> <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"></controller>
>
> I've tried including and remove the above.
>
> I also include the plugin definition:
>
> <plug-in className="org.apache.struts.tiles.TilesPlugin">
> <set-property property="definitions-config"
> value="/WEB-INF/tiles-definitions.xml"/>
> <set-property property="moduleAware" value="true"/>
> <set-property property="definitions-parser-validate" value="true"/>
> </plug-in>
>
>
> Other thoughts
> ---------------------
> I removed all filters that I have running, thinking maybe they were
> mangling some request or session parameters.
>
> The test i'm doing from the index page just has
>
> <a href="authenticate.do">clickme</a>
>
> And the action-mapping for it:
>
> <action
> path="/authenticate"
> type="com.nielsenmedia.npn.action.AuthenticateAction"
> >
> <forward name="success" path="main.page"/>
> </action>
>
> The AuthenticatAction has been stripped down to simply return
> "success" (It doesn't do anything).
>
> I'm using Struts 1.2.9 but also tried some older jars like 1.2.7.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org