I'll try to answer some of the questions.

> Hello,
> 
> I would like to know how you guys handle the case of
> a site with lots of dynamic (WM) pages and lots of
> (externally developed) static HTML pages (with crap
> such as animated GIFs, flash, etc.). My questions are:
> 
> * Do you use the servlet container (Tomcat) to handle
>   hits to both kinds of pages (i.e. in its standalone
>   mode), or do you mix it with a "real" web server
>   (Apache or (gasp!) IIS)? My guess is you use a real
>   web server AND Tomcat, right?

If performance is an issue, use a real web server. See
the Tomcat documentation on how to configure it to serve
static content directly. (Nissim also replied with 
the link in the mean time).

> 
> * Say you use Apache and Tomcat, and the app is a
>   Tomcat context living under webapps/myApp. I would
>   like to have the following layout:
> 
>     $APACHE/htdocs/myApp/
>     +- html: all static HTML pages for the app
>     +- images: all the images for the static pages
> 
>     $TOMCAT/webapps/myApp/
>     +- templates: all the WM templates for the app
>     +- images: all the images for the templates
>     +- css: all CSS style sheets for the app
>     +- js: all Javascript scripts for the app

This will not work, since the images directory is not unique.
Try it yourself: http://localhost:8080/myApp will already
show its directory content (if no index.html is there,
otherwise try http://localhost:8080/myApp/images).

You can aliases in the $APACHE/conf/http.conf and web.xml to
remap some names, e.g.:
    <servlet-mapping>
        <servlet-name>turbine</servlet-name>
        <url-pattern>/turbine/*</url-pattern>
    </servlet-mapping>
will make your turbine application visible at 
  http://localhost:8080/myApp/turbine
instead of http://localhost:8080/myApp/servlet/myApp

Note that you can point the apache server to serve the
contents of $TOMCAT/webapps/myApp/images, html, css, js, etc.
directly by using aliases. Then the webbapp is really
self contained and equal to the Tomcat standalone URLs!
e.g.:
Alias /myApp/images TOMCAT_PATH/webapps/myApp/images
<Directory "TOMCAT_PATH/webapps/myApp/images">
  Options Indexes FollowSymLinks
</Directory>

> 
>   You will notice I have images in both sides. This is
>   because I don't see how I could make Apache serve an
>   image that is being requested from a template, since
>   at this point Tomcat is already handling the request.
>   Is this correct?

No. Tomcat is serving only the page that is refering the
image at this point, the browser retrieves the image in 
another access, thus can get it from the real web server.

> 
>   Does this layout make sense to you? What would you
>   do differently? Is this layout at all close to what
>   you (would) use in a production site?
> 
>   Will the webserver differentiate between /myApp
>   as a reference to the static directory and /myApp
>   as a reference to the servlet root?

No, unless you set aliases with jokers. See the Tomcat
and Apache documentation. No need to use $APACHE/htdocs/myApp/
since static content can be served directly out of
$TOMCAT/webapps/myApp/ (see above).

> 
>   How do you handle references to images from a
>   template, other than hardcoding the app name in
>   the reference?
> 
>     <img src="/myApp/servlet/myApp/images/foo.gif">
>     <img src="/myApp/images/foo.gif">
>     <img src="/images/foo.gif">

last two ones are correct. For myApp propietary images
I would use /myApp/images/foo.gif and have it served
from the web browser.

> 
>   [I'm asking this because at one time or another I
>   believe I have seen all of these work, and I'm not
>   sure why they all did...]
> 
> * Is it at all possible to have pages of both kinds
>   jumping to each other? For instance, this kind of
>   interaction:
> 
>   1. From template T1, have a _link_ to static page S2.
>   2. In static page S2, read a couple of fields and
>      in its submit _button_, jump to template T3.
>   3. From template T3 read a couple of fields and
>      in its submit _button_ jump to static page S4.
>   4. From static page S4, have a _link_ to template T5.

I would not mix an static with a dynamic application 
if you can avoid it. Note that keeping consistent 
look-and-feel of the two worlds will be difficult to 
mantain.

> 
>   etc. You get the idea. The thing is, I got worried
>   by this answer from Fedor:
> 
>     If cookies are disabled and you hardcode the links
>     (like putting href='abc.wm') you gonna lose the
>     session. Is it the case? If this is the case the
>     right way to do is to use $link.... to create links.
> 
>   Is this correct? If yes, this would seem to imply that
>   jumping from a template to a static page would loose
>   the session information, right? I'm saying this because
>   I believe you cannot use $link to set a link to a static
>   page; is this correct? If yes, how do you handle the
>   jumping back and forth?

This is correct. Disabled cookies may become a problem.

Well, you can add some utilities to your (dynamic) context
to access the session information and add this manually
to the links twards the static pages. But now how do you
get this onto the links back into turbine? Via javascript?
So again, try not mix static and dynamic pages!

A commonly used solution is to pop-up addtional (named) browser
windows when accessing static content. Java script can easyly
make the popped-up window close and call JS in the originating 
window.

> 
> Thanks,
> 
> --
> Gonzalo A. Diethelm
> [EMAIL PROTECTED]


Hope this helps you in your journey.

:) Christoph


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to