Ticket #741 (new defect)

Opened 11 months ago

Last modified 11 months ago

Struts 2 URLHelper bug

Reported by: rich Assigned to: jkirton
Priority: low Milestone:
Component: ambra Version:
Keywords: struts Cc:
Blocking: Blocked By:

Description

https://issues.apache.org/struts/browse/WW-1563

It seems like this patch conflicts with the way org.apache.struts2.views.util.URLHelper determines what to do. URLHelper's buildUrl method first checks to see if javax.servlet.forward.request_uri is set, and if so, uses that as the value for the URI. The problem with the patch in 1563 is that it checks the regular query string first. Thus, you will get the original uri but the forwarded (modified) query string. I think the patch should look like this in extractQueryString of org.apache.struts2.components.URL.java:

String query = null; if (req.getAttribute("javax.servlet.forward.request_uri") != null) {

query = (String) req.getAttribute("javax.servlet.forward.query_string");

} else {

query = req.getQueryString();

}

Dependency Graph

Change History

01/07/08 17:35:05 changed by rich

  • milestone deleted.