DarkLotus
WelbyLiu
2016-06-11 02:28

请问一个关于strut2 action路径配置问题

5

网站显示路径:http://localhost:9900/group-report!toBase
ACTION类名:GroupReportAction.java
请问strut2路径要在哪里配置,才可以显示成这样

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


<!--配置struts2应用于开发模式-->

<!-- 配置Convention插件自动重加载映射-->

<!-- 不用dojo的及struts2复杂标签样式的就把主题设置为simple,这样可以不加载多余的模板。 -->





<constant name="struts.action.excludePattern" value="/dwr/*,/services/.*,/logonSucc"/>

<!-- resources -->
<constant name="struts.custom.i18n.resources" value="application_message" />
<constant name="struts.ui.theme" value="simple" /> 
<constant name="struts.ui.templateDir" value="template" /> 
<constant name="struts.ui.templateSuffix" value="ftl" />
<constant name="struts.multipart.maxSize" value="10000485760"/>

<package name="exception_package" extends="struts-default">
    <interceptors>
        <interceptor name="myException" class="com.dp.security.interceptor.ExceptionInterceptor"></interceptor>
        <interceptor-stack name="completeStackWithException">
            <interceptor-ref name="myException" />
            <interceptor-ref name="defaultStack" />
        </interceptor-stack>
    </interceptors>
    <default-interceptor-ref name="completeStackWithException"></default-interceptor-ref>
    <global-results>
        <result name="message">/WEB-INF/share/message.jsp</result>
        <result name="result">/WEB-INF/share/result.jsp</result>
        <result name="errDisplay">/WEB-INF/share/errDisplay.jsp</result>
        <result  name="login">/logon.jsp</result>
        <result name="sessionExpired">/WEB-INF/share/sessionExpired.jsp</result>
        <result name="invalid.token">/WEB-INF/share/token.jsp</result>
    </global-results>
    <global-exception-mappings>
        <exception-mapping exception="com.dp.security.exception.BusinessException"
            result="errDisplay"></exception-mapping>
    </global-exception-mappings>
</package>

<package name="security_package" extends="exception_package">
    <interceptors>
        <interceptor name="loginInterceptor"
            class="com.dp.security.interceptor.LoginInterceptor"></interceptor>
        <interceptor-stack name="completeStackWithSecurity">
            <interceptor-ref name="loginInterceptor" />
            <interceptor-ref name="completeStackWithException" />
        </interceptor-stack>

    </interceptors>
    <default-interceptor-ref name="completeStackWithSecurity"></default-interceptor-ref>
</package>

<package name="default" extends="exception_package">
    <!-- 用户登录 -->
    <action name="logon" method="login" class="com.dp.security.action.LoginAction">
        <result name="input">/logon.jsp</result>
        <!--<result name="success">/WEB-INF/layout/main.jsp</result>
        --><!-- <result name="success" type="redirectAction">welcome</result> -->
        <exception-mapping result="input"
            exception="com.dp.security.exception.UserLoginException"></exception-mapping>
    </action>
</package>

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答

为你推荐

换一换