インストール

S2のサイトにチュートリアルがあるのでそのままEclipseプロジェクトとして使うべし! ただしTomcatプラグイン前提なので悩みどころだ。

zip解凍後のセットアップ

  1. TOMCAT_HOME変数をjarの所で定義する。
  2. WTPのセットアップ(Serverビューからセットアップ)
  3. プロジェクトをWTPにする(プロジェクトのプロパティから)だけではだめ!

手動セットアップ

http://sastruts.seasar.org/setup.html

命名規約

rootパッケージがcom.rutake.actionだとする。rootパッケージの指定はconvention.diconで行う。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN" 
	"http://www.seasar.org/dtd/components24.dtd">
<components>
	<component class="org.seasar.framework.convention.impl.NamingConventionImpl">
		<initMethod name="addRootPackageName">
			<arg>"com.rutake"</arg>
		</initMethod>
	</component>
	<component class="org.seasar.framework.convention.impl.PersistenceConventionImpl"/>
</components>

con.rutake.action.HelloActionのindex()に対するURLは以下のようになる。

/hello

設定あれこれ

JSPにアクセス出来ない

デフォルトではSAStrutsのFilterによりActionを介さずにJSPを呼ぶことはできない。web.xmlの以下の設定を変更すべし。false→true

   <filter>
       <filter-name>routingfilter</filter-name>
       <filter-class>org.seasar.struts.filter.RoutingFilter</filter-class>
       <init-param>
           <param-name>jspDirectAccess</param-name>
           <param-value>false</param-value>
       </init-param>
   </filter>

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-10-14 (金) 13:16:53