• R/O
  • SSH
  • HTTPS

phosphoresce: Commit


Commit MetaInfo

Revision309 (tree)
Time2013-07-08 00:33:55
Authorbbcry

Log Message

(empty log message)

Change Summary

Incremental Difference

--- develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/config/CustomModuleConfig.java (revision 308)
+++ develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/config/CustomModuleConfig.java (revision 309)
@@ -1,5 +1,7 @@
11 package org.phosphoresce.webcore.struts.config;
22
3+import java.io.Serializable;
4+
35 import org.apache.struts.action.ActionMapping;
46 import org.apache.struts.config.ActionConfig;
57 import org.apache.struts.config.impl.ModuleConfigImpl;
@@ -6,6 +8,7 @@
68 import org.phosphoresce.webcore.config.Config;
79 import org.phosphoresce.webcore.logger.CodeConvertLogger;
810 import org.phosphoresce.webcore.struts.StrutsConfigNames;
11+import org.phosphoresce.webcore.struts.action.AbstractForm;
912 import org.phosphoresce.webcore.struts.exception.StrutsProcessInternalException;
1013 import org.phosphoresce.webcore.struts.util.StrutsAnnotationUtil;
1114 import org.phosphoresce.webcore.struts.util.StrutsUtil;
@@ -72,8 +75,15 @@
7275 * アクションコンフィグが存在しない場合はインスタンス生成
7376 */
7477 if (actionConfig == null) {
78+ if (!StrutsUtil.isExistFormClass(actionPath)) {
79+ throw new StrutsProcessInternalException("FSTR08004", new Object[] { StrutsUtil.getFormClassName(actionPath) });
80+ }
81+ if (!StrutsUtil.isExistActionClass(actionPath)) {
82+ throw new StrutsProcessInternalException("FSTR09007", new Object[] { StrutsUtil.getActionClassName(actionPath) });
83+ }
84+ Class<? extends AbstractForm<? extends Serializable>> formClass = StrutsUtil.getFormClass(actionPath);
7585 String name = StrutsUtil.getFormClassSimpleName(actionPath);
76- String scope = StrutsAnnotationUtil.getFormScope(StrutsUtil.getFormClass(actionPath));
86+ String scope = StrutsAnnotationUtil.getFormScope(formClass);
7787 String className = StrutsUtil.getActionClassName(actionPath);
7888 actionConfig = new ActionMapping();
7989 actionConfig.setCancellable(false);
@@ -83,13 +93,12 @@
8393 actionConfig.setScope(scope);
8494 actionConfig.setType(className);
8595 actionConfigs.put(actionPath, actionConfig);
86-
87- log.output("FSTR00006", name, className);
96+ log.output("FSTR00009", actionPath);
8897 }
8998
9099 return actionConfig;
91100 } catch (Throwable e) {
92- throw new StrutsProcessInternalException("FSTR00004", e);
101+ throw new StrutsProcessInternalException("FSTR00008", e);
93102 }
94103 }
95104
--- develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/annotation/StrutsAction.java (revision 308)
+++ develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/annotation/StrutsAction.java (revision 309)
@@ -26,7 +26,4 @@
2626 @Target({ ElementType.TYPE })
2727 @Documented
2828 public @interface StrutsAction {
29-
30- /** アクションフォームクラス */
31- public abstract Class<? extends AbstractForm<? extends Serializable>> formClass();
3229 }
--- develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/action/CustomRequestProcessor.java (revision 308)
+++ develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/action/CustomRequestProcessor.java (revision 309)
@@ -58,7 +58,7 @@
5858 String actionPath = StrutsUtil.getRequestActionPath(request, moduleConfig);
5959
6060 // 指定されたリクエストパスに合致するアクションフォームが存在しない場合はダミーのフォームを返却
61- if (!StrutsUtil.isExistActionForm(actionPath)) {
61+ if (!StrutsUtil.isExistFormClass(actionPath)) {
6262 return new DummyForm();
6363 }
6464
--- develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/util/StrutsUtil.java (revision 308)
+++ develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/util/StrutsUtil.java (revision 309)
@@ -21,7 +21,6 @@
2121 import org.phosphoresce.webcore.struts.action.AbstractForm;
2222 import org.phosphoresce.webcore.struts.action.ServletContainer;
2323 import org.phosphoresce.webcore.struts.action.WindowSessionContainer;
24-import org.phosphoresce.webcore.struts.annotation.StrutsAction;
2524 import org.phosphoresce.webcore.struts.annotation.StrutsMethod;
2625 import org.phosphoresce.webcore.struts.exception.StrutsProcessInternalException;
2726
@@ -273,13 +272,9 @@
273272 * @param actionPath プロセスパス
274273 * @return フォームクラスが存在する場合にtrueを返却
275274 */
276- public static boolean isExistActionForm(String actionPath) {
277- try {
278- Class<? extends AbstractForm<? extends Serializable>> clazz = getFormClass(actionPath);
279- return clazz != null;
280- } catch (ClassNotFoundException e) {
281- return false;
282- }
275+ public static boolean isExistFormClass(String actionPath) {
276+ Class<? extends AbstractForm<? extends Serializable>> clazz = getFormClass(actionPath);
277+ return clazz != null;
283278 }
284279
285280 /**
@@ -340,14 +335,9 @@
340335 throw new StrutsProcessInternalException("FSTR09006", new Object[] { actionPath });
341336 }
342337
343- StrutsAction strutsAction = StrutsAnnotationUtil.getStrutsActionAnnotation(actionClass);
344- if (strutsAction == null) {
345- throw new StrutsProcessInternalException("FSTR09004", new Object[] { actionClass.getName() });
346- }
347-
348- Class<? extends AbstractForm<? extends Serializable>> actionFormClass = (Class<? extends AbstractForm<? extends Serializable>>) strutsAction.formClass();
338+ Class<? extends AbstractForm<? extends Serializable>> formClass = getFormClass(actionPath);
349339 String methodName = getRequestFunctionMethod(actionPath);
350- Method method = ReflectionUtil.getMethod(actionClass, methodName, actionFormClass, WindowSessionContainer.class, ServletContainer.class);
340+ Method method = ReflectionUtil.getMethod(actionClass, methodName, formClass, WindowSessionContainer.class, ServletContainer.class);
351341
352342 StrutsMethod strutsActionMethod = method.getAnnotation(StrutsMethod.class);
353343 if (strutsActionMethod == null) {
@@ -389,16 +379,19 @@
389379 * 指定されたアクションパスのフォームクラスを取得します。<br>
390380 * @param actionPath アクションパス
391381 * @return フォームクラス
392- * @throws ClassNotFoundException フォームクラスが見つからなかった場合にスローされます
393382 */
394383 @SuppressWarnings("unchecked")
395- public static Class<AbstractForm<? extends Serializable>> getFormClass(String actionPath) throws ClassNotFoundException {
396- Class<AbstractForm<? extends Serializable>> clazz = null;
397- String className = getFormClassName(actionPath);
398- if (!StringUtil.isEmpty(className)) {
399- clazz = (Class<AbstractForm<? extends Serializable>>) Class.forName(className);
384+ public static Class<AbstractForm<? extends Serializable>> getFormClass(String actionPath) {
385+ try {
386+ Class<AbstractForm<? extends Serializable>> clazz = null;
387+ String className = getFormClassName(actionPath);
388+ if (!StringUtil.isEmpty(className)) {
389+ clazz = (Class<AbstractForm<? extends Serializable>>) Class.forName(className);
390+ }
391+ return clazz;
392+ } catch (ClassNotFoundException e) {
393+ return null;
400394 }
401- return clazz;
402395 }
403396
404397 /**
--- develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/util/StrutsAnnotationUtil.java (revision 308)
+++ develop/Phosphoresce_Java_Webcore/trunk/webfw_struts/org/phosphoresce/webcore/struts/util/StrutsAnnotationUtil.java (revision 309)
@@ -6,12 +6,9 @@
66 import javax.servlet.http.HttpServletRequest;
77
88 import org.apache.struts.config.ModuleConfig;
9-import org.phosphoresce.commons.util.AnnotationUtil;
109 import org.phosphoresce.webcore.struts.action.AbstractAction;
1110 import org.phosphoresce.webcore.struts.action.AbstractForm;
1211 import org.phosphoresce.webcore.struts.action.AbstractLogic;
13-import org.phosphoresce.webcore.struts.action.ServletContainer;
14-import org.phosphoresce.webcore.struts.action.WindowSessionContainer;
1512 import org.phosphoresce.webcore.struts.annotation.StrutsAction;
1613 import org.phosphoresce.webcore.struts.annotation.StrutsForm;
1714 import org.phosphoresce.webcore.struts.annotation.StrutsLogic;
@@ -90,21 +87,6 @@
9087
9188 /**
9289 * StrutsMethodアノテーションを取得します。<br>
93- * @param method メソッドオブジェクト
94- * @param name メソッド名
95- * @return StrutsFormアノテーション
96- */
97- @SuppressWarnings("unchecked")
98- public static StrutsMethod getStrutsMethodAnnotation(Class<? extends AbstractAction<? extends Serializable, ? extends AbstractForm<? extends Serializable>>> actionClass, String name) {
99- if (actionClass == null) {
100- return null;
101- }
102- StrutsAction strutsAction = getStrutsActionAnnotation((Class<? extends AbstractAction<? extends Serializable, AbstractForm<? extends Serializable>>>) actionClass);
103- return AnnotationUtil.getMethodAnnotation(StrutsMethod.class, actionClass, name, strutsAction.formClass(), WindowSessionContainer.class, ServletContainer.class);
104- }
105-
106- /**
107- * StrutsMethodアノテーションを取得します。<br>
10890 * @param request リクエストオブジェクト
10991 * @param moduleConfig モジュール環境オブジェクト
11092 * @return StrutsMethodアノテーション
@@ -139,7 +121,7 @@
139121 * @param clazz アクションフォームクラス
140122 * @return アクションフォームスコープ
141123 */
142- public static String getFormScope(Class<AbstractForm<? extends Serializable>> clazz) {
124+ public static String getFormScope(Class<? extends AbstractForm<? extends Serializable>> clazz) {
143125 StrutsForm strutsForm = getStrutsFormAnnotation(clazz);
144126 if (strutsForm == null) {
145127 return "request";
--- develop/Phosphoresce_Java_Webcore/trunk/sample_struts/org/phosphoresce/webcore/struts/sample/function/C00001/C00001Action.java (revision 308)
+++ develop/Phosphoresce_Java_Webcore/trunk/sample_struts/org/phosphoresce/webcore/struts/sample/function/C00001/C00001Action.java (revision 309)
@@ -1,8 +1,6 @@
11 package org.phosphoresce.webcore.struts.sample.function.C00001;
22
3-import org.phosphoresce.webcore.config.Config;
43 import org.phosphoresce.webcore.hibernate4.model.SMUser;
5-import org.phosphoresce.webcore.struts.StrutsConfigNames;
64 import org.phosphoresce.webcore.struts.action.Forward;
75 import org.phosphoresce.webcore.struts.action.ServletContainer;
86 import org.phosphoresce.webcore.struts.action.WindowSessionContainer;
@@ -21,7 +19,7 @@
2119 * 2012/07/03 Kitagawa 新規作成
2220 *-->
2321 */
24-@StrutsAction(formClass = C00001Form.class)
22+@StrutsAction
2523 public class C00001Action extends SampleAction {
2624
2725 /**
--- develop/Phosphoresce_Java_Webcore/trunk/sample_struts/org/phosphoresce/webcore/struts/sample/function/FS00001/FS00001Action.java (nonexistent)
+++ develop/Phosphoresce_Java_Webcore/trunk/sample_struts/org/phosphoresce/webcore/struts/sample/function/FS00001/FS00001Action.java (revision 309)
@@ -0,0 +1,37 @@
1+package org.phosphoresce.webcore.struts.sample.function.FS00001;
2+
3+import org.phosphoresce.webcore.hibernate4.model.SMUser;
4+import org.phosphoresce.webcore.struts.action.Forward;
5+import org.phosphoresce.webcore.struts.action.ServletContainer;
6+import org.phosphoresce.webcore.struts.action.WindowSessionContainer;
7+import org.phosphoresce.webcore.struts.annotation.StrutsAction;
8+import org.phosphoresce.webcore.struts.sample.common.action.SampleAction;
9+import org.phosphoresce.webcore.struts.sample.common.action.SampleForm;
10+
11+/**
12+ * サンプル機能アクションクラス(ログイン画面)<br>
13+ *
14+ * @author Kitagawa<br>
15+ *
16+ *<!--
17+ * 更新日 更新者 更新内容
18+ * 2010/07/03 Kitagawa 新規作成
19+ *-->
20+ */
21+@StrutsAction
22+public class FS00001Action extends SampleAction {
23+
24+ /**
25+ * 初期表示処理を行います。<br>
26+ * @param form ActionFormオブジェクト
27+ * @param session セッションコンテナオブジェクト
28+ * @param servlet サーブレットコンテナオブジェクト
29+ * @return 遷移先パス
30+ * @throws Throwable 処理中に補足されない予期せぬエラーが発生した場合にスローされます
31+ * @see org.phosphoresce.webcore.struts.action.AbstractAction#index(org.phosphoresce.webcore.struts.action.AbstractForm, org.phosphoresce.webcore.struts.action.WindowSessionContainer, org.phosphoresce.webcore.struts.action.ServletContainer)
32+ */
33+ @Override
34+ public Forward index(SampleForm form, WindowSessionContainer<SMUser> session, ServletContainer<SMUser> servlet) throws Throwable {
35+ return new Forward();
36+ }
37+}
--- develop/Phosphoresce_Java_Webcore/trunk/sample_struts/org/phosphoresce/webcore/struts/sample/function/FS00001/FS00001Form.java (nonexistent)
+++ develop/Phosphoresce_Java_Webcore/trunk/sample_struts/org/phosphoresce/webcore/struts/sample/function/FS00001/FS00001Form.java (revision 309)
@@ -0,0 +1,39 @@
1+package org.phosphoresce.webcore.struts.sample.function.FS00001;
2+
3+import org.phosphoresce.webcore.hibernate4.model.SMUser;
4+import org.phosphoresce.webcore.struts.action.ServletContainer;
5+import org.phosphoresce.webcore.struts.action.WindowSessionContainer;
6+import org.phosphoresce.webcore.struts.sample.common.action.SampleForm;
7+
8+/**
9+ * サンプル機能フォームクラス(ログイン画面)<br>
10+ *
11+ * @author Kitagawa<br>
12+ *
13+ *<!--
14+ * 更新日 更新者 更新内容
15+ * 2010/07/03 Kitagawa 新規作成
16+ *-->
17+ */
18+public class FS00001Form extends SampleForm {
19+
20+ /**
21+ * フォームオブジェクトをリセットします。<br>
22+ * @param servlet サーブレットコンテナオブジェクト
23+ * @param session ウィンドウセッションオブジェクト
24+ * @see org.phosphoresce.webcore.struts.action.AbstractForm#reset(org.phosphoresce.webcore.struts.action.ServletContainer, org.phosphoresce.webcore.struts.action.WindowSessionContainer)
25+ */
26+ @Override
27+ public void reset(ServletContainer<SMUser> servlet, WindowSessionContainer<SMUser> session) {
28+ }
29+
30+ /**
31+ * フォームオブジェクトを初期化します。<br>
32+ * @param servlet サーブレットコンテナオブジェクト
33+ * @param session ウィンドウセッションオブジェクト
34+ * @see org.phosphoresce.webcore.struts.action.AbstractForm#init(org.phosphoresce.webcore.struts.action.ServletContainer, org.phosphoresce.webcore.struts.action.WindowSessionContainer)
35+ */
36+ @Override
37+ public void init(ServletContainer<SMUser> servlet, WindowSessionContainer<SMUser> session) {
38+ }
39+}
--- develop/Phosphoresce_Java_Webcore/trunk/content/styles/layout.css (revision 308)
+++ develop/Phosphoresce_Java_Webcore/trunk/content/styles/layout.css (revision 309)
@@ -41,6 +41,7 @@
4141 .pageHeaderLower {
4242 height: 30px;
4343 background-color: #000000;
44+ background: #000000 url(../images/bg_content_header.png) 50% 50% repeat-x;
4445 }
4546
4647 /**
Show on old repository browser