Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
-none-

-none-

2007-09-04       - By Luke McMahon

 Back
Hi there, I'm new to the list, just having some trouble getting my
authentication to work with Firefox. I'm trying to protect access to a member
area in my new website, and am just using the built in form based security for
now. I'm using Tomcat 6.0.14, IE7 and Firefox 2.0.0.6.When attempting to access
the member area (/members/) the user is to be redirected to /login.jsp. The
error page is the same but with a parameter (/login.jsp?error=true). When using
IE7, all of this works just fine and after successful login, the user is sent
to /members/When using Firefox, when everything is freshly built it works the
first time. If I then log out (using session.invalidate() and being redirected
to the home page) and log in again it stopsworking. After a successful login
the user is presented not with the /members/ page, but with the login page
again. Hitting refresh actually gives us the page we're after, so it seems to
be caching thelogin page 'as' the /members/ page.  -- ---- ---- ---- ---- -----
-- ---- ------Here is a section from my web.xml:-- ---- ---- ---- ---- ---- ----
-- ---- ---  <security-constraint>   <display-name>Member Access</display-name>
 <web-resource-collection>    <web-resource-name>Member Access Area</web
-resource-name>    <url-pattern>/members/*</url-pattern>    <http-method>DELETE<
/http-method>    <http-method>GET</http-method>    <http-method>POST</http
-method>    <http-method>PUT</http-method>   </web-resource-collection>   <auth
-constraint>    <role-name>administrator</role-name>    <role-name>member</role
-name>    <role-name>student</role-name></auth-constraint>  </security
-constraint>  <login-config>   <auth-method>FORM</auth-method>   <realm-name
>Member Area</realm-name>   <form-login-config>    <form-login-page>/login.jsp<
/form-login-page>    <form-error-page>/login.jsp?error=true</form-error-page>  
</form-login-config>  </login-config>  -- ---- ---- ---- ---- ---- ---- ---- --
-Here is my logout code:-- ---- ---- ---- ---- ---- ---- ---- ---
<% session.invalidate();response.sendRedirect("/"); %>   -- ---- ---- ---- ----
-- ---- ---- -----Here is my login code:-- ---- ---- ---- ---- ---- ---- ---- --
-
<form method="post" action='<%= response.encodeURL("j_security_check") %>' >
<table border="0" cellspacing="5">
<tr>
<th align="right">Username:</th>
<td align="left"><input type="text" name="j_username" /></td>
</tr>
<tr>
<th align="right">Password:</th>
<td align="left"><input type="password" name="j_password" /></td>
</tr>
<tr>
<td align="right"><input type="submit" value="Log In" /></td>
<td align="left"><input type="reset" /></td>
</tr>
</table></form> Note: I've tried putting the following code at the top of my
login.jsp and logout.jsp files but it doesn't seem to help:
<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Cache-Control","no-store");
response.setDateHeader("Expires", -1);
response.setHeader("Pragma","no-cache");
%>
Thanks very much for any assistance,
Luke.        

©2008 junlu.com - Jax Systems, LLC, U.S.A.