File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to specify j_uri

 
Jeppe Sommer
Ranch Hand
Posts: 270
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic