[JBoss JIRA] Created: (JBAS-4436) session.getSession(true) does not create new sessionID after invalidation
by Ludwig Adam (JIRA)
session.getSession(true) does not create new sessionID after invalidation
-------------------------------------------------------------------------
Key: JBAS-4436
URL: http://jira.jboss.com/jira/browse/JBAS-4436
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Web (Tomcat) service
Affects Versions: JBossAS-4.0.3 SP1
Environment: JBoss 4.03SP1 running on java version 1.5.0_10, server is a standard SuSE 10 linux
Reporter: Ludwig Adam
Assigned To: Remy Maucherat
It is not possible to generate new session IDs as expected and stated in the servlet specification.
A call of HttpSession.invalidate() unbounds all objects attached to the session but does not set the session to invalid.
Sample Code:
public class SessionTest extends HttpServlet {
protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
HttpSession curSession=httpServletRequest.getSession();
String prevSession = curSession.getId();
curSession.invalidate(); // Should invalidate session
curSession= httpServletRequest.getSession(true); // Should return new valid session, but returns old session instead
String newSession= curSession.getId();
boolean testCondition = prevSession.equals(newSession); // is true
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 8 months
[JBoss JIRA] Created: (JBAS-4303) Web session is empty when forwarding request to another web context.
by Penkov Vladimir (JIRA)
Web session is empty when forwarding request to another web context.
--------------------------------------------------------------------
Key: JBAS-4303
URL: http://jira.jboss.com/jira/browse/JBAS-4303
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Web (Tomcat) service
Affects Versions: JBossAS-4.0.4.GA
Environment: Fedora Core 6
Reporter: Penkov Vladimir
Assigned To: Remy Maucherat
I have following in web.xml:
=====================
<servlet>
<servlet-name>Redirector</servlet-name>
<servlet-class>web.servlet.Redirector</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Redirector</servlet-name>
<url-pattern>/redirect.do</url-pattern>
</servlet-mapping>
<error-page>
<error-code>404</error-code>
<location>/redirect.do</location>
</error-page>
=====================
It is located in /deploy/web.jar. It is deployed under / context.
My jsp are in dir: /deploy/resources.war/, deployed under /resources.
In Redirector I do:
==============
String url = (String) request.getAttribute("javax.servlet.error.request_uri");
String contextPath = (String) context.getAttribute("/resources");
ServletContext c = context.getContext(contextPath);
RequestDispatcher disp = c.getRequestDispatcher(url);
disp.forward(request, response);
==============
So now I can reach my jsp in another context.
In servlet Login I do:
=============
ClientManager manager = new ClientManager();
Client client = manager.findClientByLogin(login);
if (client!=null && client.getPassword().equals(password)) {
request.getSession().setAttribute(CLIENT_KEY, client);
}
response.sendRedirect("/private/index.jsp");
=============
in /deploy/resources.war/private/index.jsp I have:
================
<%
Enumeration e = request.getSession().getAttributeNames();
System.out.println("element names:");
while (e.hasMoreElements()) {
System.out.println("e.nextElement() = " + e.nextElement());
}
%>
================
And I recieve no elements in session.
Variables, sent in the request attributes, are accessible fine.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 8 months
[JBoss JIRA] Created: (JBWEB-77) Servlet throws NPE the first time it is hit.
by Phillip Thurmond (JIRA)
Servlet throws NPE the first time it is hit.
--------------------------------------------
Key: JBWEB-77
URL: http://jira.jboss.com/jira/browse/JBWEB-77
Project: JBoss Web
Issue Type: Bug
Security Level: Public (Everyone can see)
Reporter: Phillip Thurmond
Assigned To: Mladen Turk
Priority: Blocker
The first time a servlet is hit, it throws a NPE. After the exception is thrown, the servlet works correctly. Here is the stack trace. Example war attached.
java.lang.NullPointerException
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:471)
at org.apache.catalina.connector.CoyoteOutputStream.print(CoyoteOutputStream.java:113)
at test.TestServlet.doGet(TestServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:595)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 8 months