tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessio Fiore <afi...@alteanet.it>
Subject R: Help with hiding resources
Date Tue, 07 May 2002 14:12:15 GMT
>Thank you Alessio,
>does this mean that if I put the jar files in WEB-INF/lib directory they
>will be invisible to the browser? The WEB-INF/lib directory is a
>subdirectory off of the Root directory called "applications", which is the
>directory hosting the jsp files launching the applets and as such it should
>be accessible by the applet that the codbase points to applications
>directory (at least this is my understanding). Does Tomcat prohibit the
html
>page generated by the <jsp:plugin> from accessing the jar files in the
>WEB-INF/lib directory?  And if so do they have to be in a generic directory
>off of the root directory?


Yes, WEB-INF and META-INF subdirs of a tomcat context root directory are not
accessible externally (so the browser doesn't have access to any file under
these dirs). They're just accessible internally (by the server-side
application). Your applet files (.class or .jar) must be visible by the
browser, because their reference is put in JSP-generated HTML page (that is
parsed and managed by the browser itself), so you have to put them under a
subdirectory of "applications" other than WEB-INF.

Regards
Alessio

>Sorry if my mumbling is confusing I am just trying to understand what my
>options are.

>Thanks

>Kris

-----Original Message-----
From: Alessio Fiore [mailto:afiore@alteanet.it]
Sent: Tuesday, May 07, 2002 9:37 AM
To: 'Tomcat Users List'
Subject: R: Help with hiding resources


Hi Kris, the jar that contains the applet and related classes *must* be
accessible by the browser. If not the browser could not load it and extract
the applet (throwing the java.io.FileNotFoundException).


-----Messaggio originale-----
Da: Kris Kras [mailto:KKras@mectrol.com]
Inviato: martedì 7 maggio 2002 15.09
A: tomcat-user@jakarta.apache.org
Oggetto: Help with hiding resources


Hello all,

I have an application using jsps, servlets and applets runing under Tomcat
4.03 and Struts 1.0 (win2k server).
My application is located under "C:\Tomcat4\webapps\applications\" and all
jsp files are there. Some jsps launch applets through <jsp:plugin> tags.
Applets are packaged in jars located in
"C:\Tomcat4\webapps\applications\jars\". A code fragment launching applets
looks like this:
    <jsp:plugin
      type = "applet"
      code = "myapplet.MyAppletClass.class"
      archive = "jars/myapplet.jar"
      codebase = "."
      ...

When I run the jsp files everything works great and applets launch
correctly.

The problem is that with this directory structure the jar files are visible
and can be downloaded by typing
"http://www.domainmame.com/applications/jars/" or
"http://www.domainmame.com/applications/jars/myapplet.jar" and ultimatelly
decompiled. I would like to hide the resources (jar files and everything
else that is located in subdirectiories of "\applications\". I have tried
putting the jar files in "C:\Tomcat4\webapps\applications\WEB_INF\lib\"
where all other jar files (struts.jar, etc.) are located, but then
regardless of what I used for "archive" and "codebase" parameters in
<jsp:plugin> tag I get and file not found exception in the plugin console
(java.io.FileNotFoundException:
http://www.domainmame.com/applications/WEB-INF/lib/myapplet.jar) even though
the jar file is there.

I have tried setting the following values for "archive" and "codebase"
parameters in <jsp:plugin> tag with the jar file in
"C:\Tomcat4\webapps\applications\WEB_INF\lib\":

      archive = "myapplet.jar"
      codebase = "."

      archive = "/WEB-INF/lib/myapplet.jar"
      codebase = "."

      archive = "myapplet.jar"
      codebase = "/"

      archive = "myapplet.jar"
      codebase = "/applications/WEB-INF/lib/"

None of the combinations worked. Can anyone help me with configuring these
two parameters so the Tomcat can find myapplet.jar.

Or is there a better solution to hiding resources under Tomcat.

Any help would be greatly appreciated.

Thanks

Kris


--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>



- Disclaimer -
This email and any attachments thereto may contain information which is
confidential and/or protected by intellectual property rights and are
intended for the sole use of the recipient(s) named above. Any use of the
information contained herein (including, but not limited to, total or
partial reproduction, communication or distribution in any form) or the
taking of any action in reliance on the contents, by persons other than the
designated recipient(s) is strictly prohibited.

If you have received this email in error, please notify the sender either by
telephone or by email and delete the material from any computer.

Thank you for your cooperation.



--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>



- Disclaimer -
This email and any attachments thereto may contain information which is
confidential and/or protected by intellectual property rights and are
intended for the sole use of the recipient(s) named above. Any use of the
information contained herein (including, but not limited to, total or
partial reproduction, communication or distribution in any form) or the
taking of any action in reliance on the contents, by persons other than the
designated recipient(s) is strictly prohibited.

If you have received this email in error, please notify the sender either by
telephone or by email and delete the material from any computer.

Thank you for your cooperation. 



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message