aspose file tools
The moose likes Security and the fly likes How to specify j_uri Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "How to specify j_uri" Watch "How to specify j_uri" New topic
Author

How to specify j_uri

Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 270
How do I specify the j_uri using FORM-based authentication.

I have created my own servlet which does check if the user is authenticated and forwards to the main page.

500 Servlet Exception
javax.servlet.ServletException: No forwarding URI for form authentication.
Either the login form must specify j_uri or the session must have a saved

Login form (login.jsp):
<form name="form1" action="j_security_check" method="post">
...
</form>

web.xml:
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Default Realm</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
It sounds like either the forum needs to have a hidden "j_uri" field that tells the login form where to go after the login, or there must be a seesion attribute of some kind that does the same. This discussion seems to be relevant.

Be aware that j_uri is a Resin-specifc extension, and not part of the servlet specification (i.e., it won't work on other servlet containers). The Resin documentation should describe how this works in detail.
 
Don't get me started about those stupid light bulbs.
 
subject: How to specify j_uri