Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

Including jsps/html files from remote host into our JSP

Thread view: 
Venkatesh - 16 Dec 2006 07:11 GMT
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
Venkatesh - 16 Dec 2006 07:16 GMT
Just wanted to add:

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

Thank you,
Venkatesh

> Hello All,
>
[quoted text clipped - 10 lines]
> Thank you,
> Venkatesh
Lew - 16 Dec 2006 18:55 GMT
>> 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
[quoted text clipped - 5 lines]
>> I'm not knowing about how to access the HTML files. Request somebody
>> who has knowledge about this to help me solve this problem.

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
Venkatesh - 19 Dec 2006 16:27 GMT
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

> >> 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
[quoted text clipped - 22 lines]
>
> - Lew
Daniel Pitts - 19 Dec 2006 23:58 GMT
> > >> 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
[quoted text clipped - 35 lines]
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.