|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
FW: Missing attributeI've been debugging the tiles code
and have made some progress. I have four tiles that make up a single
html page. The tile at the top (header) has three attributes and the tile in
the middle (body, the one that is using an attribute for the first time) is in
the middle and has one. When I run through the InsertAttributeTag
for the header I can see all of the attributes listed below, e.g.,
logoutErrorKey, titleKey, body, etc. in the attributes for evaluatingContext.
When I run through the same code for the JSP in the middle, attributes is null.
Any ideas why this may be happening? From: I've been using tiles for about two years, but only on
an app I inherited from someone else, so I'm still kinda a newbie. I'm trying to extend a definition in my tiles so I can
re-use an existing JSP and just add one error message. Here's the appropriate
tiles entries: <definition name=".logout" extends=".baseDef"> <put-attribute
name="logoutErrorKey"
value="" /> <put-attribute
name="titleKey"
value="logout.title"
/> <put-attribute
name="welcomeKey"
value="logout.welcome"/> <put-attribute
name="menu"
value="/WEB-INF/view/logout_Menu.jsp"
/> <put-attribute
name="body"
value="/WEB-INF/view/logout.jsp"/> </definition> <definition name=".logoutTimeout"
extends=".logout"> <put-attribute
name="logoutErrorKey"
value="logout.timeout"
/> </definition> Then I added this to my JSP: <tiles:insertAttribute name="logoutErrorKey"/> I changed my app to forward to .logoutTimeout and I get the
following error: 144623 ERROR
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport | Error executin g tag: Attribute 'logoutErrorKey' not found. org.apache.tiles.TilesException: Attribute 'logoutErrorKey'
not found. at
org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttribute Tag.java:112) at
org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport .java:171) at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecur ityTagSupport.java:75) at
org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTag Support.java:80) And I have no idea where to go next. Help, please? Thom Hehl ) Office
(859) 277-8800 x 144 This e-mail message, including any attachments,
is for the sole use of the intended recipient(s) and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution 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 and notify sender via e-mail at Thomas.Hehl@... or by
telephone at 859-277-8800 ext. 144. Thank you. |
|
|
Re: FW: Missing attribute2008/8/26 Hehl, Thomas <Thomas.Hehl@...>:
> <tiles:insertAttribute name="logoutErrorKey"/> Excuse, but where did you put this code? Is it in the template of ".logoutTimeout" definition? Antonio |
|
|
|
|
|
|
|
|
Re: FW: Missing attribute2008/8/26 Hehl, Thomas <Thomas.Hehl@...>:
> This code is in logout.jsp, which is the jsp that is inserted into the body. > We have a main layout that has tiles header, body, menu, footer. In this > instance, body, contains logout.jsp, which has this tag in it. Make sense? Yes, the reason was under my nose and I did not find it :-D In Tiles 2.0.x you cannot propogate an attribute to inner attributes. Either try Tiles 2.1.0 (currently in test build phase) or create a definition, put the attribute that you want and put it in place of the "body" attribute. BTW you can download Tiles 2.1.0 *test build* at: http://people.apache.org/builds/tiles/2.1.0/ HTH Antonio |
|
|
|
|
|
Re: FW: Missing attribute2008/8/26 Hehl, Thomas <Thomas.Hehl@...>:
> Again, I'm almost a newb to tiles. Please explain the create a definition > thing you're referring to below. Ok let's start from your original definitions: <definition name=".logout" extends=".baseDef"> <put-attribute name="logoutErrorKey" value="" /> <put-attribute name="titleKey" value="logout.title" /> <put-attribute name="welcomeKey" value="logout.welcome"/> <put-attribute name="menu" value="/WEB-INF/view/logout_Menu.jsp" /> <put-attribute name="body" value="/WEB-INF/view/logout.jsp"/> </definition> <definition name=".logoutTimeout" extends=".logout"> <put-attribute name="logoutErrorKey" value="logout.timeout" /> </definition> Essentially you need to assign an attribute in "logout.jsp", present in "body" attribute inside the ".logout" definition. So let's define a new definition: <definition name=".logoutBody" template="/WEB-INF/view/logout.jsp"> <put-attribute name="logoutErrorKey" value="logout.timeout" /> </definition> And let's redefine the ".logoutTimeout" definition: <definition name=".logoutTimeout" extends=".logout"> <put-attribute name="body" value=".logoutTimeout" /> </definition> HTH Antonio |
|
|
Re: FW: Missing attribute2008/8/26 Antonio Petrelli <antonio.petrelli@...>:
> <definition name=".logoutTimeout" extends=".logout"> > <put-attribute name="body" value=".logoutTimeout" /> > </definition> Sorry! I meant: <put-attribute name="body" value=".logoutBody" /> Antonio |
|
|
|
| Free Forum Powered by Nabble | Forum Help |