-
Why actions in url?
Hi
I have simple login page. After pressing submit button proper page (loginSuccessed.jsp) is displayed, but url is different.
Why do I have url http://localhost:8080/project/doLogin.action? Shouldn't be (and if yes, how can I get this) http://localhost:8080/project/loginSuccessed.jsp?
Regards
-
Re: Why actions in url?
Presumably because your application (correctly) forwards to that JSP, as defined in your struts.xml?
-
Re: Why actions in url?
Hmm it seems I don't understand something. So it's not possible to get in url jsp page? It will always be action?
-
Re: Why actions in url?
That's how Struts works.
You submit to an action, which then forwards to a JSP to display the results (OK, Ajaxxy things work slightly differently).
Since the action and JSP are normally fairly closely associated I don't see why you'd want the JSP page in particular?
-
Re: Why actions in url?
Thank you for explanation. It seems clear now. But is it possible to hide url? So that only http://localhost/myProject/ is displayed all the time? I really don't want to have actions in url...
-
Re: Why actions in url?
One quick way is to use iframe. Set the first page (default.html or whatever) as default in IIS and use the markup in default.html like
<body style="margin:0">
<iframe border="0" height="100%" width="100%" src="home.html" />
</body>
Hope that helps.