Hi kathy, > request.getContextPath() could be a solution. I am including the JS file in common_header.jsp, so how do I use request.getContextPath()?
Also, I tried the html:rewrite tag: <script language="JavaScript" src='<html:rewrite page="/test/js/public.js"/>' runat="server"></script> And it rewrites the address to: <script language="JavaScript" src='/dtv-server/test/user/test/js/public.js' runat="server"></script> However, The correct address should be: /dtvserver/test/js/public.js. The rewrite tag adds an additional "/test/user" to the address ... What I only need the is the "/dtv-server" part. Any suggestion? Thanks. On Thu, May 20, 2004 at 08:59:07AM -0400, Kathy Zhou wrote: > > Kathy > > -----Original Message----- > > From: Paul McCulloch [SMTP:[EMAIL PROTECTED] > > Sent: Thursday, May 20, 2004 4:55 AM > > To: 'Struts Users Mailing List' > > Subject: RE: Include common javascript file with relative path > > > > Look at the <html:rewrite> tag. > > > > Paul > > > > > -----Original Message----- > > > From: Ding Lei [mailto:[EMAIL PROTECTED] > > > Sent: 18 May 2004 10:11 > > > To: [EMAIL PROTECTED] > > > Subject: Include common javascript file with relative path > > > > > > > > > Hello folks, > > > There is a common jsp file named common_header.jsp used > > > throughout the system, under PROJECT_ROOT/js/ directory, and > > > various function jsp files are under different subdirs of > > > PROJECT_ROOT, for example, appEdit.jsp,appRemove.jsp under > > > PROJECT_ROOT/app directory. > > > Now the question is that how do I include a common > > > javascript file in common_header.jsp without specifying an > > > absolute path? Now i have to use something like > > > "../js/common.js", which works for files under one level > > > subdir(PROJECT_ROOT/app)... but definitely won't work other > > > files under the PROJECT_ROOT or PROJECT_ROOT/app/something/ .... > > > Any ideas? > > > Thanks in advance. > > > > > > > > > -- > > > Regards, > > > > > > <(( D i n g L e i ))))))>> > > > || || > > > || Ext: 8102 || > > > || Email: <dinglei [A] ipanel [O] cn> || > > > || Dept. Of Technology/Engineering || > > > || Embedded Information Services Inc. || > > > || || > > > <(((((( ===================== )))))>>> > > > > > > "I went to the museum where they had all the heads and arms from the > > > statues that are in all the other museums." > > > -- Steven Wright > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > ********************************************************************** > > Axios Email Confidentiality Footer > > Privileged/Confidential Information may be contained in this message. If > > you are not the addressee indicated in this message (or responsible for > > delivery of the message to such person), you may not copy or deliver this > > message to anyone. In such case, you should destroy this message, and > > notify us immediately. If you or your employer does not consent to > > Internet email messages of this kind, please advise us immediately. > > Opinions, conclusions and other information expressed in this message are > > not given or endorsed by my Company or employer unless otherwise indicated > > by an authorised representative independent of this message. > > WARNING: > > While Axios Systems Ltd takes steps to prevent computer viruses from being > > transmitted via electronic mail attachments we cannot guarantee that > > attachments do not contain computer virus code. You are therefore > > strongly advised to undertake anti virus checks prior to accessing the > > attachment to this electronic mail. Axios Systems Ltd grants no > > warranties regarding performance use or quality of any attachment and > > undertakes no liability for loss or damage howsoever caused. > > ********************************************************************** > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] -- Yours, <<<::::: D i n g L e i ::::::>> || || || Ext: 8106 || || Email: <dinglei [A] ipanel [O] cn> || || Dept. Of Technology/Engineering || || Embedded Information Services Inc. || || || <(((((( ===================== )))))>>> William Safire's Rules for Writers: Remember to never split an infinitive. The passive voice should never be used. Do not put statements in the negative form. Verbs have to agree with their subjects. Proofread carefully to see if you words out. If you reread your work, you can find on rereading a great deal of repetition can be avoided by rereading and editing. A writer must not shift your point of view. And don't start a sentence with a conjunction. (Remember, too, a preposition is a terrible word to end a sentence with.) Don't overuse exclamation marks!! Place pronouns as close as possible, especially in long sentences, as of 10 or more words, to their antecedents. Writing carefully, dangling participles must be avoided. If any word is improper at the end of a sentence, a linking verb is. Take the bull by the hand and avoid mixing metaphors. Avoid trendy locutions that sound flaky. Everyone should be careful to use a singular pronoun with singular nouns in their writing. Always pick on the correct idiom. The adverb always follows the verb. Last but not least, avoid cliches like the plague; seek viable alternatives. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]