struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <davelnew...@gmail.com>
Subject Re: Struts Tiles Problem
Date Fri, 05 Nov 2010 18:15:36 GMT
Is the Tiles plugin not required for S1.3? It's been several years since
I've used Struts 1 (I hope you're not using it for a new project?)

Dave
On Nov 5, 2010 1:05 PM, "Andy T" <verygoofyone@gmail.com> wrote:
> Hi All,
>
> I'm having a bit of trouble trying to get my tiles to work with Struts
> and wondered if anyone could help.
>
> The relevant files are shown below:
>
> **** Web.xml ****
>
> [code]
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app id="WebApp_ID" version="2.4"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> <display-name>MiniHR</display-name>
> <servlet>
> <servlet-name>action</servlet-name>
> <servlet-class>
> org.apache.struts.action.ActionServlet</servlet-class>
> <init-param>
> <param-name>config</param-name>
> <param-value>/WEB-INF/struts-config.xml</param-value>
> </init-param>
> <init-param>
> <param-name>chainConfig</param-name>
> <param-value>org/apache/struts/tiles/chain-config.xml</param-value>
> </init-param>
> <init-param>
> <param-name>debug</param-name>
> <param-value>2</param-value>
> </init-param>
> <init-param>
> <param-name>detail</param-name>
> <param-value>2</param-value>
> </init-param>
> <init-param>
> <param-name>validate</param-name>
> <param-value>true</param-value>
> </init-param>
> <load-on-startup>2</load-on-startup>
> </servlet>
>
>
> <servlet>
> <servlet-name>tiles</servlet-name>
> <servlet-class>org.apache.tiles.web.startup.TilesServlet</servlet-class>
> <init-param>
> <param-name>
> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
> </param-name>
> <param-value>
> /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
> </param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
>
>
>
> </servlet>
>
>
>
>
>
> <servlet-mapping>
> <servlet-name>action</servlet-name>
> <url-pattern>*.do</url-pattern>
> </servlet-mapping>
> <welcome-file-list>
> <welcome-file>index.html</welcome-file>
> <welcome-file>index.htm</welcome-file>
> <welcome-file>index.jsp</welcome-file>
> <welcome-file>default.html</welcome-file>
> <welcome-file>default.htm</welcome-file>
> <welcome-file>default.jsp</welcome-file>
> </welcome-file-list>
>
> </web-app>
> [/code]
>
>
> **** tiles-defs.xml ****
>
> [code]
> <?xml version="1.0"?>
>
> <!DOCTYPE tiles-definitions PUBLIC
> "-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
> "http://struts.apache.org/dtds/tiles-config_1_3.dtd">
>
> <tiles-definitions>
>
> <definition name="Home" template="/template.jsp">
> <put name="title" value="" />
> <put name="header" value="/header.jsp" />
> <put name="menu" value="/menu.jsp" />
> <put name="leftnav" value="/leftnav.jsp" />
> <put name="body" value="" />
> <put name="footer" value="/footer.jsp" />
> </definition>
>
>
> <definition name="AddEnhancement" extends="Home">
> <put name="title" value="Tiles tutorial homepage" />
> <put name="body" value="/addenhancement.jsp" />
> </definition>
>
>
> </tiles-definitions>
> [/code]
>
>
> **** struts-config.xml ****
>
> [code]
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD
> Struts Configuration 1.3//EN"
> "http://struts.apache.org/dtds/struts-config_1_3.dtd">
> <struts-config>
>
> <form-beans>
>
> (Form Beans Here)
>
> </form-beans>
>
> <global-exceptions>
>
> </global-exceptions>
>
> <global-forwards>
> <forward name="login" path="/login.jsp"/>
> </global-forwards>
>
> <action-mappings>
>
>
> <action path="/initializeaddenhancement"
> parameter="method"
> type="EricEnhancement.struts.EnhancementAction"
> cancellable="true"
> validate="false">
> <forward name="success" path="AddEnhancement"/>
> <forward name="failure" path="/submitpage.jsp"/>
> </action>
>
>
> <action path="/Login"
> input="/login.jsp"
> type="EricEnhancement.struts.LoginAction"
> name = "LoginForm"
> cancellable="true"
> validate="true">
> <forward name="success" path="Home"/>
> <forward name="failure" path="/login.jsp"/>
> </action>
>
>
> </action-mappings>
>
> <controller>
> <set-property property="processorClass"
> value="gov.ohio.odjfs.EricEnhancement.util.CustomRequestProcessor"/>
> </controller>
>
> <message-resources
>
parameter="ericenhancements.resources.MessageResources"></message-resources>
>
> <plug-in className="net.sf.navigator.menu.MenuPlugIn">
> <set-property property="menuConfig" value="/WEB-INF/menu-config.xml"/>
> </plug-in>
>
> <!-- Validator Configuration -->
> <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
> <set-property property="pathnames"
> value="/org/apache/struts/validator/validator-rules.xml,
> /WEB-INF/validation.xml"/>
> </plug-in>
>
>
>
> </struts-config>
> [/code]
>
>
>
> I'm using struts-tiles-1.3.8.jar and when I run the above I get:
> "java.lang.IllegalArgumentException: Path Home does not start with a
> "/" character"
>
> Can anyone help me with this?
>
> Thanks,
>
> Rob
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message