how to ignore default namespace in struts2 -
everyone. i'm having problem on struts2 namespace..
first of all, developing environment. server : tomcat (currently project in root folder in /tomcat/webapps/root) framework : struts2
here problem. lets there 2 pages. admin_index.jsp , front_index.jsp when want call admin_index.jsp action. use
<package name="admin" namespace="/dl_adm" extends="struts-default"> <action name="/index" method="index"class="kr.co.www2.controller.front.adminmaincontroller"> <result name="success">/web-inf/jsp/admin/admin_index.jsp</result> </action> </package> and works fine calling http://.../dl_adm/index.do
and call has problem me.
<package name="front" namespace="/" extends="struts-default"> <action name="/index" method="index"class="kr.co.www2.controller.front.frontmaincontroller"> <result name="success">/web-inf/jsp/admin/front_index.jsp</result> </action> </package> when go http://.../index.do, gives 404...
although aware namespace="/" default namespace...
questions:
is there anyway ignore default namespace? because want use
/because want go throughhttp://.../, action name without namespace...or if there isn't way that. suggestions?
- is there anyway ignore default namespace? because want use / because want go through
http://.../, action name without namespace..
no, can't ignore default namespace. default namespace empty , it's used if omit namespace attribute in package declaration.
- or if there isnt way that. suggestions?
i not use slashes in action name using xml configuration. action mapper might incorrectly add additional slash action name infer mapping url.
so should use
<package name="front" namespace="/" extends="struts-default"> <action name="index" method="index"class="kr.co.www2.controller.front.frontmaincontroller"> <result name="success">/web-inf/jsp/admin/front_index.jsp</result> </action> </package>
Comments
Post a Comment