• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Enabling/Installing Struts Tiles

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

So, I have been researching struts-tiles for an existing java/jsp web application I am currently working on. I have found several sources on how to install/enable struts-tiles and they are all a little different. Here's what I have done so far:

In struts-config.xml I added these line:

<action path="/myTilesAction" foward="my.tiles.action" />

and

<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-def.xml" />
</plug-in>


In web.xml I added these lines:

<init-param>
<param-name>chainConfig</param-name>
<param-value>org/apache/struts/tiles/chain-config.xml</param-value>
</init-param>


and

In tiles-def.xml I have these lines:

<definition name="my.tiles.action" path="/jsp/myTilesPage.jsp">
<put name="Header" value="/jsp/myTileHeader.jsp">
<put name="Footer" value="/jsp/myTile/Footer.jsp">
</definition>


Apparently in the version I downloaded from apache.org the .zip file has a struts-tiles-1.3.10.jar file which I placed in the /WEB-INF/lib folder of our application. Hopefully I am so far so good. What I am having trouble with is how to reference the struts-tiles tab library on my JSP pages. I've seen two ways to do this:

<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> OR <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>

My dilema is I am not sure how the server on which our application runs would react to a uri reference to an outside server and there is no file under /WEB-INF called struts-tiles.tld. In the /WEB-INF folder we do have .tld files for struts - bean,html,logic,nested. Where do I find the file struts-tiles.tld. As mentioned the .zip file only had a struts-tiles-1.3.10.jar file but didn't contain a struts-tiles.tld.

Any help to resolve this would be greatly appreciated.
 
Jared Cheung
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In addition to this, I just attempted to start my application and received an HTTP 404 Servlet action not available ERROR. Once I removed the <plug-in></plug-in> entry from the struts-config.xml the application worked fine. I am pretty new to apache struts only having worked with it here and there for the past month and a half. Very confused at the moment.
 
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jared,
Welcome to Ranch!

When I have done this long back, I got the tld from the jar I downloaded. I still have the download and the location of it as I see is struts-1.3.10-all\struts-1.3.10\lib\struts-tiles-1.3.10.jar\META-INF\tld\struts-tiles.tld. I dropped this in the WEB-INF and had the URI to point the same location and it worked like charm.
Later if you still have troubles with this, post the exception stack trace from your server log (something like 'HTTP 404 Servlet action not available' doesn't lead us in any direction). Also look into this post for the steps I followed.
 
Jared Cheung
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shankar,

thanks for posting a response. The day followig this post I figured out what I did was downloaded the wrong zip file. Instead of the Full Distribution I downloaded just the jar files. Your response is exactly what I did finally and it worked. I forgot to return and post a response since we did an update and all heck broke lose :-D.
 
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic