SSH 架構開啟項目自動執行action的第一種方法,sshaction

來源:互聯網
上載者:User

SSH 架構開啟項目自動執行action的第一種方法,sshaction

web.xml不配置任何東西

<welcome-file-list>   <welcome-file></welcome-file></welcome-file-list></span>

如上,為什麼不把<welcome-file></welcome-file>也出掉,因為出掉之後會提示標籤不完整.


struts.xml如下

<action name="" class="index">            <result name="input">/login.jsp</result>            <result name="error">/error.jsp</result>            <result name="success">/index.jsp</result></action>
name="",class="index"之所以寫這樣而不寫class="action.index.class",是SSH架構的功能,是action的執行個體在Spring容器中的對象名.</span>
重要的是<result name="success>/index.jsp</result>
部分,index.jsp是web項目首頁.

名字叫index的action的返回字串需是success, 和紅色部分相匹配.像這樣開啟就會自動執行action


如果直接執行index.jsp的話action不會自動執行的!!

第二種方法

大家還有什麼方法嗎?分享分享唄!


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.