struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aidan O'Loan <ai...@magnustechnologies.com>
Subject Dealing with submodules in a Tiles application - 2 issues
Date Tue, 02 Dec 2003 01:37:09 GMT
I'm migrating an application to Tiles. In my main struts-config.xml, I 
have the following forward defined to switch into a submodule:

<forward name="toNewsManager" contextRelative="true" 
path="/newsmanager/index.do" redirect="true" />

This Forward is referenced in a menu.jsp tile which is recreated in ALL 
submodule tiles layouts. It works fine when I am working within the 
default module, but when I enter a submodule, and the menu.jsp tile is 
recreated, I get the following error:

[ServletException in:/menu.jsp] Cannot create rewrite URL: 
java.net.MalformedURLException: Cannot retrieve ActionForward named 
toNewsManager'

So I understand that this is because the Servlet is looking in my 
submodule Struts configuration file for the Forward, when in fact it is 
declared in the main struts-config.xml file. So what's the solution? Do I 
have to recreate all the relevant forwards in every submodule's Struts 
configuration files?


Another issue I have is with <a href="doSomething.do"> links in submodule 
JSP's - for example:

<a href='/editDocument.do?action=view&id=<bean:write name="document" 
property="document_id"/>' title="View">View</a>

These links have stopped working since I have migrated to tiles. Do I now 
need to hard-code the submodule so that the link now looks like:

<a href='/MYSUBMODULE/editDocument.do?action=view&id=<bean:write 
name="document" property="document_id"/>' title="View">View</a>

or is there another solution?



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message