File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "How to specify j_uri" Watch "How to specify j_uri" New topic

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">

<realm-name>Default Realm</realm-name>
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
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.
jQuery in Action, 3rd edition
subject: How to specify j_uri
It's not a secret anymore!