第一步:检验名字是否写错是struts不是structs!!
第二步,检查路径
action路径问题:
< package name ="" namespace= "" extends = "struts-default">
< action name ="LoginAction" class ="business.baseinfo.LoginAction" method= "execute">
< result name ="adminsuccess" > admin/Admin_Index.html </result >
< result name ="managesuccess" > exam/Exam_Index.html</ result >
< result name ="error" type ="redirect" > index.html</ result >
</ action>
</ package>
action定义后的真实路径在当前工程下/namespace的值/action的名字
所以要在jsp页面中获取到的话应该选取当前路径
有两种方式一种绝对路径,一种相对路径
绝对路径则是<%=path%>获取当前工程的目录,后添加action的路径即/namespace里的路径/action的名字.action
相对路径则直接填写在当前路径的基础上获取路径
在jsp的action 属性中,如果前面添加/表示服务器地址,不添加则代表当前工程的地址。