Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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 Murach's Java Servlets and JSP this week in the Servlets 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: 41046
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.

Ping & DNS - my free Android networking tools app
I agree. Here's the link:
subject: How to specify j_uri
Similar Threads
j_security_check 404 error
DD entries for authentication
mock test question
security-constraint question
login-config question