struts2框架s:action标签无效原因

1.没在jsp页面中导入标签库

解决方法:在页面中加入<%@ taglib uri="/struts-tags"  prefix="s"  %>

2.action路径拼写有误

解决方法:检查页面中的action路径和struts.xml中action的name是否一致

3.s:action标签中的namespace和struts.xml中对应的action的namespace不一致

解决方法:确保页面的s:action标签中的namespace属性值与struts.xml中action的namespace值一致

4.环境的问题

解决方法:尝试清除缓存并重新部署

猜你喜欢

转载自www.cnblogs.com/LambertCOL/p/9661373.html
今日推荐