History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: UP-1347
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andrew Petro
Reporter: Satish Sekharan
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
uPortal

Request wrappers do not pass the most recent merged copy of the query string and the request parameters.

Created: 21/Nov/05 12:37 PM   Updated: 03/Jul/07 04:12 PM
Component/s: Portlet Container
Affects Version/s: 2.5.0 GA, 2.5.2 RC1, 2.5.1 GA, 2.5.3 RC1, 2.5.2 GA, 2.5.3 RC2, 2.5.3 RC3
Fix Version/s: 2.6.0 M1, 2.5.3 GA

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File PortletParameterRequestWrapper-patch.txt (2 kb)
2. Text File RequestParamWrapper-patch.txt (2 kb)
3. Text File ServletRequestImpl-patch.txt (1 kb)

Issue Links:
Generic Relation
This issue relates to:
UP-1226 JSR-168 portlet cannot access the mul... Blocker Closed
 


 Description  « Hide
While trying to get the JPetstore portlet to work properly in uPortal 2.5 using the Apache Struts Bridge I found some problems with the uPortal request wrappers.

Let me explain, the Struts Bridge uses render parameter _spage to communicate request parameters to Struts.

_spage=/shop/viewCategory.shtml?categoryId=CATS

The embedded portlet url with the _spage request looks like this:
http://locahost:8080/uPortal/tag.37e430d1204c663f.render.userLayoutRootNode.target.101.uP?uP_portlet_action=true&_spage=%2Fshop%2FviewCategory.shtml%3FcategoryId%3DCATS&_sorig=%2Fshop%2Findex.shtml#101

The StrutsPortlet invokes the StrutsServet using a RequestDispatcher object obtained using this path=/shop/viewCategory.shtml?categoryId=CATS

The ServletContext, HttpServletRequest and HttpServletResponse objects are retrieved from ServletContextProvider implemented for uPortal. Then the RequestDispatcher.include() method is called with this HttpServletRequest and HttpServletResponse objects as arguments.

Now in uPortal there are three request wrappers that act on the tomcat ApplicationHttpRequest:

org.jasig.portal.container.servlet.PortletParameterRequestWrapper
org.jasig.portal.container.servlet.ServletRequestImpl
org.jasig.portal.RequestParamWrapper

uPortal wraps the tomcat ApplicationHttpRequest and the constructor for the wrappers in uPortal builds a copy of the parameter map at that point. Subsequently the setQueryParams in ApplicationHttpRequest is called by the ApplicationDispatcher in tomcat. This sets the The query string parameter 'categoryId=CATS' for this request.

Now as per the Servet specification:

SRV.8.1.1 Query Strings in Request Dispatcher Paths

"Parameters specified in the query string used to create the RequestDispatcher take precedence over other parameters of the same name passed to the included servlet. The parameters associated with a RequestDispatcher are scoped to apply only for the duration of the include or forward call."

So at this point the parameters are present in both the query string and the request parameter, they are now merged by tomcat. But the copy of the parameters in the wrapper doesn't reflect the state of the parameters in the tomcat request. So the JPetstore portlet doesn't work and the categoryId parameter is not found.

In addition, I noticed that the the constructor for org.jasig.portal.RequestParamWrapper is incorrect. It access the parameter field before its initialized with any values.

for example
>> boolean isPortletRequest = parameters.containsKey(PortletStateManager.ACTION);

will always be false.


I have attached fixes for both these issues. This is also a fixes a known issue UP-1226.

 All   Comments   Work Log   Change History      Sort Order:
Satish Sekharan [21/Nov/05 12:43 PM]
I have attached the fixes for all the problems mentioned.

Satish Sekharan [21/Nov/05 12:43 PM]
I have attached the fixes for all the problems mentioned.

Brad Johnson [02/Mar/06 07:23 PM]
Patches for UP-1347 should fix UP-1226

Jason Shao [21/Aug/06 05:57 PM]
What's barring us from applying these patches, at least to HEAD? Code review? 2.5.3GA?

Andrew Petro [25/Sep/06 09:57 AM]
Patches applied to 2-5-patches and to HEAD.