读书人

Struts2练习题-最基本的示例 转

发布时间: 2012-09-10 11:02:33 作者: rapoo

Struts2练习-最基本的示例 —转

转-(查看更多内容请点击http://javacrazyer.iteye.com/blog/811453)

有关Struts1的知识大部分都已经温习完毕,今天开始转向Struts2的温习工作了

?首先解压struts-2.1.8.1的ZIP包,复制struts-2.1.8.1\apps\struts2-blank-2.1.8.1.war中lib下的jar包到项目中去,那么这几个包就是必须包


Struts2练习题-最基本的示例 —转
?复制struts-2.1.8.1\src\core\src\test\resources\struts.xml到项目的src下,然后进行细致的修改


具体示例【还是经典的登录示例】

login.jsp


?Struts2练习题-最基本的示例 —转Struts2练习题-最基本的示例 —转

    ?success.jsp


    ?Struts2练习题-最基本的示例 —转Struts2练习题-最基本的示例 —转

      LoginAction.java


      ?Struts2练习题-最基本的示例 —转Struts2练习题-最基本的示例 —转
        ?Struts2练习题-最基本的示例 —转Struts2练习题-最基本的示例 —转
          Struts2练习题-最基本的示例 —转

            ?

            struts-deliver.xml

            ?Struts2练习题-最基本的示例 —转Struts2练习题-最基本的示例 —转

              ?struts2-order.xml

              ?Struts2练习题-最基本的示例 —转Struts2练习题-最基本的示例 —转

                ?

                struts2-member.xml

                ?Struts2练习题-最基本的示例 —转Struts2练习题-最基本的示例 —转
                  Struts2练习题-最基本的示例 —转
                    Struts2练习题-最基本的示例 —转
                      >?? ??<struts>?? ??????<constant?name="struts.objectFactory"?value="spring"?/>?? ????<constant?name="struts.objectFactory.spring.autoWire"?value="name"?/>?? ????<constant?name="struts.enable.DynamicMethodInvocation"?value="false"?/>?? ????<constant?name="struts.devMode"?value="true"?/>?? ????<constant?name="struts.configuration.xml.reload"?value="true"?/>?? ????<constant?name="struts.action.extension"?value="action"></constant>?? ????<constant?name="struts.i18n.encoding"?value="UTF-8"></constant>?? ?? ????<constant?name="struts.ognl.allowStaticMethodAccess"?value="true"?/>? ?? ???? ????????????<!--?引入struts2其他类似配置文件?-->?? ????<include?file="META-INF/struts2/struts2-login.xml"?/>?? ????<include?file="META-INF/struts2/struts2-member.xml"?/>?? ????<include?file="META-INF/struts2/struts2-system.xml"?/>???? ?? ????<include?file="META-INF/struts2/struts2-order.xml"?/>?? ????<include?file="META-INF/struts2/struts2-deliver.xml"?/>?? ?????? ?????? ??????<package?name="default"?namespace="/"?extends="struts-default,?json-default">?? ????????<!--?定义拦截器?-->?? ????????<interceptors>?? ????????????<interceptor?name="appInterceptor"?? ????????????????class="com.javacrazyer.action.AppInterceptor"?/>?? ????????????<interceptor-stack?name="appInterceptorStack">?? ????????????????<interceptor-ref?name="appInterceptor"?/>?? ????????????????<interceptor-ref?name="defaultStack"?/>?? ????????????</interceptor-stack>?? ????????</interceptors>?? ????????<default-interceptor-ref?name="appInterceptorStack"/>?? ???????? ??????????<default-action-ref?name="index"?/>?? ??????????<global-results>?? ????????????<result?name="login">/index.jsp</result>?? ????????????<result?name="postRequest">/postRequest.jsp</result>?? ????????????<result?name="errorPage">/errorPage.jsp</result>?? ????????</global-results>?? ??????????<action?name="index">?? ????????????<result?type="redirectAction">?? ????????????????<param?name="actionName">Login_Action</param>?? ????????????????<param?name="namespace">/</param>?? ????????????</result>?? ????????</action>?? ???????? ??????</package>?? ??????<!--?Add?packages?here?-->?? ??</struts>?? </SPAN>??

读书人网 >编程

热点推荐