Re: Using Tiles outside of an ActionServlet

2004-11-06 Thread William Ferguson
David, thanks for your help.

I figured out a simple solution to the problem which looks like it will
work.

BTW the Tiles Advanced Features PDF is an excellent resource - thanks.
Lots of good patterns and examples.


William


- Original Message - 
From: David G. Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Saturday, November 06, 2004 12:27 AM
Subject: RE: Using Tiles outside of an ActionServlet


 If you are only serving HTML pages and want to wrap them in your standard
 layout, forget tiles and check out SiteMesh:
 www.opensymphony.com/sitemesh

 The Tiles mapping I suggested can do more complex things for you than
 SiteMesh.  It would require setting up a tiles controller.  They are
 explained well, and with examples, in the Tiles Advanced Features PDF.
See
 the Struts' site's UserGuide on Tiles for a link at the bottom of the page
 to that PDF.

 Regards,
 David

 -Original Message-
 From: William Ferguson [mailto:[EMAIL PROTECTED]
 Sent: Friday, November 05, 2004 5:39 AM
 To: Struts Users Mailing List
 Subject: Re: Using Tiles outside of an ActionServlet


 Doh - I guess I wasn't clear enough.

 I want to have the Requests for the html pages (Section2) forwarded to a
 standardLayout page which uses tiles to provide consistent screens. The
 originally targetted html page needs to be included/embedded within the
 standardLayout page.

 David, I guess I could be missing something (wouldn't be the first time),
 but I don't think your solution will give me that will it? Its more about
 allowing the html files to themselves contain a tile.

 If I could somehow get the html requests to be forwarded to a single page,
 then I could do it.
 But I can't see how to do this without using a 2nd ActionServlet which
 brings me back in the original pain.


 William


 - Original Message -
 From: David G. Friedman [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, November 05, 2004 3:35 PM
 Subject: RE: Using Tiles outside of an ActionServlet


  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-namejsp/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]
 


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


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

Re: Using Tiles outside of an ActionServlet

2004-11-05 Thread William Ferguson
Doh - I guess I wasn't clear enough.

I want to have the Requests for the html pages (Section2) forwarded to a
standardLayout page which uses tiles to provide consistent screens. The
originally targetted html page needs to be included/embedded within the
standardLayout page.

David, I guess I could be missing something (wouldn't be the first time),
but I don't think your solution will give me that will it? Its more about
allowing the html files to themselves contain a tile.

If I could somehow get the html requests to be forwarded to a single page,
then I could do it.
But I can't see how to do this without using a 2nd ActionServlet which
brings me back in the original pain.


William


- Original Message - 
From: David G. Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, November 05, 2004 3:35 PM
Subject: RE: Using Tiles outside of an ActionServlet


 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-namejsp/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]



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



RE: Using Tiles outside of an ActionServlet

2004-11-05 Thread David G. Friedman
If you are only serving HTML pages and want to wrap them in your standard
layout, forget tiles and check out SiteMesh:
www.opensymphony.com/sitemesh

The Tiles mapping I suggested can do more complex things for you than
SiteMesh.  It would require setting up a tiles controller.  They are
explained well, and with examples, in the Tiles Advanced Features PDF.  See
the Struts' site's UserGuide on Tiles for a link at the bottom of the page
to that PDF.

Regards,
David

-Original Message-
From: William Ferguson [mailto:[EMAIL PROTECTED]
Sent: Friday, November 05, 2004 5:39 AM
To: Struts Users Mailing List
Subject: Re: Using Tiles outside of an ActionServlet


Doh - I guess I wasn't clear enough.

I want to have the Requests for the html pages (Section2) forwarded to a
standardLayout page which uses tiles to provide consistent screens. The
originally targetted html page needs to be included/embedded within the
standardLayout page.

David, I guess I could be missing something (wouldn't be the first time),
but I don't think your solution will give me that will it? Its more about
allowing the html files to themselves contain a tile.

If I could somehow get the html requests to be forwarded to a single page,
then I could do it.
But I can't see how to do this without using a 2nd ActionServlet which
brings me back in the original pain.


William


- Original Message -
From: David G. Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, November 05, 2004 3:35 PM
Subject: RE: Using Tiles outside of an ActionServlet


 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-namejsp/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]



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


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



Using Tiles outside of an ActionServlet

2004-11-04 Thread William Ferguson
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

RE: Using Tiles outside of an ActionServlet

2004-11-04 Thread David G. Friedman
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-namejsp/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]