Details
Description
Hi,
I encountered a problem on redirect to an URI which contains white-space.
This is the navigation rule in faces-confing.xml:
<navigation-case>
<from-outcome>naviga</from-outcome>
<to-view-id>/name with space.iface</to-view-id>
<redirect/>
</navigation-case>
And this is the stack-trace:
java.lang.IllegalArgumentException
java.net.URI.create(URI.java:842)
com.icesoft.faces.context.BridgeExternalContext.redirect(BridgeExternalContext.java:324)
com.sun.faces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:122)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:89)
javax.faces.component.UICommand.broadcast(UICommand.java:312)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:54)
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:42)
com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46
NOTE: This works fine with ICEfaces 1.5.3 and also in a standard JSF application.
I encountered a problem on redirect to an URI which contains white-space.
This is the navigation rule in faces-confing.xml:
<navigation-case>
<from-outcome>naviga</from-outcome>
<to-view-id>/name with space.iface</to-view-id>
<redirect/>
</navigation-case>
And this is the stack-trace:
java.lang.IllegalArgumentException
java.net.URI.create(URI.java:842)
com.icesoft.faces.context.BridgeExternalContext.redirect(BridgeExternalContext.java:324)
com.sun.faces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:122)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:89)
javax.faces.component.UICommand.broadcast(UICommand.java:312)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:54)
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:42)
com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:46
NOTE: This works fine with ICEfaces 1.5.3 and also in a standard JSF application.
Activity
Arran Mccullough
created issue -
Arran Mccullough
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | JSF_11_RI.war [ 11169 ] |
Deryk Sinotte
made changes -
Assignee | Jack Van Ooststroom [ jack.van.ooststroom ] |
Deryk Sinotte
made changes -
Fix Version/s | 1.7.2 [ 10130 ] | |
Assignee Priority | P2 |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #17372 | Wed Aug 20 10:22:30 MDT 2008 | jack.van.ooststroom | Fixed JIRA |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeExternalContext.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #17373 | Wed Aug 20 10:33:27 MDT 2008 | jack.van.ooststroom | Fixed JIRA |
Files Changed | ||||
MODIFY
/icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/context/BridgeExternalContext.java
|
Jack Van Ooststroom
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #17376 | Wed Aug 20 14:46:45 MDT 2008 | jack.van.ooststroom | Fixed JIRA |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeExternalContext.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #17461 | Thu Aug 28 13:40:45 MDT 2008 | jack.van.ooststroom | Fixed JIRA |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeExternalContext.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #17462 | Thu Aug 28 13:42:23 MDT 2008 | jack.van.ooststroom | Fixed JIRA |
Files Changed | ||||
MODIFY
/icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/context/BridgeExternalContext.java
|
Jack Van Ooststroom
made changes -
Resolution | Fixed [ 1 ] | |
Status | Resolved [ 5 ] | Reopened [ 4 ] |
Jack Van Ooststroom
made changes -
Status | Reopened [ 4 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Fix Version/s | 1.7.2RC1 [ 10140 ] | |
Fix Version/s | 1.7.2 [ 10130 ] |
Ken Fyten
made changes -
Fix Version/s | 1.7.2 [ 10130 ] | |
Fix Version/s | 1.7.2RC1 [ 10140 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P2 | |
Assignee | Jack Van Ooststroom [ jack.van.ooststroom ] |
according to JSF 1.1 specification, the view identifier is not defined as an URI, in fact RFC 2396 is never cited in the spefication document. I see that in ICEFaces implementation the viewId is translated into an URI in order to testing if it's an absolute address or not (look at com.icesoft.faces.context.BridgeExternalContext.redirect(String)), but the view-identifier string is sent to the ICEFaces javascript engine which runs on the browser without encoding it (exaclty like it is written in the navigation rule inside the faces-config.xml). I suppose that this is why you suggested me writing an already converted URI in the navigation rule.
Using ICEFaces 1.5.3 and SUN JSF reference implementation, the view identifier is correctly handled and no errors occur.
If you look at what happens in SUN JSF RI when a redirect occurs, you can see that view identifier string is NEVER used for the istantiation of java.net.URI class , but at the end of navigation handling, the HttpServletResponse is used for executing the redirect operation, as you can see in the method com.sun.faces.context.ExternalContextImpl.redirect(String):
((HttpServletResponse) response).sendRedirect(requestURI);
In the attached WAR, you can see a navigation from "starpage.jsf" to "name with space.jsf".
In the browser URL bar, you can see the translated URI according to RFC 2396, but this translation is made by HttpServletRequest, not by my application:
http://localhost:8080/JSF_11_RI/name%20with%20spaces.jsf
So, in my humble opinion, ICEFaces should check the view identifier string content before using it for instantiating a java.net.URI object. Besides, encondig URI according to RFC 2396 should be done by ICEFaces implementation, exactly like it happens using JSF SUN RI.