Including jsps/html files from remote host into our JSP

V

Venkatesh

Hello All,

I have a question related to JSPs. We have few JSP files and HTML files
in our webapp. The JSP files have jsp:include directives to include
different HTML files. Now we plan to shift all HTML files to a
different location - machine having apache installed (might be on same
host or on different host). In this case, how can we include the HTML
files into our JSP using jsp:include ??? Since all files were together
till now, I was accessing the HTML files using relative paths, but now
I'm not knowing about how to access the HTML files. Request somebody
who has knowledge about this to help me solve this problem.

Thank you,
Venkatesh
 
V

Venkatesh

Just wanted to add:

Our app server is Tomcat 4.1.30, and JSP version is JSP 1.2

Thank you,
Venkatesh
 
L

Lew

In the first place, having to hard-code URLs into an application is bad
practice. Strongly resist putting absolute URLs inside your application code.
Doing so ties the application to one particular environment.

You can set up Apache to forward URLs of a certain pattern to another host or
directory. So you could keep your original relative paths and let the
deployment figure out whence to retrieve them.

The larger question is how it possibly makes sense to divide applications
where HTML files come from a separate logical host. Methinks this decision
requires more careful analysis and later rejection. From the point of view of
the application, all such resources should be local to the application.

Consider the WAR file that would install this app. Would it lack the HTML files?

- Lew
 
V

Venkatesh

HI Lew,

The way our application is structured is - JSPs form a framework, and
when this framework is combined with assets - like images, html part
files, the site will come up.

The assets are created by 3rd party and not by us ... and we don't want
to expose the application war to them. Infact the idea is to upload the
assets into their servers and access from there directly. It is
basically the business factor driving for this divison.

Thank you,
Venkatesh
 
D

Daniel Pitts

Venkatesh said:
HI Lew,

The way our application is structured is - JSPs form a framework, and
when this framework is combined with assets - like images, html part
files, the site will come up.

The assets are created by 3rd party and not by us ... and we don't want
to expose the application war to them. Infact the idea is to upload the
assets into their servers and access from there directly. It is
basically the business factor driving for this divison.

Thank you,
Venkatesh

Please don't top-post...

Well, for images, you wouldn't use a jsp:include.
Actually, jsp:include ONLY works for local files. You would be better
off running behind Apache, and using virtual includes.

Although, images wouldn't be jsp:included anyway, as they are <img
src='image.gif'> format.

You might also look into a content-management solution instead.
Databases and search indexes aren't new technology.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top