Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Can not include javascript using TC 4.1.29

Chirs Wahl

2003-12-29

Replies:

Howdy,

I am developing a web app using win2k pro + Tomcat

In a servlet , the following code works ( file /script/utility.js can be get by IE)

    sb.append ("<html>\n");
    sb.append ("<head>\n");
    sb.append ( getContentTypeMeta(_req) );
    sb.append ("<script language=javascript1.2 src=\"/script/utility.js\"></script>\n");
                                                              ^
but when the preceding slash is deleted, IE can not get the js file:

    sb.append ("<html>\n");
    sb.append ("<head>\n");
    sb.append ( getContentTypeMeta(_req) );
    sb.append ("<script language=javascript1.2 src=\"script/utility.js\"></script>\n");
                                                              ^ no / here

BTW, both are OK under TC 4.0.1.
Because the web app will be deployed in another servlet container which only
recognize the first format , I want to using the format with preceding "/ " , how should I do ?
( better not to use 4.0.1 :)

TIA
                                                                       
©2008 junlu.com - Jax Systems, LLC, U.S.A.