You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by PC Leung <pc...@gmail.com> on 2004/10/18 17:20:06 UTC
Does Tiles JSP go in pair?
I use two JSP to form a page.
Is it necessary?
Welcome.jsp:
<tiles:insert definition="erp.mainLayout" flush="true" >
<tiles:put name="body" value="/WelcomeBody.jsp" />
</tiles:insert>
WelcomeBody.jsp:
<bean:message key="main.welcome"/>
<html:link action="login">
<bean:message key="main.login"/>
</html:link>
Login.jsp:
<tiles:insert definition="erp.mainLayout" flush="true" >
<tiles:put name="body" value="/LoginBody.jsp" />
</tiles:insert>
LoginBody.jsp:
<h1><bean:message key="main.login"/></h1>
<logic:messagesPresent>
<bean:message key="errors.header"/>
<ul>
<html:messages id="error">
<li><bean:write name="error"/></li>
</html:messages>
</ul><hr>
</logic:messagesPresent>
<html:form action="/login" focus="username">
<table border="0" width="80%">
<tr>
<td width="30%" align="right">
<bean:message key="loginForm.username"/>
</td>
<td width="70%">
<html:text property="username"/>
</td>
</tr>
<tr>
....
....
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Does Tiles JSP go in pair?
Posted by PC Leung <pc...@gmail.com>.
If I define more layout in tiles-defs.xml
and refer tiles layout in tiles-defs.xml,
how to minimize the layout jsp?
My situation likes this
Welcome.jsp and WelcomeBody.jsp (one page)
calls
Login.jsp and LoginBody.jsp (another page)
On Mon, 18 Oct 2004 12:11:59 -0400, Jeff Beal <jb...@webmedx.com> wrote:
> Read http://www.lifl.fr/~dumoulin/tiles/doc/tutorial.html#_Toc521292381.
> It describes how to move your Tiles definitions (the part in
> Welcome.jsp) into an XML file and using definition names for your Struts
> forwards.
>
> -- Jeff
>
>
>
> PC Leung wrote:
> > I use two JSP to form a page.
> > Is it necessary?
> >
> > Welcome.jsp:
> > <tiles:insert definition="erp.mainLayout" flush="true" >
> > <tiles:put name="body" value="/WelcomeBody.jsp" />
> > </tiles:insert>
> >
> > WelcomeBody.jsp:
> > <bean:message key="main.welcome"/>
> >
> > <html:link action="login">
> > <bean:message key="main.login"/>
> > </html:link>
> >
> > Login.jsp:
> > <tiles:insert definition="erp.mainLayout" flush="true" >
> > <tiles:put name="body" value="/LoginBody.jsp" />
> > </tiles:insert>
> >
> > LoginBody.jsp:
> > <h1><bean:message key="main.login"/></h1>
> > <logic:messagesPresent>
> > <bean:message key="errors.header"/>
> > <ul>
> > <html:messages id="error">
> > <li><bean:write name="error"/></li>
> > </html:messages>
> > </ul><hr>
> > </logic:messagesPresent>
> > <html:form action="/login" focus="username">
> > <table border="0" width="80%">
> > <tr>
> > <td width="30%" align="right">
> > <bean:message key="loginForm.username"/>
> > </td>
> > <td width="70%">
> > <html:text property="username"/>
> > </td>
> > </tr>
> > <tr>
> > ....
> > ....
>
>
> ---------------------------------------------------------------------
> 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: Does Tiles JSP go in pair?
Posted by PC Leung <pc...@gmail.com>.
I start getting to understand how to use Tiles with Struts
Thank you Jeff
On Mon, 18 Oct 2004 12:11:59 -0400, Jeff Beal <jb...@webmedx.com> wrote:
> Read http://www.lifl.fr/~dumoulin/tiles/doc/tutorial.html#_Toc521292381.
> It describes how to move your Tiles definitions (the part in
> Welcome.jsp) into an XML file and using definition names for your Struts
> forwards.
>
> -- Jeff
>
>
>
> PC Leung wrote:
> > I use two JSP to form a page.
> > Is it necessary?
> >
> > Welcome.jsp:
> > <tiles:insert definition="erp.mainLayout" flush="true" >
> > <tiles:put name="body" value="/WelcomeBody.jsp" />
> > </tiles:insert>
> >
> > WelcomeBody.jsp:
> > <bean:message key="main.welcome"/>
> >
> > <html:link action="login">
> > <bean:message key="main.login"/>
> > </html:link>
> >
> > Login.jsp:
> > <tiles:insert definition="erp.mainLayout" flush="true" >
> > <tiles:put name="body" value="/LoginBody.jsp" />
> > </tiles:insert>
> >
> > LoginBody.jsp:
> > <h1><bean:message key="main.login"/></h1>
> > <logic:messagesPresent>
> > <bean:message key="errors.header"/>
> > <ul>
> > <html:messages id="error">
> > <li><bean:write name="error"/></li>
> > </html:messages>
> > </ul><hr>
> > </logic:messagesPresent>
> > <html:form action="/login" focus="username">
> > <table border="0" width="80%">
> > <tr>
> > <td width="30%" align="right">
> > <bean:message key="loginForm.username"/>
> > </td>
> > <td width="70%">
> > <html:text property="username"/>
> > </td>
> > </tr>
> > <tr>
> > ....
> > ....
>
>
> ---------------------------------------------------------------------
> 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: Does Tiles JSP go in pair?
Posted by Jeff Beal <jb...@webmedx.com>.
Read http://www.lifl.fr/~dumoulin/tiles/doc/tutorial.html#_Toc521292381.
It describes how to move your Tiles definitions (the part in
Welcome.jsp) into an XML file and using definition names for your Struts
forwards.
-- Jeff
PC Leung wrote:
> I use two JSP to form a page.
> Is it necessary?
>
> Welcome.jsp:
> <tiles:insert definition="erp.mainLayout" flush="true" >
> <tiles:put name="body" value="/WelcomeBody.jsp" />
> </tiles:insert>
>
> WelcomeBody.jsp:
> <bean:message key="main.welcome"/>
>
> <html:link action="login">
> <bean:message key="main.login"/>
> </html:link>
>
> Login.jsp:
> <tiles:insert definition="erp.mainLayout" flush="true" >
> <tiles:put name="body" value="/LoginBody.jsp" />
> </tiles:insert>
>
> LoginBody.jsp:
> <h1><bean:message key="main.login"/></h1>
> <logic:messagesPresent>
> <bean:message key="errors.header"/>
> <ul>
> <html:messages id="error">
> <li><bean:write name="error"/></li>
> </html:messages>
> </ul><hr>
> </logic:messagesPresent>
> <html:form action="/login" focus="username">
> <table border="0" width="80%">
> <tr>
> <td width="30%" align="right">
> <bean:message key="loginForm.username"/>
> </td>
> <td width="70%">
> <html:text property="username"/>
> </td>
> </tr>
> <tr>
> ....
> ....
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org