[ 
https://issues.apache.org/jira/browse/WICKET-2711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ate Douma resolved WICKET-2711.
-------------------------------

    Resolution: Duplicate

This issue has been reported before, see WICKET-2078 and is a bug in the 
WebSphere 6.1 container.
IBM seems to have fixed this with Portal-APAR PK89992, see 
http://www-01.ibm.com/support/docview.wss?rs=180&context=SSEQTP&dc=DB550&uid=swg1PK89992&loc=en_US&cs=UTF-8&lang=en&rss=ct180websphere
  for more information. 

> Wicket 1.4.5 + Websphere Portal Express 6.1: query string parameters are not 
> forwarded through WicketPortlet
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-2711
>                 URL: https://issues.apache.org/jira/browse/WICKET-2711
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-portlet
>    Affects Versions: 1.4.5
>         Environment: Windows XP SP3 
> jdk1.5.0_15 
> Wicket 1.4.5 
> Spring 2.5.2 
> Websphere Portal Express 6.1
>            Reporter: Uttam Phalnikar
>            Assignee: Ate Douma
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> In my application, I am using portlet init parameter "viewPage" to define 
> view page URL with query string parameter. For e.g.
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>       <portlet>
>               <description>My Test</description>
>               <portlet-name>Test</portlet-name>
>               <display-name>Test</display-name>
>               
> <portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</portlet-class>
>               <init-param>
>                       <name>wicketFilterPath</name>
>                       <value>/test</value>
>               </init-param>
>               <init-param>
>                       <name>viewPage</name>
>                       <value>/test?portletid=portlet1</value>
>               </init-param>
>               <supports>
>                       <mime-type>*/*</mime-type>
>                       <portlet-mode>VIEW</portlet-mode>
>               </supports>
>               <portlet-info>
>                       <title>Test Portlet</title>
>                       <keywords>Wicket</keywords>
>               </portlet-info>
>       </portlet>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> In my web.xml, I have filter mapping that maps "/test/*" to WicketFilter. The 
> home page of my application displays appropriate contents on the basis of 
> "portletid".
> This setup works fine with JBoss Portal 2.7.2, but with Websphere Portal 
> Express 6.1, my home page never gets the "portletid" parameters. 
> After investigation, it was realized that 
> org.apache.wicket.protocol.http.portlet.PortletServletRequestWrapper has 
> logic to obtain the querystring from wrapped request, but doesnt override 
> methods getParameterMap / getParameters & getParameter to convert query 
> string into parameters. I am not very sure whether Websphere Portal Server 
> has any setting to do this conversion. 
> Here is the workaround that I have used
> 1. Created MyServletWebRequest that extends ServletWebRequest 
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> public class MyServletWebRequest extends ServletWebRequest {
>   private Map<String, String[]> paramMap;
>   public MyServletWebRequest(HttpServletRequest httpServletRequest) {
>     super(httpServletRequest);
>     if (httpServletRequest instanceof PortletServletRequestWrapper) {
>       String qs = this.getQueryString();
>       if (StringUtil.hasLength(qs)) {
>         paramMap = new HashMap<String, String[]>();
>         StringTokenizer tokens = new StringTokenizer(qs, "&");
>         while (tokens.hasMoreTokens()) {
>           String tuple = tokens.nextToken();
>           int index = tuple.indexOf("=");
>           if (index != -1) {
>             String key = tuple.substring(0, index);
>             String value = tuple.substring(index + 1);
>             paramMap.put(key, new String[] { value });
>           }
>         }
>       } else {
>         paramMap = Collections.EMPTY_MAP;
>       }
>     }
>   }
>   @Override
>   public Map getParameterMap() {
>     Map<String, String[]> combinedMap =
>       new HashMap<String, String[]>(super.getParameterMap());
>       combinedMap.putAll(paramMap);
>     return combinedMap;
>   }
>   @Override
>   public String getParameter(String key) {
>     if (paramMap.containsKey(key))
>       return paramMap.get(key)[0];
>     return super.getParameter(key);
>   }
>   @Override
>   public String[] getParameters(String key) {
>     if (paramMap.containsKey(key))
>       return paramMap.get(key);
>     return super.getParameters(key);
>   }
> }
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 2. Then updated the MyWebApplication class (extends WebApplication) to 
> override newWebRequest method
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>   @Override
>   protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
>     return new MyServletWebRequest(servletRequest);
>   }
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> That has solved the issue. 
> I think PortletServletRequestWrapper should override getParameterMap / 
> getParameters & getParameter methods. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to