Hi!
take a look your if, and you redirect, you user not null . If you want to go to 
index.jsp, just change in form where is your Back button that does't go to 
welcome page, or make if examination in that page in what option you want t go 
to welcome, in what you want to go to index page, this code is little 
coplicated. But that is my thoughts.
 
Regards,
Biljana

--- On Thu, 6/4/09, muhiuddin <muhiud...@yahoo.com> wrote:


From: muhiuddin <muhiud...@yahoo.com>
Subject: [java ee programming] Clarification of Session, Response in JSP pages
To: "Java EE (J2EE) Programming with Passion!" 
<java-ee-j2ee-programming-with-passion@googlegroups.com>
Date: Thursday, June 4, 2009, 11:39 PM



I want to clear some concept in JSP.

1.   I have made simple applicaiton login/logout. I click logout and
invalidate session in controller.jsp and redirect page to index.html
but when i click back button the previous page(welcom.jsp) still
available. Can any one tell me how to correct that when i click back
button it does not show the welcome.page.

2. What is mean of response.isCommitted() Function what it do and what
is the purpose of this.

3.  what is the funcationality of session.isTrue().

I am thankful if anyone can explain .

Ghulam Muhiuddin
Lahore, Pakistan

I have the following code in welcome.jsp

<%@ page contentType="text/html; charset=windows-1252" session =
"true" errorPage="error.jsp" %>
<%@ page import = "java.sql.*"%>
<%...@page import="java.util.*" %>
<%...@page import="admission.*" %>
<%...@page import="java.lang.*" %>
<%
    response.setHeader("pragma","no-cache");
    response.setHeader("Cache-Control","no-cache");
    response.setHeader("Cache-Control","no-store");
    response.addDateHeader("Expires", 0);
    response.setDateHeader("max-age", 0);
    response.setIntHeader ("Expires", -1); //prevents caching at the
proxy server
    response.addHeader("cache-Control", "private"); //IE5.x only;

%>
         <html>
          <head>
          <meta http-equiv="pragma" content="no-cache">
          <meta http-equiv="expires" content="0">
            <title>untitled</title>
          </head>
  <%
      if((session.getAttribute("userName"))!=null)
      { %>
          <body>

            <P align="center">
              <STRONG><FONT size="6">Welcome
              <%= request.getParameter("name")%></FONT></STRONG>
            </P>
            <P> </P>
            <P>You have successfully Logged In</P>
            <P> </P>
            <P> </P>
            <P>
              <a href="controller.jsp?name=<%= request.getParameter
("name")%>&value=changepassword">Change Password</a><br />
              <a href="controller.jsp?name=<%= request.getParameter
("name")%>&value=logout">Logout</a>
            </P>
            <%
                if(request.getParameter("value").equals
("successchange"))
                {
                    out.println("<font color='GREEN'> Your Password
has been changed successfully</font>");
                }
                if(request.getParameter("value").equals("fail"))
                {
                    out.println("<font color='RED'>The password cannot
be changed at this time</font>");
                }
            %>
          </body>
      <%
      }
      else
       {
       response.sendRedirect("index.jsp");
       }

  %>

</html>



      
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to