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

View File

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

View File

@ -33,11 +33,11 @@
</property> </property>
</bean> </bean>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.tiles.TilesJstlView"/> <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
</bean> </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"> <property name="definitions">
<list> <list>
<value>/WEB-INF/defs/definitions.xml</value> <value>/WEB-INF/defs/definitions.xml</value>
@ -76,7 +76,7 @@
<value>/c/keyboard</value> <value>/c/keyboard</value>
<value>/c/renameMap</value> <value>/c/renameMap</value>
<value>/c/embeddedView</value> <value>/c/embeddedView</value>
<value>/c/forgotPassword</value> <value>/c/user/resetPassword</value>
</list> </list>
</property> </property>
</bean> </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" %> <%@ include file="/jsp/init.jsp" %>
<tiles:importAttribute name="title" scope="page"/> <tiles:importAttribute name="title" scope="page"/>
@ -15,7 +15,7 @@
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-responsive.min.css"/> <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap-responsive.min.css"/>
<body> <body>
<div style="padding-top:20px"> <div style="padding-top:20px">
<tiles:insert name="body"/> <tiles:insertAttribute name="body"/>
</div> </div>
</body> </body>
</html> </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" %> <%@ include file="/jsp/init.jsp" %>
@ -6,6 +6,5 @@
<tiles:importAttribute name="details" scope="page"/> <tiles:importAttribute name="details" scope="page"/>
<div> <div>
<!-- Header can be customized --> <tiles:insertAttribute name="body"/>
<tiles:insert name="body"/>
</div> </div>

View File

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

View File

@ -55,7 +55,7 @@
</div> </div>
</fieldset> </fieldset>
</form> </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>
</div> </div>

View File

@ -1,6 +1,6 @@
<!DOCTYPE HTML> <!DOCTYPE HTML>
<%@page pageEncoding="UTF-8" %> <%@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" %> <%@ include file="/jsp/init.jsp" %>
<tiles:importAttribute name="title" scope="request"/> <tiles:importAttribute name="title" scope="request"/>
@ -37,7 +37,7 @@
<div class="pageBody"> <div class="pageBody">
<div class="pageBodyContent"> <div class="pageBodyContent">
<tiles:insert name="body"/> <tiles:insertAttribute name="body"/>
</div> </div>
</div> </div>