[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

using javascript src tag in servlets for Apache

Posted on 2001-07-31
4
Medium Priority
?
268 Views
Last Modified: 2013-11-24
i have been trying to call javascript using javascript src tag (<javascript src="script.js">) in my servlet which generates the html page(by using printwriter.println(""); statement) but the generated page fails to call the source.
 is it that the generated page does not have control on the js file.
please help me out with some solution.

thanks..
0
Comment
Question by:yousufbadar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
rjackman earned 200 total points
ID: 6337179
hi
try this out

out.println("<script language="JavaScript" type="text/javascript" src="/home/src/script.js"></script>
");

where /home/src/script.js is the full path of the file
where out is the object of PrintWriter
cheers
RJ
0
 
LVL 92

Expert Comment

by:objects
ID: 6337180
does script.js exist?
0
 
LVL 3

Expert Comment

by:shyamkumarreddy
ID: 6337234
Hey YOusurfbadar

Please place your js file in your servlet or jsp file path.
Okay
this will also work

<script src="file.js"></script>


Shyam


0
 
LVL 3

Expert Comment

by:Sendoh
ID: 6339206
hi !
as what the others said...
the generated page does have control of *.js files...
or else the jsp's with *.js wont work either...
so the problem here is the existances of "script.js" and the way u code the servlet...:P

hope it give u an idea to solve ur problem...:)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question