Hi
I dont know if anyone faces this problem using proxies.
My application web-context is set as appName. So all requests have
to go as http://domainname.com/someproxyname/appName/login.do
This brings up the login page. However the form element has entry as follows:
<form action="/Login.do" method="POST">
...
</form>
I hope u see the problem...when i submit the page..the request goes to
http://domainname.com/appName/login.do...which is incorrect and i get a file not found error.
So whats the solution to this? how to make the action go to the right place?
thanks
Sri
-
URGENT:struts and proxy (3 messages)
- Posted by: sriram chandra
- Posted on: July 13 2004 20:28 EDT
Threaded Messages (3)
- URGENT:struts and proxy by Richard Aday on July 13 2004 22:28 EDT
- URGENT:struts and proxy by sriram chandra on July 13 2004 23:33 EDT
- URGENT:struts and proxy by Richard Aday on July 15 2004 08:11 EDT
-
URGENT:struts and proxy[ Go to top ]
- Posted by: Richard Aday
- Posted on: July 13 2004 22:28 EDT
- in response to sriram chandra
I'm sorry to say, but I'm a bit confused about what you're asking...so I'm going to give it my best.
I will assume your Action classes extends Action (and not DispatchAction or any other variants).
The perform method will return an ActionForward. This forward is then looked for inside your action mapping. For example, your action mapping would probably look something like this:
<action
type="app.loginAction"
path="/login"
name="loginForm"
validate="true"
input="/pages/login.jsp/>
<forward
name="welcome"
path="/welcome.jsp"/>
</action>
This means that if loginAction returns an ActionForward called welcome then your page will go to welcome.jsp . Please note that it doesn't just have to be a jsp, you can also send it to another class.
So, in a quick summary: Check your forwards. -
URGENT:struts and proxy[ Go to top ]
- Posted by: sriram chandra
- Posted on: July 13 2004 23:33 EDT
- in response to sriram chandra
I guessed u missed the word "PROXY" in my post. The app works fine without deploying to the production server that uses a proxy.
What this means is as follows:
Normal request to login page without proxy...works fine:
http://servername.com/appName/Login.do
When request is thru proxy, the initial or first request is made as:
http://proxyname.com/proxyname/appName/Login.do
This does give the login page ...but the form tag in the login page is:
<form action="/Welcome.do" method="POST">
....
</form>
Now when this form is submitted..the request goes to http://proxyname.com/appName/Welcome.do instead of http://proxyname.com/proxyname/appName/Welcome.do
Do u see the problem in this now?...so what shud i do either in the form element
or the action mapping that would detect this proxy URL and send the request to
http://proxyname.com/proxyname.appName/Welcome.do??
thanks a lot!
-Sri -
URGENT:struts and proxy[ Go to top ]
- Posted by: Richard Aday
- Posted on: July 15 2004 08:11 EDT
- in response to sriram chandra
In your JSP why don't you try to use the <html:base /> tag? That way the form will look for /Welcome.do in the same folder that is currently in the URI.
html:base documentation: http://struts.apache.org/userGuide/struts-html.html#base
Give it a try, tell me how it goes.
-Richard