Was this page helpful?

Struts2

    放一些與 Struts2 相關的東西

    從 Struts 2.1.3 某些 filter class 改變了

    原 org.apache.struts2.dispatcher.FilterDispatcher 
    改 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    原 org.apache.struts2.dispatcher.ActionContextCleanUp
    改 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter

    所以 web.xml 要改為這樣才對 

    <filter>
        <filter-name>struts-cleanup</filter-name>
        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
    </filter>
    
    <filter>
         <filter-name>struts2</filter-name>
         <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>

     

    顯示帶有 HTML 標籤的內容

    通常採用 TinyMCE 或是 CKEditor 都會將 HTML 標籤寫入資料庫,讀出時會進行跳出字元的動作,也就是在頁面上顯示赤裸裸的 HTML 標籤,同時內文也會喪失格式,解法很簡單在 <s:property> 加上 escape="false" 就可以了。

    <s:property value="yourContent" escape="false"/>

     

    設定簡單樣板

    http://xianglg.javaeye.com/blog/88171

    在action取得ip

    http://zhidao.baidu.com/question/61485178.html

     

    結合 sitemesh

    http://blog.csdn.net/naubie/archive/2007/11/16/1888476.aspx

    另外ActionContextCleanUp已經被StrutsPrepareFilter 取代

    http://struts.apache.org/2.x/docs/sitemesh-plugin.html

     

    checkboxlist相關

    http://topic.csdn.net/u/20090327/16/41151038-34e1-41e1-8940-5733d2f4f420.html

    http://blog.sina.com.cn/s/blog_3fce9e8f0100dbw4.html

     

    Configuration Browser Plug-in

    顯示Struts 2設定

    http://struts.apache.org/2.x/docs/config-browser-plugin.html

     

    Convention Plug-in

    用annotations取代XML 

     

    Was this page helpful?
    標籤 (Edit tags)
    • No tags
    blog comments powered by Disqus
    Powered by MindTouch Core