(舊筆記搬家)struts.xml中單獨頁面跳轉的配置

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
    "http://struts.apache.org/dtds/struts-2.5.dtd">

<struts>
    <constant name="struts.devMode" value="true"></constant>
    <constant name="struts.ui.theme" value="simple"></constant>
    
   <package name="erp" extends="struts-default" >
           <!-- <action name="main">
               <result>/WEB-INF/jsps/main.jsp</result>
           </action>
           
           <action name="context">
               <result>/WEB-INF/jsps/context.jsp</result>
           </action> -->
           <!-- 作單獨的頁面跳轉,不須要class。在本例中主要是用於main頁面和context頁面的跳轉。 上面兩個是單獨配置-->
           <action name="erp_*">
               <result>/WEB-INF/jsps/{1}.jsp</result>
           </action>
   
        <action name="emp_*" class="empAction" method="emp_{1}">
            <result name="success">/WEB-INF/jsps/emp/{1}.jsp</result>
        </action>
         
          
  </package>
  
   
  
</struts>
相關文章
相關標籤/搜索