Salome HOME
Tiles is added for the login screen
authormka <mka@opencascade.com>
Tue, 16 Oct 2012 12:32:45 +0000 (12:32 +0000)
committermka <mka@opencascade.com>
Tue, 16 Oct 2012 12:32:45 +0000 (12:32 +0000)
Workspace/Siman/WebContent/WEB-INF/lib/commons-beanutils-1.8.2.jar [new file with mode: 0644]
Workspace/Siman/WebContent/WEB-INF/lib/commons-beanutils-core-1.8.2.jar [new file with mode: 0644]
Workspace/Siman/WebContent/WEB-INF/lib/commons-digester-1.8.jar [new file with mode: 0644]
Workspace/Siman/WebContent/WEB-INF/tiles/tiles-defs.xml [new file with mode: 0644]
Workspace/Siman/WebContent/WEB-INF/web.xml
Workspace/Siman/WebContent/jsp/presentationpane.jsp [new file with mode: 0644]
Workspace/Siman/WebContent/layout/layoutLogin.jsp [new file with mode: 0644]
Workspace/Siman/WebContent/login.jsp
Workspace/Siman/src/struts.xml

diff --git a/Workspace/Siman/WebContent/WEB-INF/lib/commons-beanutils-1.8.2.jar b/Workspace/Siman/WebContent/WEB-INF/lib/commons-beanutils-1.8.2.jar
new file mode 100644 (file)
index 0000000..6baf5ec
Binary files /dev/null and b/Workspace/Siman/WebContent/WEB-INF/lib/commons-beanutils-1.8.2.jar differ
diff --git a/Workspace/Siman/WebContent/WEB-INF/lib/commons-beanutils-core-1.8.2.jar b/Workspace/Siman/WebContent/WEB-INF/lib/commons-beanutils-core-1.8.2.jar
new file mode 100644 (file)
index 0000000..5ab6645
Binary files /dev/null and b/Workspace/Siman/WebContent/WEB-INF/lib/commons-beanutils-core-1.8.2.jar differ
diff --git a/Workspace/Siman/WebContent/WEB-INF/lib/commons-digester-1.8.jar b/Workspace/Siman/WebContent/WEB-INF/lib/commons-digester-1.8.jar
new file mode 100644 (file)
index 0000000..1110f0a
Binary files /dev/null and b/Workspace/Siman/WebContent/WEB-INF/lib/commons-digester-1.8.jar differ
diff --git a/Workspace/Siman/WebContent/WEB-INF/tiles/tiles-defs.xml b/Workspace/Siman/WebContent/WEB-INF/tiles/tiles-defs.xml
new file mode 100644 (file)
index 0000000..5aefefe
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE tiles-definitions PUBLIC
+       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
+       "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
+
+<tiles-definitions>
+<definition name="baseLayout" template="/WEB-INF/layout/baseLayout.jsp">
+       <put-attribute name="title" value="" type="string"/>
+       <put-attribute name="menu_bar"  value="/jsp/menubar.jsp"/>
+       <put-attribute name="title_bar" value="/jsp/titlebar.jsp"/>
+       <put-attribute name="tool_bar"   value="/jsp/toolbar.jsp"/>
+       <put-attribute name="left_menus"   value="/jsp/menuitem.jsp"/>
+       <put-attribute name="presentation_pane"   value="/jsp/presentationpane.jsp"/>
+</definition>
+
+<definition name="page.login" template="/WEB-INF/layout/layoutLogin.jsp">
+       <put-attribute name="title" value="Login" type="string"/>
+       <put-attribute name="menu_bar"  value="/jsp/menubar.jsp"/>
+       <put-attribute name="presentation_pane"   value="/jsp/login.jsp"/>
+</definition>
+
+</tiles-definitions>
\ No newline at end of file
index 386e72b59a88a26690ad968031c7b854bd1ff0d7..e467fe2f2ea9175610f22d30744b22723fbcf38d 100644 (file)
                        org.springframework.web.context.ContextLoaderListener
                </listener-class>
        </listener>
+       
+       <!-- ======================================================== -->
+       <!--  Struts2 and Tiles interaction                           -->
+       <!-- ======================================================== -->
+       
+       <context-param>
+               <param-name>
+                       org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
+               </param-name>
+               <param-value>
+                       /WEB-INF/tiles/tiles-defs.xml
+               </param-value>
+       </context-param>
+
+       <listener>
+               <listener-class>
+                       org.apache.struts2.tiles.StrutsTilesListener
+               </listener-class>
+       </listener>
 </web-app>
diff --git a/Workspace/Siman/WebContent/jsp/presentationpane.jsp b/Workspace/Siman/WebContent/jsp/presentationpane.jsp
new file mode 100644 (file)
index 0000000..f986ff8
--- /dev/null
@@ -0,0 +1,16 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+    pageEncoding="ISO-8859-1"
+%><%@
+    taglib prefix="s" uri="/struts-tags"
+%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+               <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
+       </head>
+       <body>
+               <p>Simple body text</p>
+       </body>
+</html>
\ No newline at end of file
diff --git a/Workspace/Siman/WebContent/layout/layoutLogin.jsp b/Workspace/Siman/WebContent/layout/layoutLogin.jsp
new file mode 100644 (file)
index 0000000..45b4290
--- /dev/null
@@ -0,0 +1,30 @@
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+       <title>
+               <tiles:insertAttribute name="title" ignore="true" />
+       </title>
+       <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
+</head>
+
+<body> <!--  onLoad="document.login.username.focus();" -->
+
+       <!-- Menu-bar -->
+       
+       <tiles:insertAttribute name="menu_bar" />
+       <div id=top-spacer>
+       </div>
+
+       <!-- Login dialog -->
+       <div id=right-pane>
+               <tiles:insertAttribute name="presentation_pane" ignore="true" />
+       </div>
+
+</body>
+</html>
\ No newline at end of file
index 6eff90df4247eec8b377230041bac9b8ecb051a0..bd5aeab620d8e2054e13ad6d440f2e4a7c89d617 100644 (file)
@@ -1,57 +1,31 @@
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
-    pageEncoding="ISO-8859-1"
-%><%@
-    taglib prefix="s" uri="/struts-tags"
-%>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
-<%  String menu = request.getParameter("backMenu");      // Last active menu
-%>
-<s:set var="menu"><%=menu%></s:set>
-<html>
-
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-    <title>Login</title>
-    <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
-  </head>
-
-  <body onLoad="document.login.username.focus();">
-
-<!-- Menu-bar
-  -->
-    <jsp:include page="/jsp/menubar.jsp">
-        <jsp:param name="login" value="disabled" />
-        <jsp:param name="menu"  value="none" />
-    </jsp:include>
-    <div id=top-spacer></div>
-
-<!-- Login dialog
-  -->
-    <div id=right-pane>
-      <div id=article-box>
-        <div id=section><s:text name="title.login"/></div>
-        <table width=100% border="0" cellpadding="0" cellspacing="0">
-          <tr height=10><td></td></tr>
-          <tr>
-            <td align=center>
-              <s:form action="login" namespace="/">
-                <tr class="error">
-                  <td colspan=2><s:text name="%{errorCode}"/></td>
-                </tr>
-                <s:set var="valid"><s:text name="menu.login"/></s:set>
-                <s:textfield name="username" key="field.username" required="true" />
-                <s:password  name="password" key="field.password" />
-                <s:hidden    name="backMenu" value="%{menu}" />
-                <s:submit type="button" value="%{valid}" />
-              </s:form>
-            </td>
-          </tr>
-          <tr height=10><td></td></tr>
-        </table>
-      </div>
-    </div>
-
-  </body>
-
-</html>
\ No newline at end of file
+<div id=article-box>
+       <div id=section>
+               <s:text name="title.login" />
+       </div>
+       <table width=100% border="0" cellpadding="0" cellspacing="0">
+               <tr height=10>
+                       <td></td>
+               </tr>
+               <tr>
+                       <td align=center><s:form action="login" namespace="/">
+                                       <tr class="error">
+                                               <td colspan=2><s:text name="%{errorCode}" /></td>
+                                       </tr>
+                                       <s:set var="valid">
+                                               <s:text name="menu.login" />
+                                       </s:set>
+                                       <s:textfield name="username" key="field.username" required="true" />
+                                       <s:password name="password" key="field.password" />
+                                       <!--s:hidden name="backMenu" value="%{menu}" /-->
+                                       <s:submit type="button" value="%{valid}" />
+                               </s:form></td>
+               </tr>
+               <tr height=10>
+                       <td></td>
+               </tr>
+       </table>
+</div>
\ No newline at end of file
index 629874f315baf30a33f174004d90e442e9144a57..e4f843454d1fcb1f2066d19eb0667ef08fa8696b 100644 (file)
     </package>
 
     <package name="default" namespace="/" extends="simer-default">
+       
+       <result-types>
+               <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
+       </result-types>
 
         <default-action-ref name="index" />
 
@@ -27,7 +31,8 @@
             <result name="open"      type="redirectAction">select?menu=search</result>
             <result name="study"     type="redirectAction">study/step-study</result>
             <result name="knowledge" type="redirectAction">study/step-knowledge</result>
-            <result name="input">/login.jsp</result>
+            <!--result name="input">/login.jsp</result-->
+            <result name="input"  type="tiles">page.login</result>
             <result name="error">/home.jsp?error=login</result>
         </action>
         <action name="logout" class="connectionAction" method="logout">