[JBoss JIRA] (WFLY-3279) HttpServletResponse.sendRedirect() not working for relative URL
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-3279?page=com.atlassian.jira.plugin.... ]
Stuart Douglas resolved WFLY-3279.
----------------------------------
Fix Version/s: 8.1.0.Final
Resolution: Done
> HttpServletResponse.sendRedirect() not working for relative URL
> ---------------------------------------------------------------
>
> Key: WFLY-3279
> URL: https://issues.jboss.org/browse/WFLY-3279
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Web (Undertow)
> Affects Versions: 8.0.0.Final, 8.1.0.CR1
> Environment: Windows
> Reporter: Mehboob Alam
> Assignee: Stuart Douglas
> Fix For: 8.1.0.Final
>
> Attachments: Recreate_SendRedirect_Problem.ear
>
>
> I cannot get HttpServletResponse.sendRedirect() to work correctly. This only happens to me with Wildfly. It works on previous versions of JBoss EAP/AS and several other app servers where I tested the scenario.
>
> The sample app has two servlet. I navigate from one to the other using sendRedirect. The key seems to be relative path in the form "../whatever/whatever" is not working.
> To test this, I enter my app's URL like this-
> http://localhost:8080/helloworld/hello
> Then, inside the first servlet, I do a redirect -
> String url = "../goodbye/bye";
> response.sendRedirect(response.encodeRedirectURL(url));
> wildfly 8 gives me a HTTP Status 404. wildfly 8.1 CR1 gives me a HTTP Status 403. All other app server works. It takes me to this url:
> http://localhost:8080/goodbye/bye
> JBoss eap-6-1-0
> Status Host Path
> 302 localhost:8080 /helloworld/hello
> 200 localhost:8080 /goodbye/bye/
> WildFly 8.0 Final
> Status Host Path
> 302 localhost:8080 /helloworld/hello
> 404 localhost:8080 /helloworld/
> WildFly 8.1.0 CR1 Final
> Status Host Path
> 302 localhost:8080 /helloworld/hello
> 403 localhost:8080 /helloworld/
> This behavior also appears to be different than that of java.net.URL,
> public URL(URL context, String spec)
> throws MalformedURLException
> which states this: If the spec's path component begins with a slash character "/" then the path is treated as absolute and the spec path replaces the context path.
> Otherwise, the path is treated as a relative path and is appended to the context path, as described in RFC2396. Also, in this case, the path is canonicalized through the removal of directory changes made by occurences of ".." and ".".
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] (WFLY-3277) Fix for JAVASERVERFACES-3189 causes memory leak
by Farah Juma (JIRA)
[ https://issues.jboss.org/browse/WFLY-3277?page=com.atlassian.jira.plugin.... ]
Farah Juma commented on WFLY-3277:
----------------------------------
Because the JSF implementation module dependency is added to every deployment, one ConfigureListener gets registered for every deployment even if it doesn't use JSF (the ConfigureListener is defined in the jsf_core.tld file in the jsf-impl.jar). For apps that use JSF, a second ConfigureListener ends up getting added by Mojarra if the app doesn't contain a mapping of FacesServlet in its web.xml file (this is because of a [workaround | https://issues.jboss.org/browse/WFLY-2594?focusedCommentId=12946617&page=...] for a GlassFish issue that was added to Mojarra 2.x).
I found that the memory leak only affects non-JSF apps though. As discussed with Tomaz, one way to work around the issue is to have the JSF subsystem remove the ConfigureListener from the TLD metadata unless the app has a mapping of FacesServlet in its web.xml. I tried this out (see [here| https://github.com/fjuma/wildfly/commit/fc9157ffc734960f20feb2262ea8c0509...]) and it does work. However, I think I just found a better way to fix this in ConfigureListener by making sure that appropriate clean up is done when ConfigureListener.contextInitialized() is called for an app that doesn't use JSF. I've created the following upstream issue and if my fix looks good to the Mojarra team, I can apply it to our fork:
https://java.net/jira/browse/JAVASERVERFACES-3260
> Fix for JAVASERVERFACES-3189 causes memory leak
> -----------------------------------------------
>
> Key: WFLY-3277
> URL: https://issues.jboss.org/browse/WFLY-3277
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: JSF
> Affects Versions: 8.1.0.CR1
> Reporter: Tomaz Cerar
> Assignee: Farah Juma
> Priority: Blocker
> Fix For: 8.1.0.Final
>
> Attachments: capedwarf-test.war
>
>
> Running capedwarf testsuite we found out that after upgrade to 8.1.0.CR1 testsuite does not complete as server dies with OOM.
> I traced problem down to this commit: https://github.com/jboss/mojarra/commit/d0f9f873dc0f99047a0a5031631d091fa...
> reverting it fixes the problem.
> For what is worth, I think original problem comes from fact that we somehow register two ConfigureListeners for every deployment.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] (WFLY-3295) AsyncContext#start runs in caller thread
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-3295?page=com.atlassian.jira.plugin.... ]
Stuart Douglas resolved WFLY-3295.
----------------------------------
Fix Version/s: 8.1.0.Final
Resolution: Done
> AsyncContext#start runs in caller thread
> ----------------------------------------
>
> Key: WFLY-3295
> URL: https://issues.jboss.org/browse/WFLY-3295
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Web (Undertow)
> Affects Versions: 8.1.0.CR1
> Reporter: Philippe Marschall
> Assignee: Stuart Douglas
> Fix For: 8.1.0.Final
>
> Attachments: AsyncServlet.java
>
>
> {{javax.servlet.AsyncContext.start(Runnable)}} seems to run the runnable in the caller thread. In order for this method to be useful it should be run in a different thread.
> I'll attach a class to demonstrate the issue.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years