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]