William,

For Section 2, IF you are using the same webapp, you can make a tile show up
in a JSP without using the Actionservlet (you just need to have the Struts
plugIn initialize the tiles from the tiles xml configuration.  Try creating
a JSP with this type of syntax:

<%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
<tiles:insert definition="loginDef"/>

Now, to get the *.html mapping to work, you'd have to reonfigure yout
application server to map *.html pages so they are handled by the JSP
engine.  In tomcat, you can do that like this:

<servlet-mapping>
   <servlet-name>jsp</servlet-name>
   <url-pattern>*.jsp</url-pattern>
</servlet-mapping>

Regards,
David

-----Original Message-----
From: William Ferguson [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 04, 2004 10:36 PM
To: [EMAIL PROTECTED]
Subject: Using Tiles outside of an ActionServlet


I'm trying to create a WebApp with 2 sections.

Section1 consists of Struts Actions managed by an ActionServlet and using
Tiles for consistent layout. The incoming requests will always be '*.do'.

Section2 is a bunch of generated html fragments (each is a page's worth)
that I would like to embed in the Tiles I'm already using in Section1. Ie
Request for html page comes in and it is forwarded to the Tile page which
embeds the originally requested page. The incoming requests will always be
'foo/<htmlpagename>.html'

I thought I had it nailed.

Attempt1: Have the request for Section2 be handled by its own ActionServlet,
with a very simple custom RequestProcessor. But Struts only allows a single
instance of ActionServlet (or subclass) within a WebApp.

Atempt2: Use a single ActionServlet and either use a separate Module for
each section, or use a wildcard ActionMapping to catch all of Section2's
html requests. But Struts only allows a single servlet-mapping element for
the controller-servlet and I would need 2 (*.do and foo/*.html). NB further
Struts restriction is that when using Modules you can only use extension
paths in your servlet-mappings.


Attempt3: ??? I'm looking for ideas.
At the moment the only solution I can see is to implement my own Servlet
(not an ActionServlet subclass) which then uses the Tiles config and
mechanism to render the Section2 response with the required layout.

Is there a better way?

thanks in advance.

William


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to