Dho*_*ora 1 html java struts struts2
我希望在点击html页面中的html链接时执行Struts2操作.我的第一个问题是,是否可以在html页面(而不是JSP)中执行Struts2操作?如果是,请查看下面的代码:
home.html的
HREF = "home.action"
在struts.xml
action name ="home"class ="com.struts.action.HomeAction"
Run Code Online (Sandbox Code Playgroud)result name="Success">loginJSP.jsp
*****web.xml*****我做了过滤映射,以便所有内容都转到Struts2
你试过这个吗?
<a href="<s:url action="actionName"/>">click here</a>
Run Code Online (Sandbox Code Playgroud)
或这个?
<a href="/abc/actionname.action">Click here</a><br />
Run Code Online (Sandbox Code Playgroud)
另请参阅:http://struts.apache.org/2.x/docs/url.html
只是好奇才知道,为什么你不能使用JSP?