[ 
https://issues.apache.org/jira/browse/WICKET-2078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670963#action_12670963
 ] 

Hardi Probst commented on WICKET-2078:
--------------------------------------

I tried it, but it seems not possible to test this case yet 
(redirectLocationUrl in processActionResponseState is null, so 
setRenderParameters is not called in WPS). 
I believe this is a subsequent error, so I suggest to start with a simpler 
case.  
I compared the Navomatic-Portlet from the wicket-examples by clicking on 
"Page2":

JBoss Portal 2.7.1-GA  
WicketPortlet - processRequest: phase=RENDER_PHASE parameters: 
_wuview=/navomatic/?wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;
WicketFilter  - doFilter: phase=RENDER_PHASE parameters: 
wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;_wuview=/navomatic/?wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;

Websphere Portal 6.1:
WicketPortlet - processRequest: phase=RENDER_PHASE parameters: 
_wuview=/navomatic/?wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;
WicketFilter  - doFilter: phase=RENDER_PHASE parameters: 
_wuview=/navomatic/?wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;

What you can see here is that in JBoss the filter (called via 
PortletRequestDispatcher.include from WicketPortlet) "sees" the 
"wicket:bookmarkablePage"-parameter as a separate one (assumption: done by the 
container parsing the query part of the wicketURL).
Conclusion: WPS does NOT extract the query parameter from wicketURL!

Lets try the Request-Wrapper solution:
I implemented two RequestWrappers to use them in the 
PortletRequestDispatcher.include call within WicketPortlet.
Have a look at patch2.txt
CAUTION: The provided ParamRenderRequestWrapper and ParamActionRequestWrapper 
is just a proof-of-concept quality implementation (e.g. no copying of returned 
objects)!

Result with Patch2:

JBoss Portal 2.7.1-GA:  
WicketPortlet - processRequest: phase=RENDER_PHASE parameters: 
_wuview=/navomatic/?wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;
WARN  - Application - No current Application found - defaulting encoding to 
UTF-8
WARN  - Application - No current Application found - defaulting encoding to 
UTF-8
WicketFilter  - doFilter: phase=RENDER_PHASE parameters: 
wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;_wuview=/navomatic/?wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;

Websphere Portal 6.1:
INFO  - WicketPortlet - processRequest: phase=RENDER_PHASE parameters: 
_wuview=/navomatic/?wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;
WARN  - Application   - No current Application found - defaulting encoding to 
UTF-8
WARN  - Application   - No current Application found - defaulting encoding to 
UTF-8
INFO  - WicketFilter  - doFilter: phase=RENDER_PHASE parameters: 
_wuview=/navomatic/?wicket:bookmark
ablePage=:org.apache.wicket.examples.navomatic.Page2;wicket:bookmarkablePage=:org.apache.wicket.examples.navomatic.Page2;

Now the examples (navomatic and echo) work on WPS 6.1, but patch2 rises new 
problems:

- "No current Application found" warnings on both servers
- on jboss I get the excepton "java.lang.IllegalStateException: Response is 
already committed" when submitting the form of the echo example:

WicketPortlet - processRequest: phase=ACTION_PHASE parameters: 
msgInput=aaaaa;_wu=/echo/?wicket:interface=:0:form::IFormSubmitListener::;formjbpns__2fdefault__2fwicket__2fwicket__2dechoWindowsnpbj__1_hf_0=;
Application                - No current Application found - defaulting encoding 
to UTF-8
Application                - No current Application found - defaulting encoding 
to UTF-8
WicketFilter               - JSR286 doFilter: phase=ACTION_PHASE parameters: 
msgInput=aaaaa;wicket:interface=:0:form::IFormSubmitListener::;_wu=/echo/?wicket:interface=:0:form::IFormSubmitListener::;formjbpns__2fdefault__2fwicket__2fwicket__2dechoWindowsnpbj__1_hf_0=;
WicketFilter               - JSR286 doFilter: phase=ACTION_PHASE parameters: 
msgInput=aaaaa;wicket:interface=:0:form::IFormSubmitListener::;_wu=/echo/?wicket:interface=:0:form::IFormSubmitListener::;formjbpns__2fdefault__2fwicket__2fwicket__2dechoWindowsnpbj__1_hf_0=;
WicketFilter               - closing the buffer error
java.lang.IllegalStateException: Response is already committed
        at 
org.apache.wicket.protocol.http.portlet.WicketResponseState.failIfCommitted(WicketResponseState.java:134)
        at 
org.apache.wicket.protocol.http.portlet.WicketResponseState.sendRedirect(WicketResponseState.java:264)
        at 
org.apache.wicket.protocol.http.portlet.PortletServletResponseWrapper.sendRedirect(PortletServletResponseWrapper.java:160)
        at 
org.apache.wicket.protocol.http.WebResponse.redirect(WebResponse.java:237)
        at 
org.apache.wicket.protocol.http.BufferedWebResponse.close(BufferedWebResponse.java:66)
        at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:485)
        at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:302)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
        at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
        at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
        at 
org.jboss.portal.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:142)
        at 
org.jboss.portal.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:84)
        at 
org.apache.wicket.protocol.http.portlet.WicketPortlet.processRequest(WicketPortlet.java:610)
        at 
org.apache.wicket.protocol.http.portlet.WicketPortlet.processAction(WicketPortlet.java:524)

> WICKET-2058 does not support IBM Websphere Portal Server 6.1
> ------------------------------------------------------------
>
>                 Key: WICKET-2078
>                 URL: https://issues.apache.org/jira/browse/WICKET-2078
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-portlet
>         Environment: WebSphere Platform 6.1 [ND 6.1.0.15 cf150808.12]  
>            Reporter: Hardi Probst
>            Assignee: Ate Douma
>         Attachments: patch.txt, patch2.txt
>
>
> First of all I want to say thanks a lot for resolving the issue WICKET-2058 
> to Ate, Thijs and Antony!
> I checked out the revision 739543 from trunk and experimented/tested a lot 
> with the wicket examples within IBM Websphere Portal 6.1.
> I had to add the following lines into web.xml to get the first 
> example-portlets visible in my browser:
>   <context-param>
>     <param-name>org.apache.wicket.detectPortletContext</param-name>
>     <param-value>true</param-value>
>   </context-param>
> The next problem I stumbled over was that the generated links (e.g. 
> BookmarkablePageLink<Void>("link", PageXY.class) ) did not work at all.
> I traced the problem down to the point that the generated wicketURL in 
> PortletRequestContext.encodeRenderURL includes all query-parameters but the 
> PortletFilter does 
> not get them as parameters, just the path-part.
> WicketPortlet.processRequest:
>       PortletRequestDispatcher rd = 
> getPortletContext().getRequestDispatcher(wicketURL);
>       if (rd != null)
>       {
>               // delegate to wicket filter - this is where the magic happens
>               rd.include(request, response);
>               ...
> Let's assume wicketURL has the value of 
> "/repeater/?wicket:interface=:8:oir:17:toggleHighlite:2:ILinkListener::", the 
> result would be the same as the value of "/repeater/".
> I was able to fix it by applying the query parameters as "real" parameters to 
> the javax.portlet.PortletURL for Action and Render-URLs (see Patch for 
> PortletRequestContext).
> After that I had the same problem with form-submission. The form-values came 
> in perfectly to the model, but after leaving the ACTION-PHASE the state was 
> all gone in RENDER-PHASE. 
> So I did the same in WicketPortlet.processActionResponseState and applied all 
> wicketURL-query parameteters to the response (setRenderParameter). see Patch 
> for WicketPortlet.
> Another solution could be a PortletRequestWrapper within the WicketFilter 
> implementation. Or does anybody have a better idea?
> It would be really great to see this issue fixed in wicket 1.4!
> I'll keep on testing the next days with the ajax examples (some worked 
> already with the provided patch applied) and WPS 6.1...

-- 
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