- Migrate to Tile2.0 removing the dependecy with Struts.

This commit is contained in:
Paulo Gustavo Veiga 2012-06-16 14:32:26 -03:00
parent 65db1acf6a
commit 8a638e8de6
8 changed files with 237 additions and 253 deletions

View File

@ -101,12 +101,6 @@
<version>${org.springframework.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-struts</artifactId>
<version>${org.springframework.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
@ -141,16 +135,10 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-tiles</artifactId>
<version>1.3.8</version>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.1.4</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>

View File

@ -1,174 +1,171 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
"-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
"http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
<tiles-definitions>
<definition name="homepage" page="/jsp/homepage.jsp"/>
<definition name="mindmapList" page="/jsp/mindmapList.jsp"/>
<definition name="mindmapEmbedded" page="/jsp/mindmapEmbed.jsp"/>
<definition name="mindmapEditor" page="/jsp/mindmapEditor.jsp"/>
<definition name="mindmapPrint" page="/jsp/mindmapPrint.jsp"/>
<definition name="homepage" template="/jsp/homepage.jsp"/>
<definition name="mindmapList" template="/jsp/mindmapList.jsp"/>
<definition name="mindmapEmbedded" template="/jsp/mindmapEmbed.jsp"/>
<definition name="mindmapEditor" template="/jsp/mindmapEditor.jsp"/>
<definition name="mindmapPrint" template="/jsp/mindmapPrint.jsp"/>
<!-- Template Declaration -->
<definition name="pageTemplate" page="/jsp/template.jsp">
<put name="title" value="" type="string"/>
<put name="details" value="" type="string"/>
<put name="body" value="/jsp/error.jsp" type="page"/>
<definition name="pageTemplate" template="/jsp/template.jsp">
<put-attribute name="title" value="" type="string"/>
<put-attribute name="details" value="" type="string"/>
<put-attribute name="body" value="/jsp/error.jsp" type="page"/>
</definition>
<definition name="dialogTemplate" page="/jsp/dialogTemplate.jsp">
<put name="title" value="title" type="string"/>
<put name="details" value="details" type="string"/>
<put name="body" value="/jsp/error.jsp" type="page"/>
<definition name="dialogTemplate" template="/jsp/dialogTemplate.jsp">
<put-attribute name="title" value="title" type="string"/>
<put-attribute name="details" value="details" type="string"/>
<put-attribute name="body" value="/jsp/error.jsp" type="page"/>
</definition>
<definition name="dialogFullTemplate" page="/jsp/dialogFullTemplate.jsp">
<put name="title" value="title" type="string"/>
<put name="details" value="details" type="string"/>
<put name="body" value="/jsp/error.jsp" type="page"/>
<definition name="dialogFullTemplate" template="/jsp/dialogFullTemplate.jsp">
<put-attribute name="title" value="title" type="string"/>
<put-attribute name="details" value="details" type="string"/>
<put-attribute name="body" value="/jsp/error.jsp" type="page"/>
</definition>
<definition name="errorTemplate" extends="pageTemplate">
<put name="body" value="/jsp/errorTemplate.jsp" type="page"/>
<put-attribute name="body" value="/jsp/errorTemplate.jsp" type="page"/>
</definition>
<definition name="iframeWrapper" page="/jsp/iframeWrapper.jsp"/>
<definition name="iframeWrapper" template="/jsp/iframeWrapper.jsp"/>
<!-- Error Pages -->
<definition name="gcfPluginNeeded" extends="pageTemplate">
<put name="body" value="/jsp/gcfPluginNeeded.jsp" type="page"/>
<put name="title" value="INSTALL_CFG"/>
<put-attribute name="body" value="/jsp/gcfPluginNeeded.jsp" type="page"/>
<put-attribute name="title" value="INSTALL_CFG"/>
</definition>
<definition name="installCFG" extends="pageTemplate">
<put name="body" value="/jsp/installCFG.jsp" type="page"/>
<put name="title" value="INSTALL_CFG"/>
<put-attribute name="body" value="/jsp/installCFG.jsp" type="page"/>
<put-attribute name="title" value="INSTALL_CFG"/>
</definition>
<definition name="unexpectedError" extends="errorTemplate">
<put name="title" value="UNEXPECTED_ERROR"/>
<put name="details" value="UNEXPECTED_ERROR_DETAILS"/>
<put-attribute name="title" value="UNEXPECTED_ERROR"/>
<put-attribute name="details" value="UNEXPECTED_ERROR_DETAILS"/>
</definition>
<definition name="securityError" extends="errorTemplate">
<put name="title" value="NO_ENOUGH_PERMISSIONS"/>
<put name="details" value="NO_ENOUGH_PERMISSIONS_DETAILS"/>
<put-attribute name="title" value="NO_ENOUGH_PERMISSIONS"/>
<put-attribute name="details" value="NO_ENOUGH_PERMISSIONS_DETAILS"/>
</definition>
<definition name="emailNotExistsError" extends="errorTemplate">
<put name="title" value="INVALID_EMAIL_ERROR"/>
<put name="body" value="/jsp/emailNotExistsError.jsp"/>
<put-attribute name="title" value="INVALID_EMAIL_ERROR"/>
<put-attribute name="body" value="/jsp/emailNotExistsError.jsp"/>
</definition>
<!-- Main Pages -->
<definition name="forgotPassword" extends="pageTemplate">
<put name="title" value="FORGOT_PASSWORD"/>
<put name="body" value="/jsp/forgotPassword.jsp"/>
<put-attribute name="title" value="FORGOT_PASSWORD"/>
<put-attribute name="body" value="/jsp/forgotPassword.jsp"/>
</definition>
<definition name="userRegistration" extends="pageTemplate">
<put name="title" value="USER_REGISTRATION"/>
<put name="body" value="/jsp/userRegistration.jsp"/>
<put-attribute name="title" value="USER_REGISTRATION"/>
<put-attribute name="body" value="/jsp/userRegistration.jsp"/>
</definition>
<definition name="userRegistrationConfirmation" extends="pageTemplate">
<put name="title" value="USER_REGISTRATION"/>
<put name="body" value="/jsp/userRegistrationConfirmation.jsp"/>
<put-attribute name="title" value="USER_REGISTRATION"/>
<put-attribute name="body" value="/jsp/userRegistrationConfirmation.jsp"/>
</definition>
<definition name="login" extends="pageTemplate">
<put name="title" value="LOGIN"/>
<put name="body" value="/jsp/login.jsp"/>
<put-attribute name="title" value="LOGIN"/>
<put-attribute name="body" value="/jsp/login.jsp"/>
</definition>
<!-- Dialog Forms -->
<definition name="mindmapDetail" extends="dialogTemplate">
<put name="title" value="MINDMAP_DETAIL"/>
<put name="body" value="/jsp/mindmapDetail.jsp"/>
<put-attribute name="title" value="MINDMAP_DETAIL"/>
<put-attribute name="body" value="/jsp/mindmapDetail.jsp"/>
</definition>
<definition name="setting" extends="dialogTemplate">
<put name="title" value="SETTINGS"/>
<put name="details" value="SETTINGS_MSG"/>
<put name="body" value="/jsp/setting.jsp"/>
<put-attribute name="title" value="SETTINGS"/>
<put-attribute name="details" value="SETTINGS_MSG"/>
<put-attribute name="body" value="/jsp/setting.jsp"/>
</definition>
<definition name="editProfile" extends="dialogTemplate">
<put name="title" value="EDIT_PROFILE"/>
<put name="details" value="FIELD_REQUIRED_MSG"/>
<put name="body" value="/jsp/editProfile.jsp"/>
<put-attribute name="title" value="EDIT_PROFILE"/>
<put-attribute name="details" value="FIELD_REQUIRED_MSG"/>
<put-attribute name="body" value="/jsp/editProfile.jsp"/>
</definition>
<definition name="changePassword" extends="dialogTemplate">
<put name="title" value="CHANGE_PASSWORD"/>
<put name="details" value="FIELD_REQUIRED_MSG"/>
<put name="body" value="/jsp/changePassword.jsp"/>
<put-attribute name="title" value="CHANGE_PASSWORD"/>
<put-attribute name="details" value="FIELD_REQUIRED_MSG"/>
<put-attribute name="body" value="/jsp/changePassword.jsp"/>
</definition>
<definition name="mindmapExport" extends="dialogTemplate">
<put name="title" value=""/>
<put name="details" value=""/>
<put name="body" value="/jsp/mindmapExport.jsp"/>
<put-attribute name="title" value=""/>
<put-attribute name="details" value=""/>
<put-attribute name="body" value="/jsp/mindmapExport.jsp"/>
</definition>
<definition name="mindmapExportFull" extends="dialogFullTemplate">
<put name="title" value=""/>
<put name="details" value=""/>
<put name="body" value="/jsp/mindmapExport.jsp"/>
<put-attribute name="title" value=""/>
<put-attribute name="details" value=""/>
<put-attribute name="body" value="/jsp/mindmapExport.jsp"/>
</definition>
<definition name="mindmapPublish" extends="dialogTemplate">
<put name="title" value=""/>
<put name="details" value=""/>
<put name="body" value="/jsp/mindmapPublish.jsp"/>
<put-attribute name="title" value=""/>
<put-attribute name="details" value=""/>
<put-attribute name="body" value="/jsp/mindmapPublish.jsp"/>
</definition>
<definition name="mindmapPublishFull" extends="dialogFullTemplate">
<put name="title" value=""/>
<put name="details" value=""/>
<put name="body" value="/jsp/mindmapPublish.jsp"/>
<put-attribute name="title" value=""/>
<put-attribute name="details" value=""/>
<put-attribute name="body" value="/jsp/mindmapPublish.jsp"/>
</definition>
<definition name="mindmapShare" extends="dialogTemplate">
<put name="title" value=""/>
<put name="details" value=""/>
<put name="body" value="/jsp/mindmapShare.jsp"/>
<put-attribute name="title" value=""/>
<put-attribute name="details" value=""/>
<put-attribute name="body" value="/jsp/mindmapShare.jsp"/>
</definition>
<definition name="mindmapShareFull" extends="dialogFullTemplate">
<put name="title" value=""/>
<put name="details" value=""/>
<put name="body" value="/jsp/mindmapShare.jsp"/>
<put-attribute name="title" value=""/>
<put-attribute name="details" value=""/>
<put-attribute name="body" value="/jsp/mindmapShare.jsp"/>
</definition>
<definition name="keyboard" extends="dialogTemplate">
<put name="title" value="KEYBOARD"/>
<put name="details" value="KEYBOARD_MSG"/>
<put name="body" value="/jsp/keyboard.jsp"/>
<put-attribute name="title" value="KEYBOARD"/>
<put-attribute name="details" value="KEYBOARD_MSG"/>
<put-attribute name="body" value="/jsp/keyboard.jsp"/>
</definition>
<definition name="mindmapImport" extends="dialogTemplate">
<put name="body" value="/jsp/mindmapImport.jsp"/>
<put-attribute name="body" value="/jsp/mindmapImport.jsp"/>
</definition>
<definition name="activationAccountConfirmation" extends="pageTemplate">
<put name="title" value="ACCOUNT_ACTIVED"/>
<put name="body" value="/jsp/activationAccountConfirmation.jsp"/>
<put-attribute name="title" value="ACCOUNT_ACTIVED"/>
<put-attribute name="body" value="/jsp/activationAccountConfirmation.jsp"/>
</definition>
<definition name="activationAccountConfirmationFail" extends="pageTemplate">
<put name="title" value="ACCOUNT_ACTIVED_FAIL"/>
<put name="body" value="/jsp/activationAccountConfirmationFail.jsp"/>
<put-attribute name="title" value="ACCOUNT_ACTIVED_FAIL"/>
<put-attribute name="body" value="/jsp/activationAccountConfirmationFail.jsp"/>
</definition>
<definition name="mindmapHistory" extends="dialogTemplate">
<put name="title" value="HISTORY"/>
<put name="details" value="HISTORY_INFO"/>
<put name="body" value="/jsp/mindmapHistory.jsp"/>
<put-attribute name="title" value="HISTORY"/>
<put-attribute name="details" value="HISTORY_INFO"/>
<put-attribute name="body" value="/jsp/mindmapHistory.jsp"/>
</definition>
</tiles-definitions>

View File

@ -33,11 +33,11 @@
</property>
</bean>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.tiles.TilesJstlView"/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
</bean>
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/defs/definitions.xml</value>
@ -76,7 +76,7 @@
<value>/c/keyboard</value>
<value>/c/renameMap</value>
<value>/c/embeddedView</value>
<value>/c/forgotPassword</value>
<value>/c/user/resetPassword</value>
</list>
</property>
</bean>

View File

@ -1,4 +1,4 @@
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ include file="/jsp/init.jsp" %>
<tiles:importAttribute name="title" scope="page"/>
@ -15,7 +15,7 @@
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-responsive.min.css"/>
<body>
<div style="padding-top:20px">
<tiles:insert name="body"/>
<tiles:insertAttribute name="body"/>
</div>
</body>
</html>

View File

@ -1,4 +1,4 @@
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ include file="/jsp/init.jsp" %>
@ -6,6 +6,5 @@
<tiles:importAttribute name="details" scope="page"/>
<div>
<!-- Header can be customized -->
<tiles:insert name="body"/>
<tiles:insertAttribute name="body"/>
</div>

View File

@ -1,4 +1,4 @@
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
<!DOCTYPE HTML>
<%@ include file="/jsp/init.jsp" %>
<div>

View File

@ -55,7 +55,7 @@
</div>
</fieldset>
</form>
<a href="<c:url value="/c/forgotPassword"/>"><spring:message code="FORGOT_PASSWORD"/></a>
<a href="<c:url value="/c/user/resetPassword"/>"><spring:message code="FORGOT_PASSWORD"/></a>
</div>
</div>

View File

@ -1,6 +1,6 @@
<!DOCTYPE HTML>
<%@page pageEncoding="UTF-8" %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ include file="/jsp/init.jsp" %>
<tiles:importAttribute name="title" scope="request"/>
@ -37,7 +37,7 @@
<div class="pageBody">
<div class="pageBodyContent">
<tiles:insert name="body"/>
<tiles:insertAttribute name="body"/>
</div>
</div>