開発メモ

開発用のメモです。

Struts.xml 見本

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts SYSTEM "struts-2.3.dtd" >
<struts>
    <package abstract="false" extends="struts-default" name="default" namespace="" strict-method-invocation="true">
        <!-- @externalReferenceResolver -->
        <!-- <result-types> <result-type class="" default="false" name="" /> </result-types> -->
        <interceptors>
            <interceptor name="postaccess" class="jp.mirageworld.webapps.interceptor.GetDenyInterceptor" />
            <interceptor name="has-login" class="jp.mirageworld.webapps.interceptor.HasLoginInterceptor" />
            <interceptor name="sessionId" class="jp.mirageworld.webapps.interceptor.SessionIdInterceptor" />

            <interceptor-stack name="defaultStack2">
                <interceptor-ref name="sessionId" />
                <interceptor-ref name="defaultStack" />
            </interceptor-stack>

        </interceptors>

        <default-interceptor-ref name="defaultStack2" />

        <global-results>
            <result name="success" type="dispatcher">${location}</result>
            <result name="input" type="dispatcher">${location}</result>
            <result name="error" type="dispatcher">index.jsp</result>
            <result name="redirect" type="redirect">${location}</result>
        </global-results>

        <global-exception-mappings>
            <exception-mapping exception="java.lang.Exception" name="Exception" result="error" />
            <exception-mapping exception="java.lang.Error" name="Error" result="error" />
        </global-exception-mappings>
    </package>
</struts>
Twitter: @asahina_alice