----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

I asked earlier this week about using images under SSL for servlet-
generated HTML.  Since no one had an answer, I came up with this.  
I'm posting it because I saw some earlier (also unanswered) 
questions in the archive that may be the same problem.  Also, 
there are some drawbacks to this method so if anyone knows how 
to alleviate them please comment.

The problem is that when the generated HTML is '<img src="Logo.gif"/>',
the browser looks for it at https://(domain)/servlets/Logo.gif.  You 
can get around this by specifying the full path to the file if you 
aren't using SSL, but if you are the browser complains that the 
image is 'insecure data'.

Checking the log I saw that JServ was looking for a Java .class called 
Logo.gif. So... I simply created a small servlet that does nothing but 
PUT the requested file (setting the MIME type of course).  I then made 
ApJServAction entries that pointed GIF's, JPEG's, and PNG's to that 
servlet.

This works, but it does have drawbacks:

1) I've done no measurements, but I'm sure that there's a performance 
hit because of the extra servlet.

2) The file structure is inflexible.  The served-up files _have_ to 
be in a directory called 'servlets'.  You can have it under other 
directories, depending on how you code the fileserver servlet 
(mine's under htdocs), but the immediate parent directory has to 
be called 'servlets' (actually, probably whatever you used to invoke 
the original servlet).  Having your images under a directory called 
servlets is not intuitive to the next poor sap who has to maintain 
the site.  And you can't have subdirectories, either.

So that's what I've got now... anyone with better ideas, speak up!

thanx,

Greg Groves

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Greg Groves
Sent: Monday, July 24, 2000 5:47 PM
To: Java Apache Users
Subject: Location of files for generated HTML


----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

I _think_ this a JServ issue... if I'm wrong I'm sure someone 
will tell me... :)

I'm using Xerces/Xalan with JServ to create HTML pages from XML.  
The pages may include images, but I've never been able to find 
a relative path that can access them.  So I always used the full 
path with the image name.  This worked OK, but now I need to do 
SSL.  And if the full path name is specified, the browser complains

"You have requested a secure document that contains some insecure 
information."

So I've tried moving the images all over the place, without success.
If I put no path information at all on the SRC= parameter, Netscape 
'View Page Info' shows the location as

Image: https://10.0.0.5/servlets/Logo.gif

So I tried actually putting the image under servlets, but it didn't 
work... I guess JServ assumes that everything in the servlets 
directory really is a servlet.  Also tried subdirectories under 
servlets, no joy.

So... is there any way to specify a relative path to an image file 
under JServ?

I'm using Apache 1.3.12 and JServ 1.1.2 under Win98 (obviously not 
a production system :)

thanks,

Greg Groves


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search Archives: 
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search Archives: 
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to