wood burning stoves*
The moose likes Security and the fly likes Display JSP after authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Display JSP after authentication" Watch "Display JSP after authentication" New topic
Author

Display JSP after authentication

Atul Mishra
Ranch Hand

Joined: Jun 08, 2006
Posts: 140
Hi,

I configured a LoginModule in Tomcat. And through logon.jsp I can see the loginmodule getting called and Subject ,principal,Roles getting created. After succesful login, what /where config should I do so that the page will be redirected to index.jsp ?

My web.xml entry is like this:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<display-name>User Security</display-name>
<web-resource-collection>
<web-resource-name>All contents</web-resource-name>
<description></description>
<url-pattern>/*</url-pattern>
<http-method>
GET</http-method>
<http-method>
PUT</http-method>
<http-method>
HEAD</http-method>
<http-method>
TRACE</http-method>
<http-method>
POST</http-method>
<http-method>
DELETE</http-method>
<http-method>
OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<description></description>
<role-name>user</role-name>
<role-name>manager</role-name>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>realm</realm-name>
<form-login-config>
<form-login-page>/logon.jsp</form-login-page>
<form-error-page>/logon-error.jsp</form-error-page>
</form-login-config>
</login-config>

etc

Thanks
[ May 08, 2007: Message edited by: Atul Mishra ]
Suman Sharma
Ranch Hand

Joined: May 16, 2005
Posts: 72
You can try using the following code in your LoginModule to display displayresults.jsp.

RequestDispatcher rd = getServletContext().getRequestDispatcher("/displayresults.jsp");
rd.forward(request, response);
Atul Mishra
Ranch Hand

Joined: Jun 08, 2006
Posts: 140
May be I am not asking it in the correcy way-and not getting an answer.
when i go to
http://localhost:8080/xxx/logon.jsp - it works,authenticates user, but stays in logon.jsp and not going to "index.jsp" which is set in the welcome-file-list tag.

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


Why is the browser staying at login.jsp and not going to index.jsp ?
I am using tomcat with eclipse.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display JSP after authentication
 
Similar Threads
HTTP Status 404 After Adding security-constraint To web.xml
simple problem with web.xml
How do I setup form-based authentication?
404 Exception
404 Exception