扩展RequestProcessor类.
java源文件.
public class MyStore extends org.apache.struts.action.RequestProcessor{
protected boolean processPreprocess(
HttpServletRequest request,
HttpServletResponse response) {
try{
request.getRequestDispatcher("/error.jsp").forward(request,response);
}catch(Exception ex){
ex.printStackTrace();
}
return false;
}
}
------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
</form-beans>
<global-exceptions>
</global-exceptions>
<global-forwards>
<forward name="welcome" path="/Welcome.do"/>
</global-forwards>
<action-mappings>
<action path="/Welcome" forward="/welcomeStruts.jsp"/>
</action-mappings>
<!--controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/-->
<controller processorClass="NetStore.MyStore"/>
<message-resources parameter="com/myapp/struts/ApplicationResource"/>
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>
---------------------------------------------------------------------------
配置文件,我主要是扩展RequestProcessor类,在用户请求时,他直接定向去error.jsp页面.
但是一运行就提示.Servlet action is not available.
如果不扩展它的话,就运行正常.