thanks.
I just figured out a few errors in my files. but the
most serious one is that struts can not use definition
is global forward directly (?)
here are the new files:
in my index.jsp
---------------
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<logic:redirect forward="login"/>
in my struts-config.xml
------------------------
<global-forwards>
<forward
name="login"
path="/Login.do"/>
</global-forwards>
<action-mappings>
<action path="/Login"
type="net.canal.util.BlankAction">
<forward name="success" path=".baseDef" />
</action>
I have to develop the BlankAction which simply returns
'success' this way struts can make use the Tiles def
(.baseDef)
rgds
li xin
--- David Friedman <[EMAIL PROTECTED]> wrote:
> Li,
>
> I'm guessing that your tile named "loginDef" is
> overriding your forward
> "loginDef". That's why I start my tiles with a
> period in the name
> ".loginDef". If that doesn't work, try changing
> your index.jsp to this:
> (and old post of mine)
>
> <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles"
> %>
> <tiles:insert definition="loginDef"/>
>
> Or something like that. The exact syntax is in
> section 4.1.2 of the Tiles
> Advanced Features by Cedric Dumoulin at
>
http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf
> but that seems
> to list <tiles:insert beanName="loginDef" ... />
> (beanName instead of
> definition).
>
> Regards,
> David
>
> -----Original Message-----
> From: lixin chu [mailto:[EMAIL PROTECTED]
> Sent: Sunday, January 04, 2004 8:10 AM
> To: [EMAIL PROTECTED]
> Subject: Config Tiles with Struts
>
>
> hi all,
> i am new to Struts. A question about configuring
> Tiles
> and Struts. Hear are my files:
>
> struts-config.xml
> -----------------
> ......
> <plug-in
> className="org.apache.struts.tiles.TilesPlugin">
> <set-property
> property="pathnames"
> value="WEB-INF/tiles-defs.xml"/>
> </plug-in>
> ......
> <global-forwards>
> <forward
> name="loginDef"
> path="/loginDef.do"/>
> </global-forwards>
> ......
> <action
> path="loginDef"
> type="org.apache.struts.actions.ForwardAction"
> parameter="loginDef"/>
>
> tiles-defs.xml
> --------------
> ......
> <definition name="baseDef"
> path="/layouts/layout.jsp">
> <put name="header" value="/pages/header.jsp">
> <put name="screen" value="">
> <put name="footer" value="/pages/footer.jsp">
> </definition>
>
> <definition name="loginDef" extends="baseDef">
> <put name="screen" value="/pages/login.jsp">
> </definition>
>
> index.jsp
> ---------
> <%@ taglib uri="/tags/struts-logic" prefix="logic"
> %>
> <logic:redirect forward="loginDef"/>
>
> layout.jsp
> ----------
> <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles"
> %>
> <html
> <body>
>
> <table cellspacing="0" cellpadding="0">
> <tr>
> <td>
> <%-- include header --%
> <tiles:insert attribute="header"/>
> </td>
> </tr>
> <%-- disable this first
> <tr>
> <td>
> <%-- include body --%
> <tiles:insert attribute="screen"/>
> </td>
> </tr>
> --%>
> <tr>
> <td>
> <%-- include footer --%
> <tiles:insert attribute="footer"/>
> </td>
> </tr>
>
> </table>
>
> </html>
> </body>
>
> header.jsp
> ----------
> <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
> <%@ taglib uri="/tags/struts-html" prefix="html" %>
> <%@ taglib uri="/tags/struts-logic" prefix="logic"
> %>
>
> <table cellspacing="0" cellpadding="0" width="100%">
> <tr>
> <td width="25%" align="left">
> <html:img page="/images/canal-logo.bmp"/>
> </td>
>
> <td width="60%" align="center">
> Canal
> </td>
>
> <td width="15%">
> </td>
> </tr>
> </table>
>
>
> folder structure
> ----------------
> webapps/myapp
> |_layouts/layout.jsp
> |_pages/header.jsp, footer.jsp, login.jsp
> |_WEB_INF/struts-config.xml, tiles-def.xml,
> etc.
>
>
> error msg in browser
> ---------------------
> HTTP Status 400 - Invalid path /loginDef was
> requested
>
-----------------------------------------------------
> type Status report
>
> message Invalid path /loginDef was requested
>
> description The request sent by the client was
> syntactically incorrect (Invalid path /loginDef was
> requested).
>
> what's wrong with my configuration ?
>
> thanks in advance,
> li xin
>
> __________________________________
> Do you Yahoo!?
> Find out what made the Top Yahoo! Searches of 2003
> http://search.yahoo.com/top2003
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]