How Are Static Files Served in a Web-App Server Setup
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aejaz_Sheriff
Posted On:   Saturday, August 11, 2001 01:23 PM

If I have seperate m/c for app and web servers and my statis content is on the web server then in my jsp program the refernce to this statis content is done through a mapping of the mount point/drive of the where the statis content is stored to a local drive on the app server. I thought that my static content gets served by the web server and the dynamic content by my app server. I was happy, then all of a sudden I get this question - If the jsp page is converted to a html page by the jsp/servlet engine on the appserver and the statis contents are also included on to the html page after which it is sent as a response to the browser then the statis content also goes through the web-app bridge!. I am confused now. I n   More>>


If I have seperate m/c for app and web servers and my statis content is on the web server then in my jsp program the refernce to this statis content is done through a mapping of the mount point/drive of the where the statis content is stored to a local drive on the app server. I thought that my static content gets served by the web server and the dynamic content by my app server. I was happy, then all of a sudden I get this question -



If the jsp page is converted to a html page by the jsp/servlet engine on the appserver and the statis contents are also included on to the html page after which it is sent as a response to the browser then the statis content also goes through the web-app bridge!. I am confused now.



I need to know if my thinking in wrong if no please explain.
If yes then how is the statis content served through a web server in this type of a set up and how does the jsp page refer to it?



Cheers

Aejaz

   <<Less

Re: How Are Static Files Served in a Web-App Server Setup

Posted By:   Christopher_Pickslay  
Posted On:   Saturday, August 11, 2001 03:10 PM

Generally, your web server is configured to listen for all requests, and forward certain requests to your application server, based either on the path requested, the file extension, or both. How you configure this depends on which web and application servers you're using. For apache/tomcat configuration, see http://jakarta.apache.org/tomcat/tomcat-3.2-doc/tomcat-apache-howto.html


Once you're configured correctly, all URLs (in JSPs, servlets, or static HTML pages) should point to paths relative to either your web server's document root (for static content) or your web application's context root (for JSPs). A common configuration is to have the web server handle all requests except those within a web application context root.

In your Tomcat configuration, you define a web application context with a tag that looks something like this:




The path attribute specifies the URI paths that should be directed to this web application. The docBase attribute specifies the location on disk of your web application. For example, a JSP on disk at:


/tomcat/webapps/mwa/test.jsp


would be served by the following URL:


http://your-host/myWebApp/test.jsp

About | Sitemap | Contact