This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Best Practice For Importing Static Content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Best Practice For Importing Static Content" Watch "Best Practice For Importing Static Content" New topic
Author

Best Practice For Importing Static Content

Scott Maclary
Ranch Hand

Joined: May 11, 2005
Posts: 34
I have a large static html page that never changes and needs to be on the web server instead of the app server (where it currently resides).

The problem is the main page, header, footer, sidebar and a couple of other included pages are all dynamic JSP pages. So...how to I do include a static html page that resides on the web server from a JSP page on the app server?

I have read other posts where they suggested c:import and I tried that...but I am getting an error "java.io.IOException: Server returned HTTP response code: 403 for URL: http://urltowebserver/index.html"

Is the standard practice to use c:import? If so, what was the standard before that tag was avaialable because it hasn't been around that long...?

Thanks,
Scott
Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
Hi,

Did you try the include directive ?



Let me know what happened with you ...

Best of luck ...


Vassili ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

As of JSP 2.0 <c:import> is the best way to accomplish what you are after,.

A 403 error means permission was denied.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

Originally posted by Vassili Vladimir:
Did you try the include directive ?


Inlcude only works for resources within the current web application.

If so, what was the standard before that tag was avaialable


There wasn't one.
 
Consider Paul's rocket mass heater.
 
subject: Best Practice For Importing Static Content
 
Similar Threads
"Apache Tomcat alone" OR" Apache HTTP server" OR "Apache Tomcat + Apache HTTP server"
whats the difference between page 452 and 453
Including files in a jsp from different machine
web server /application server
App. server and webserver