You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by es...@globalsign.net on 2002/07/16 15:40:40 UTC

using tiles in struts 1.1b ?

Hi all,

I have downloaded the Struts 1.1b, and I'm going through the tutorial in the
example application 'struts-tiles', which doesn't seem to be updated to the
version 1.1b of Struts.
I've got most things working, but now I'm stuck on 6.6 Definitions as
Forward.

Question:
How do I get my Struts action to forward to a tile definition instead of an
action ?

I get the following message:

'Path forward.example.success.page' does not start with a "/" character'

and if I add the "/", then it will look for that action (in the
strust-config.xml) which then of course doesn't exist ...how do I get it to
look in the tiles-config.xml ?

Thanks in advance,

Esther 

--------
web.xml
--------
...
  <!-- Action Servlet Configuration -->
  <servlet>
    <servlet-name>action</servlet-name>
 
<servlet-class>org.apache.struts.tiles.ActionComponentServlet</servlet-class
> 
	<init-param>
      <param-name>application</param-name>
      <param-value>ApplicationResources</param-value>
    </init-param>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
	<init-param>
      <param-name>definitions-config</param-name>
     <param-value>/WEB-INF/tilesDefinitions.xml</param-value>
    </init-param>
    <init-param>
      <param-name>definitions-debug</param-name>
      <param-value>1</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>
...

--------
struts-config.xml
--------
...

  <!-- ========== Action Mapping Definitions ==============================
-->
  <action-mappings>

    <!-- Struts forward example -->
    <action    path="/forward"
               type="ForwardExampleAction">
      <forward name="success"
path="forward.example.success.page"/>
	</action>

  </action-mappings>
...

--------
tilesDefinitions.xml
--------
...
  <!-- Struts forward definition example -->
  <definition name="forward.example.success.page" extends="mainLayout">
	<put name="title" value="Struts Forward to 'success'" />
	<put name="body" value="/forward/successBody.jsp" />
  </definition>
...

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: using tiles in struts 1.1b ?

Posted by Eddie Bush <ed...@vestus.adabbs.com>.
See the other thread entitled "Struts 1.1 + Tiles" -- if you've just 
subscribed, try searching the archives for it.  Cedric (the Tiles 
maintainer) just posted a nice reply to my question :-)

Regards,

Eddie

esther.miranda@globalsign.net wrote:

>Hi all,
>
>I have downloaded the Struts 1.1b, and I'm going through the tutorial in the
>example application 'struts-tiles', which doesn't seem to be updated to the
>version 1.1b of Struts.
>I've got most things working, but now I'm stuck on 6.6 Definitions as
>Forward.
>
>Question:
>How do I get my Struts action to forward to a tile definition instead of an
>action ?
>
>I get the following message:
>
>'Path forward.example.success.page' does not start with a "/" character'
>
>and if I add the "/", then it will look for that action (in the
>strust-config.xml) which then of course doesn't exist ...how do I get it to
>look in the tiles-config.xml ?
>
>Thanks in advance,
>
>Esther 
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>