Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: bridge-ext-1.0.0, bridge-ext-2.0.0, bridge-ext-3.0.0, bridge-ext-4.0.0, bridge-ext-5.0.0
-
Labels:None
Description
Steps to reproduce:
1. Change the jsf-applicant-portlet code:
/* ... */ public String getRenderRedirURL() { HashMap<String, List<String>> parameters = new HashMap<String, List<String>>(); ArrayList<String> values = new ArrayList<String>(); values.add("adsf asdf "); parameters.put("param", values); return FacesContext.getCurrentInstance().getExternalContext().encodeRedirectURL("/o/com.liferay.faces.demo.jsf.applicant.portlet/WEB-INF/views/search.xhtml", parameters); } /* ... */
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head /> <f:metadata> <f:viewParam name="param" value="asdf asdf " /> </f:metadata> <h:body> <h:form> <h:commandButton value="portletViewMode ajax" action="portletViewMode?faces-redirect=true&includeViewParams=true"> <f:ajax /> </h:commandButton> <h:commandButton value="portletViewMode" action="portletViewMode?faces-redirect=true&includeViewParams=true" /> <br /> #{applicantBackingBean.renderRedirURL} </h:form> </h:body> </f:view>
2. Deploy and navigate to the jsf-applicant-portlet.
3. Observe the url that appears (generated during RENDER_PHASE).
4. If the url contains param=adsf asdf then the bug still exists for redirect urls generated during the RENDER_PHASE. If the url contains param=adsf+asdf+, then the bug is fixed for the RENDER_PHASE.
5. Click the search ajax button.
6. If the portlet navigates back to portletViewMode.xhtml via ajax and the url contains param=adsf+asdf+, the bug is fixed. Otherwise the bug still exists.
Workarounds
Since the redirect url parameters are generated correctly in the ACTION_PHASE, you can use a non-ajax command button to redirect to views view parameters with spaces in them:
<h:commandButton value="portletViewMode" action="portletViewMode?faces-redirect=true&includeViewParams=true" />
Another potential workaround is to remove all spaces from your params or replace all spaces with "+" before JSF handles the URL.