struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Ying <liying.cn.2...@gmail.com>
Subject Re: how does the namespace work in struts
Date Fri, 05 Nov 2010 09:26:53 GMT
>>  <form action="space/register" method="post"></form>

This HTML code, will post your form to the RELATIVE path [space/register].
So, the ABSOLUTE path which is requested will depend on the current
URL of this page.

If ABSOLUTE path is not right, no doubt struts2 can not map it to a
right namespace/action.



>> I will get a 404 error if I set the action to "/space/register"

This HTML code, will post your form to the ABSOLUTE path [/space/register].
But your web app is running under the [context path].
So the valid URL should be something like [/contextPath/space/register.action]

My suggestion is:
(1)Use the Struts2 tag lib, get it works.
(2)Read the HTML code generated by tag lib, study how it works

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message