Struts2.1 处理未知Action 和访问不存在的页面

你可以配置个默认action,当请求的action不存在时,他就会去找默认的action



/default.jsp




Struts.xml配个全局的 如


/exception.jsp




Action Default

Usually, if an action is requested, and the framework can't map the request to an action name, the result will be the usual "404 - Page not found" error. But, if you would prefer that an omnibus action handle any unmatched requests, you can specify a default action. If no other action matches, the default action is used instead.







/UnderConstruction.jsp


你可能感兴趣的:(java,struts2)