Wrox Programmer Forums
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 14th, 2007, 04:46 PM
dee dee is offline
Registered User
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default logout jsp

I have controller and a jsp in the controller I provides the name for the jsp (logout.jsp).
Contoller code
String actionType = RequestUtil.getActionType(req);
if(actionType.equalsIgnoreCase("logout")){
System.out.println("Loging off");
String page = "/logout.jsp";
dispatch(req, resp, page);

in my logout.jsp I have

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<TITLE>logout.jsp</TITLE>
</HEAD>
<BODY>
<%
request.getSession().invalidate();
response.sendRedirect(response.encodeRedirectUrl("/login.jsp"));

window.history.forward(1);
%>
</BODY>
</HTML>

but here I can not see my page as redirected to login.jsp. it just stays to logout...
any idea why this is happening...
is it because of the dispatch method.
also how do I redirect user to login.jsp after clicking back button.
your help is always appreciated.

 
Old April 12th, 2007, 11:05 PM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Websphere 5.1 had a bug in response.sendRedirect which might be the problem in your case. Try deploying your web app in any other application server to make sure that you are not getting victim of that bug

Farhan






Similar Threads
Thread Thread Starter Forum Replies Last Post
Please Help. mr_newreq.jsp:78: jsp:useBean can't f batken JSP Basics 0 February 22nd, 2006 09:56 PM
logout TIME and logout DATE crmpicco Classic ASP Databases 2 January 20th, 2005 12:01 AM
logout TIME and logout DATE crmpicco Classic ASP Basics 0 January 19th, 2005 07:57 AM
Logout collie VB.NET 2002/2003 Basics 1 October 28th, 2003 10:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.