You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/01/15 18:23:53 UTC

DO NOT REPLY [Bug 16117] New: - Html Link tag

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16117>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16117

Html Link tag

           Summary: Html Link tag
           Product: Struts
           Version: 1.1 Beta 2
          Platform: Other
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Custom Tags
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: antonys@gointernet.co.uk
                CC: antonys@gointernet.co.uk


I have two module in my web app : module1(set as default), module2.
Each have it own struts config file, respectivley, struts-config-module1.xml 
and struts-config-module2.xml.

As example, you place a <html:link forward="module2_forward"> on a JSP page 
test.jsp which is in the location "/webapp/module2/test.jsp". The forward 
"module2_forward" is defined in module2 struts-config-module2.xml and not 
defined in struts-config-module1.xml.

Before any request is processed for an Action, the ActionServlet calls 
RequestUtils.selectApplication(). This method places the appropiate 
ApplicationConfig on the 
HttpRequest as an attribute under the key 'Action.APPLICATION_KEY'.
Once the request is processed for this Action and the resulting ActionForward 
has a redirect to "/webapp/module2/test.jsp", the ApplicationConfig is lost due 
to the 
result being a rediect.

The <html:link forward="module2_forward"> tag on test.jsp throw the following 
exception :
javax.servlet.ServletException: Cannot create rewrite URL: 
java.net.MalformedURLException: Cannot retrive ActionForward named 
module2_forward.

The reason why this happens is beacuse the 
org.apache.struts.taglib.html.LinkTag calls RequestUtils.computeURL(). Which in 
turn tries to get the forward named  
"module2_forward" from the default module (struts-config-module1.xml) 
ApplicationConfig. As this forward is not in the default  ApplicationConfig, 
the result is a 
java.net.MalformedURLException.

The solution would be for RequestUtils.computeURL() to work out which module, 
thus which ApplicationConfig, the resulting page belongs to.

Antony

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>