jboss 5.1
I have an application(war) deployed to a proxied server.
I put a logout servlet in the jboss deploy directory and mapped it in server/default/deployers/jbossweb-deployer/web.xml so any deployed app could use it.
We want users to be able to access the site using the base url:
http://ourAwesomeSite/
vs the war name:
http://ourAwesomeSite/ourAwesomeApp.home.seam
To do this I added this to deploy/ROOT.war/index.html:
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=/ourAwesomeApp"/>
But now my logout servlet no longer works correctly.
in the doGet method session is always null, so I can’t invalidate the session. Users logout, and their current session is not invalidated and anyone who logs in after(unless the browser is closed) gets the previous user’s session.
LogoutServlet:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException,
ServletException {
System.out.println("********************** logout servlet");
HttpSession session = request.getSession(false);
// session is always null
if (!this.isSessionInvalid(request) && session != null) {
System.out.println("invalidating user session ... maybe");
session.invalidate();
}
System.out.println("redirecting to SSO logout");
response.sendRedirect("https://ssologoutpage/logout.html");
}
server/default/deployers/jbossweb-deployer/web.xml entry and mapping:
<servlet>
<servlet-name>LogoutServlet</servlet-name>
<servlet-class>com.whatev.log.security.session.management.LogoutServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LogoutServlet</servlet-name>
<url-pattern>/web/logout.html</url-pattern>
<url-pattern>/logout.html</url-pattern>
</servlet-mapping>
I’m not sure how the request session is getting set to null. Anyone have any ideas?
You should be looking at Setting up Virtual Hosts rather than redirecting to another web-application page.Please find the Setup Virtual Hosts