struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hue Holleran" <h...@softwareskills.net>
Subject RE: tiles definition doesn't work, config looks correct, am baffled
Date Thu, 31 Oct 2002 18:43:43 GMT
Hi Alayne,

Yes, we're using struts-1.1b2, although using tiles from the latest nightly
build, as the included tiles-documentation.war did not work for us - on
Tomcat3.3aFinal or 4.1.12-3 on W2K or Debian on JDK1.4.1_01.
tiles-documenation.war from nightly build actually works fine on all,
though!

Sorry to bombard you with links but I also found Chuck Cavaness's review
book on theserverside.com useful although it tails off a little at the end
of the tiles chapter .. really looking forward to my copy which is on order,
though!

I'll try copying-and-pasting your code into the working 1.1 we have here to
see if it will possibly work in a different environment and I'll post a
reply a little later on.

Hue.

-----Original Message-----
From: Alayne Wartell [mailto:alayne.wartell@towers.com]
Sent: 31 October 2002 18:29
To: Struts Users Mailing List
Subject: RE: tiles definition doesn't work, config looks correct, am
baffled



Hi Hue,
I am aware of that article but have been following this one:
http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html?
as my model. It's even simpler -- it just displays a templated page. The
mapping only needs an action and a forward (and path, of course.)

I can get the article's example working, and I can even get my tiles
definition working in the example app. But the example app uses Struts 1.0,
with 1.0-style Tiles configuration. My own example, which I haven't fixed
yet, uses 1.1.
Have you been using 1.1?

Thanks for your suggestions.





                                               To:       "'Struts Users
Mailing List'" <struts-user@jakarta.apache.org>
                      "Hue Holleran"           cc:       (bcc: Alayne
Wartell/Towers Perrin)
                      <hueh@softwareski        Subject:  RE: tiles
definition doesn't work, config looks correct, am
                      lls.net>                  baffled

                      10/31/2002 10:35
                      AM
                      Please respond to
                      "Struts Users
                      Mailing List"






Hi Alayne,

>>From one tiles newbie to another...

The general format of the <action...> for tiles is shown below:

  <action-mappings>
    <!-- Action mapping for profile form -->
    <action path="/profileInput"
            type="com.caraveltech.ex2.ProfileAction"
            name="profileForm"
            scope="request"
            input="tile.profileInput"
            validate="true">
      <forward name="success" path="tile.profileOutput"/>
    </action>
  </action-mappings>

Where "input" is the tiles definition to be displayed.

This was from a lovely little training app by Wellie Chao that I found
personally very useful when learning tiles obtained from IBM's site:


http://www-106.ibm.com/developerworks/java/library/j-strutstiles.html

Apologies if you're already aware of this article ... it provides some
really nice, simple worked examples of tiles with struts and comes with
downloadable source and interestingly a nice coverage of "ant" - if you've
not used that before also.

Hue.

-----Original Message-----
From: Alayne Wartell [mailto:alayne.wartell@towers.com]
Sent: 31 October 2002 14:49
To: Struts Users Mailing List
Subject: Re: tiles definition doesn't work, config looks correct, am
baffled



Oops, meant to include the error message (404 error):
The requested resource (/tilesproj/.mydefinition) is not available.
mydefinition is in my tiles-defs.xml, but struts is apparently thinking it
should be a file in my web app directory.
The JSP files I'm specifying do all exist.
I'm currently figuring out how to configure tomcat logging (tomcat newbie
too) but maybe the above info will tell you something?
Thanks.






                                               To:       Struts Users
Mailing List <struts-user@jakarta.apache.org>
                      Cedric Dumoulin          cc:       (bcc: Alayne
Wartell/Towers Perrin)
                      <cedric@apache.or        Subject:  Re: tiles
definition doesn't work, config looks correct, am
                      g>                        baffled

                      10/31/2002 04:01
                      AM
                      Please respond to
                      "Struts Users
                      Mailing List"







  Hi,

  What is the error ? Also check the output in the tomcat error log file.

Alayne Wartell wrote:

>Hi,
>I'm trying to get Tiles running with Struts, and I'm getting 404's when I
>try to use tiles definitions.
>I'm running Struts 1.1b2 and Tomcat.
>I can run a JSP-only Tiles template just fine.
>I really hope someone can help. I've checked everything I can think of and
>have run out of ideas.
>Details follow.....
>Thanks very much,
>Alayne
>(struts newbie)
>
>I'm trying to access http://localhost:8080/tilesproj/testdefinition.do
>which forwards to definition ".mydefinition"
>which is in tiles-defs.xml
>I've configured the Tiles plug-in in struts-config.xml. I originally had
it
>in web.xml but either way I get the same behavior.
>I'm running the regular Struts controller.
>
>Here are my configuration files:
>
>tiles-defs.xml :
><?xml version="1.0" encoding="ISO-8859-1" ?>
><!DOCTYPE tiles-definitions PUBLIC
>       "-//Apache Software Foundation//DTD Tiles Configuration//EN"
>       "http://jakarta.apache.org/struts/dtds/tiles-config.dtd">
>
><tile-definitions>
><!-- page templates -->
>      <definition name=".standardBaseLayout" path
>="/standardBaseLayout.jsp">
>            <put name="header" value="/header.jsp" />
>            <put name="body" value="" />
>            <put name="footer" value="/footer.jsp" />
>      </definition>
>
><!-- put application pages here -->
>      <definition name=".mydefinition" extends=".standardBaseLayout">
>            <put name="body" value="/mypage.jsp" />
>      </definition>
></tile-definitions>
>------------------------------------------------------------
>struts-config.xml :
>
><?xml version="1.0" encoding="ISO-8859-1" ?>
><!DOCTYPE struts-config PUBLIC
>          "-//Apache Software Foundation//DTD Struts Configuration
1.1//EN"
>          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
>
><struts-config>
>
>    <global-forwards>
>       <forward
>            name="index"
>            path="/index.jsp"/>
>    </global-forwards>
>
>    <action-mappings>
>            <action
>                  path="/testuse"
>                  forward="/testuse.jsp" />
>            </action>
>                        <action
>                  path="/testdefinition"
>                  type="org.apache.struts.tiles.actions.NoOpAction">
>                  <forward name="success" path=".mydefinition" />
>                  <forward name="failure" path=".mydefinition" />
>            </action>
>
>    </action-mappings>
>
>      <!-- tiles plug-in -->
>  <plug-in className="org.apache.struts.tiles.TilesPlugin" >
>    <set-property property="definitions-config"
>                       value="/WEB-INF/tiles-defs.xml" />
>    <set-property property="definitions-debug" value="2" />
>    <set-property property="definitions-parser-details" value="2" />
>    <set-property property="definitions-parser-validate" value="true" />
>  </plug-in>
>
>    <message-resources parameter="resources.application"/>
>
></struts-config>
>
>
----------------------------------------------------------------------------

---------------

>web.xml :
><?xml version="1.0" encoding="ISO-8859-1"?>
>
><!DOCTYPE web-app
>  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
>
><web-app>
>  <!-- Standard Action Servlet Configuration (with debugging) -->
>  <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>debug</param-name>
>      <param-value>2</param-value>
>    </init-param>
>    <init-param>
>      <param-name>detail</param-name>
>      <param-value>2</param-value>
>    </init-param>
>    <load-on-startup>2</load-on-startup>
>    <init-param>
>      <param-name>application</param-name>
>      <param-value>ApplicationResources</param-value>
>    </init-param>
>  </servlet>
>
>
>  <!-- Standard Action Servlet Mapping -->
>  <servlet-mapping>
>    <servlet-name>action</servlet-name>
>    <url-pattern>*.do</url-pattern>
>  </servlet-mapping>
>
>  <!-- The Usual Welcome File List -->
>  <welcome-file-list>
>    <welcome-file>index.jsp</welcome-file>
>  </welcome-file-list>
>
>  <!-- Struts Tag Library Descriptors -->
>  <taglib>
>    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
>    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
>  </taglib>
>
>  <taglib>
>    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
>    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
>  </taglib>
>
>  <taglib>
>    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
>    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
>  </taglib>
>
>  <taglib>
>    <taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
>    <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
>  </taglib>
>
>  <taglib>
>    <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
>    <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
>  </taglib>
>
>      <!-- tiles plug-in -->
>
>  <!--plug-in className="org.apache.struts.tiles.TilesPlugin" >>
<set-property property="definitions-config">                       value
="/WEB-INF/tiles-defs.xml" />>    <set-property property
="definitions-debug" value="2" />>    <set-property property
="definitions-parser-details" value="2" />>    <set-property property
="definitions-parser-validate" value="true" />>  </plug-in-->
>
></web-app>
>
>
>
>
>--
>To unsubscribe, e-mail:   <
mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <
mailto:struts-user-help@jakarta.apache.org>
>
>
>
>


--
To unsubscribe, e-mail:   <
mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:struts-user-help@jakarta.apache.org>







--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <
mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:struts-user-help@jakarta.apache.org>







--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message