我在action类中
try{
...
}catch(Exception ex){
return ERROR;
}
struts.xml
<global-results>
<result name="error">/error.jsp</result>
</global-results>
,但是为什么没有转发到error.jsp页面呢?
try{
...
}catch(Exception ex){
return ERROR;
}
struts.xml
<global-results>
<result name="error">/error.jsp</result>
</global-results>
,但是为什么没有转发到error.jsp页面呢?
看看你的
<global-results>
<result name= "error "> /error.jsp </result>
</global-results>
是不是和你的action放在同一个package(struts.xml的package标签)内,我估计你出现这问题是因为2者是不在一个package内造成的<package name="default" extends="struts-default">
<global-results>
<global-results>
<result name= "error "> /error.jsp </result>
</global-results>
//这里写你的action的映射,这样多个action可以共用一个result了
</package>
<result name="login" type="redirect">index.jsp</result>
</global-results>