2014-03-08から1日間の記事一覧
Localization = 国際化対応の話 text Tag で properteis ファイルにある文字列を出力できるjsp <s:text name="menu" /> package.propreties menu=menu_jp 引数を利用して format することも可能 jsp <s:text name="format.number_money"> <s:param name="value" value="sumValue"/> </s:text> package.properties format.number_money={0,number,#,##0}結果 2,270,00…</s:text>
Interceptor の 実装サンプルとして、Login認証を interceptor として実装 ここでは、convention plugin を導入前提として書いている サンプル処理の流れ 1. ユーザーによる http request 2. struts.xml の設定に従い、request 先の action に Login Interce…
view側でのエラーメッセージの出力の話1. actionクラスの addActionError メソッドでエラーを格納する 2. jsp にて actionerror タグで出力する <s:if test="hasActionErrors()"> <s:actionerror/> </s:if> http://struts.apache.org/release/2.2.x/docs/actionerror.html
2.1系以降?ではこんな感じ。typeを指定しないとdispatcherになる。 @Result(name = "login", location = "login") @Result(name = "stream", location = "InputStream", type = "stream", params = { "contentType", "image/png", "inputName", "inputStrea…