• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Display JSP after authentication

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Not so fast naughty spawn! I want you to know about
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic