aspose file tools*
The moose likes Servlets and the fly likes Problem with FORM authentication method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with FORM authentication method" Watch "Problem with FORM authentication method" New topic
Author

Problem with FORM authentication method

Hui Ge
Greenhorn

Joined: Mar 11, 2005
Posts: 25
I was trying to implement a simple FORM authentication method for my login screen and for invalid login thing were normal (directed to error page stated in web.xml) but for valid login this happend:

HTTP Status 408 - The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser

--------------------------------------------------------------------------------

type Status report

message The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser

description The client did not produce a request within the time that the server was prepared to wait (The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser).

web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://localhost/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>driverClassName</param-name>
<param-value>com.mysql.jdbc.Driver</param-value>
</context-param>
<context-param>
<param-name>dbUsername</param-name>
<param-value>root</param-value>
</context-param>
<context-param>
<param-name>dbPassword</param-name>
<param-value>sql4dm1n2003</param-value>
</context-param>

<listener>
<listener-class>
MyListener
</listener-class>
</listener>


<servlet>
<servlet-name>ErrorServlet</servlet-name>
<servlet-class>chapter04.ErrorServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>chapter04.LoginServlet</servlet-class>
<init-param>
<param-name>dburl</param-name>
<param-value>jdbc:mysql://localhost/test</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ErrorServlet</servlet-name>
<url-pattern>/error</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>/login.html</welcome-file>
</welcome-file-list>

<error-page>
<error-code>403</error-code>
<location>/login.html</location>
</error-page>

<error-page>
<exception-type>java.sql.SQLException</exception-type>
<location>/error</location>
</error-page>

<security-constraint>
<web-resource-collection>
<web-resource-name>login servlet</web-resource-name>
<url-pattern>/login</url-pattern>>
<http-method>POST</http-method>
</web-resource-collection>

<auth-constraint>
<role-name>manager</role-name>
</auth-constraint>

<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>

</security-constraint>

<login-config>
<auth-method>FORM</auth-method>
<!--<realm-name>sales</realm-name>-->

<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/error.html</form-error-page>
</form-login-config>

</login-config>

<security-role>
<role-name>manager</role-name>
</security-role>

</web-app>


Can someone shed some light on this issue. Please.
 
wood burning stoves
 
subject: Problem with FORM authentication method