tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wagoner, Mark" <MWago...@wildflavors.com>
Subject RE: Newbie Alert! - including a a JavaScript src file in a servle t
Date Thu, 16 May 2002 17:17:06 GMT
Your browser cannot view files under the WEB-INF directory.  Create one
under ROOT (e.g., scripts) and point the source attribute at that
(src="/scripts/code_lib.js").  Just make sure you put your file there, too.
;0)

-----Original Message-----
From: David@softv.net [mailto:David@softv.net]
Sent: Thursday, May 16, 2002 1:13 PM
To: tomcat-user@jakarta.apache.org
Subject: Newbie Alert! - including a a JavaScript src file in a servlet


Hopefully this is the correct forum to post a question such as this:

I have a servlet in which I would like to write out some script tags to
indlude a JavaScript src file in the outputted HTML.
My application is in /ROOT/WEB-INF/class/code_lib, the .js file
(code_lib.js) I would like to include is within this directory as well, and
I am trying to include it this way:

out.println("<script language=\"JavaScript\" src=\"code_lib.js\">");
out.println("</script>");

So, in the resulting html we have "<html><head><script langauge =
"JavaScript" src="code_lib.js"></script></head>...

When I run the servlet the generated page cannot find the .js file. Where
should I put files I want to include in the outputted html (such as .js and
.css files)? Can this even be done?

Dave



--
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>


Mime
View raw message