PortletMVC4Springプロジェクトの構造
PortletMVC4Springポートレットは、WARにパッケージ化されています。 Liferayは、JSP/JSPXおよびThymeleafテンプレートを使用するように構成されたプロジェクトを作成するためのプロジェクトテンプレートを提供しています。 彼らの命令は以下に記載されています。 PortletMVC4Springプロジェクトストラクチャーは、そのコマンドに従います。
Bladeコマンドを使用してポートレットMVC4Springプロジェクトを生成します
以下は、JSPXとThymeleafViewテンプレートを使用するPortletMVC4Springポートレットプロジェクトを生成するためのBladeコマンドです:
SP/JSPXフォームポートレット
blade create [Project Name] -t spring-mvc-portlet --framework portletmvc4spring --view-type jsp
Thymeleafフォームポートレット
blade create [Project Name] -t spring-mvc-portlet --framework portletmvc4spring --view-type thymeleaf
プロジェクトストラクチャー
Bladeコマンドは、モデルクラスとコントローラークラス、ビューテンプレート、リソースバンドル、スタイルシートなどを含むプロジェクトを生成します。 Spring コンテキストと設定ファイル は、PortletMVC4Spring 開発の基本要素を設定します。 結果として生じるプロジェクトストラクチャーは次のとおりです。
[Project Name]/ → Arbitrary project namesrc/main/java/[my-package-path]/controller/→ コントローラークラスのサブパッケージ(オプション)dto/→ モデル(データ転送オブジェクト)クラスのサブパッケージ(オプション)resources/→ Resources to include in the class pathコンテンツ/→ リソースバンドルlog4j.properties→ Log4J ロギング設定
webapp/resources/css/→ スタイルシート画像/→ 画像
WEB-INF/spring-context/→ Contextsportlet/→ Portlet contextsportlet1-context.xml→ ポートレットコンテキスト
portlet-application-context.xml→ アプリケーションコンテキスト
ビュー/→ ビューテンプレートliferay-display.xml→ ポートレット表示設定liferay-plugin-package.properties→ パッケージ記述子liferay-portlet.xml→ Liferay固有のポートレット設定portlet.xml→ ポートレット設定web.xml→ Webアプリケーション構成
test/java/→ テストソースファイル
build.gradle→ Gradleビルドファイル