I am using struts 1.1, tiles and wl6.1
My application is at localhost:port/applicname/*
After i do a get request to localhost:port/applicname/Login.do, i do get the login page.
However, when i do a javascript:submit(), it tries to go to
localhost:port/Login.do instead of localhost:port/applicname/Login.do
my form element is as follows:
<form name="loginForm" action="/Login.do">
...
</form>
Any idea why this is happening??
my struts-config entry is as follow:
<action
path="/Login"
type="com.anthem.pwdexpire.actions.LoginAction"
name="LoginForm"
scope="request"
validate="false">
<forward name="nextview"
path=".login.layout"/>
</action>
The application is deployed properly ...in an .ear file.
that is the context of the application is set as "applicname" in the application.xml file.
Do i need some entry in the web.xml or anywhere else that would help the browser request as localhost:port/applicname/* everytime?
By the way how does the browser know that it has to submit to localhost:port/applicname/Login.do if the action is
/Login.do?
thanks a lot!
-ram
-
How does browser know where to post form? (3 messages)
- Posted by: sriram chandra
- Posted on: June 18 2004 00:43 EDT
Threaded Messages (3)
- How does browser know where to post form? by Barre Dijkstra on June 18 2004 03:38 EDT
- How does browser know where to post form? by Rene Zanner on June 18 2004 08:53 EDT
- How does browser know where to post form? by sriram chandra on June 20 2004 01:45 EDT
-
How does browser know where to post form?[ Go to top ]
- Posted by: Barre Dijkstra
- Posted on: June 18 2004 03:38 EDT
- in response to sriram chandra
The request is going to the right URI (/Login.do).
You could either remove the / to indicate that it should go to the current path or you should use URL-rewriting.
Barre Dijkstra -
How does browser know where to post form?[ Go to top ]
- Posted by: Rene Zanner
- Posted on: June 18 2004 08:53 EDT
- in response to sriram chandra
Hello,
you should use the Struts html taglib for generating the html form. It will construct the correct url by prepending the application's name to the action path.
Example:
<html:form action="/Login.do">
...
</html:form>
Cheers,
René -
How does browser know where to post form?[ Go to top ]
- Posted by: sriram chandra
- Posted on: June 20 2004 01:45 EDT
- in response to Rene Zanner
thanks a lot guys...both of ur solns worked!!!
-sri