首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

有个struts2的验证有关问题请问

2011-12-28 
有个struts2的验证问题请教用的是struts的框架验证(暂时只做了requiredstring验证),action配置是这样的:a

有个struts2的验证问题请教
用的是struts的框架验证(暂时只做了requiredstring验证),action配置是这样的:
<action   name= "login "   class= "index.Login ">
<result   name= "input "> /index/login.jsp </result>
<result> /index/ok.jsp </result>
</action>
 
我这样访问这个action
http://localhost:8080/login.action
 
可是我还没填写任何数据就会提示错误信息: "XXX不能为空 "
 
 
现在必须在login后面加个!input   才不会一访问就执行
http://localhost:8080/login!input.action
 
 
有什么办法使我访问http://localhost:8080/login.action时,填写数据点提交按纽后才提示错误信息呢??


[解决办法]
你干吗要一开始就访问http://localhost:8080/login.action
不是开始访问http://localhost:8080/index/login.jsp时,填写数据点提交按纽后才是提交到
http://localhost:8080/login.action 然后再提示错误信息么??

热点排行