This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes tiles question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "tiles question " Watch "tiles question " New topic
Author

tiles question

SANJAY KUMAR
Greenhorn

Joined: Mar 27, 2002
Posts: 25
hi friends,
If if I have tile def like



<definition name="ADef" extends="newDef">
<put name="body" value="newB"/>
</definition>

<definition name="AADef" extends="newDef">
<put name="body" value="newC"/>
</definition>

<definition name="newB" page="/login/login.jsp">
<put name="first" value="/login/myLogin.jsp"/>
<put name="second" value="/common/common.jsp"/>
</definition>

<definition name="newC" page="/login/login.jsp">
<put name="first" value="/login/myLogin.jsp"/>
<put name="second" value="/common/common.jsp"/>
<put name="third" value="/common/third.jsp"/>
</definition>




-----------------------------------------------

My login.jsp is like

<tiles:insert attribute="first"/>
<tiles:insert attribute="second"/>
<tiles:insert attribute="third"/>

------------------------------------------

Will I get error if I call ADef as I am not passing variable third.

Please advice me

Thanks


SCJP, SCWCD , SCBCD
Joan Horta Tosas
Ranch Hand

Joined: Feb 01, 2007
Posts: 59
To avoid an exception to be thrown, put in the tiles:insert tag that can be optional the attribute ignore="true"
ignore: If this attribute is set to true, and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown. [RT Expr]
SANJAY KUMAR
Greenhorn

Joined: Mar 27, 2002
Posts: 25
Thanks a lot
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: tiles question