<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                [TOC] # 簡介 Struts2是一個基于MVC設計模式的Web應用框架,它本質上相當于一個servlet,在MVC設計模式中,Struts2作為控制器(Controller)來建立模型與視圖的數據交互 Struts2=struts1+webwork 問題:struts2是一個mvc框架,它的mvc是什么? javaweb開發中的mvc,是在jsp的model2模式中提過 Model------javabean View--------jsp Controller----servlet 核心點: 1. 攔截器 interceptor 2. Action 3. ognl與valueStack 在現在開發中與struts2比較類似的框架有哪些? Struts1 webwork springmvc jsf # Struts2框架流程 ![](https://box.kancloud.cn/57b865bf2f1db0cdf420b39a5a7739d6_872x722.png) # 怎樣使用strtuts2框架 首先要上網下載它的jar包。 步驟: 導入相關的jar文件 需要在web.xml文件中配置一個Filter(只有配置了它才可以使用struts2框架) struts.xml配置 創建Action來完成邏輯操作 # 快速入門 我們使用strtus2框架不是直接將它的lib包下的所有的jar文件copy到項目中,而是使用其中的一部分 1. 導入jar包,配置xml ![](https://box.kancloud.cn/8fbf57902f1f729c5a0da275d1be4f7d_513x506.png) 2. 需要在web.xml文件中配置StrutsPrepareAndExecuteFilter ~~~ <!-- struts核心過濾器 --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> ~~~ 順便寫個Action類 ![](https://box.kancloud.cn/d01f33548f712cf4c46599ba641acbd9_381x198.png) 3. 創建一個struts.xml文件,它的位置是可以放置在src下。 ~~~ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <package name="hello" namespace="/hello" extends="struts-default"> <action name="HelloAction" class="domain.HelloAction" method="hello"> <result name="success">/hello.jsp</result> </action> </package> </struts> ~~~ 4. 測試 `http://localhost:8080/w1/hello/HelloAction`
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看