As you've probably found-out this syntax does not work in tiles-defs.xml(!)
... but a similar result can be achieved in a definition in a JSP page.  One
option may be to define your "loginform" attribute as say, mainForm.jsp that
could then use el (or logic) tags to determine which jsp to include.

A better option may be to use the "extends" capability of tiles to define 2
layouts that extend "layout" and define the first, e.g. "page.login" with
the login form and e.g. "page.usermenu" with the menu form. You can then
forward to the desired layout based-on a condition, as you have indicated.

Hue.

> -----Original Message-----
> From: Jiri Chaloupka [mailto:[EMAIL PROTECTED]
> Sent: 26 August 2003 13:30
> To: Struts Users Mailing List
> Subject: tiles: condition in tile definition
>
>
> Hallo,
> haw I can define condition in tile definition?
>
> for example, I have 3 pages:
>
> basic.jsp:
> **********************
> <html>
> <head></head>
> <body>
> blablabbla
> |<tiles:insert attribute="loginform"/>|
> </body></html>
> **********************
> loginform.jsp:
> **********************
> username:<html:text property="uname" /><br/>
> password:<html:password poperty="pwd" /><br/>
> <html:submit/>
> **********************
> usermenu.jsp:
> **********************
> <a href="changeme.jsp">Change my data</a>
> **********************
>
> object "user" with methods for example
> public boolean isLogged();
> public int getUserID();
>
> and how to write definition as:
>
> |<tiles-definitions>
> <definition name="layout" path="/layout/basic.jsp">
> << if user.isLogged() or user.getUserID() > -1 >> -- first or
> second, do not need booth
>     <put name="loginform" value="usermenu.jsp"/>
> << else >>
> ||    <put name="loginform" value="loginform.jsp"/>
> << end if >>
> ...
> ||</definition>
> <tiles-definitions>
>
> How to do it?
> Thanks, Jiri
> |
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to