Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Urgent help reqd. : regarding importing of .js files in servlets  RSS feed

 
Prabhu Chandrasekaran
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I dont seem to be able to import .js files in a servlet. Iam able to do the same from either a HTML file or a JSP file...
The same syntax does not work in servlets ..
We are in a fix due to this.
Would be very thankful if you could help us get out of this problem.
Thanks,
Prabhu.V.C
 
n prabakaran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prabu
You have n't define ur problem in detail.
Any way u have to include a .js file(javascript file)

<script language="javascript" src="type the path of file here">
</script>
<%
continue ur jsp script
%>
For getting this in details mail to
nprabakaran@yahoo.com with complete definition
of the problem.
Regards
Prabu.N

Originally posted by Prabhu Chandrasekaran:
Hi All,
I dont seem to be able to import .js files in a servlet. Iam able to do the same from either a HTML file or a JSP file...
The same syntax does not work in servlets ..
We are in a fix due to this.
Would be very thankful if you could help us get out of this problem.
Thanks,
Prabhu.V.C

 
n prabakaran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For servlets Have Like this

out.println("<script language='javascript' src='path of the file'"> );
out.println("</script> );

You should not have body in this script tag even for JSP,HTML and
also Servlet.

That is following definition is wrong.

<script language="javascript" src="../jscripts/validate.js">
function toReload(){
window.location.reload();
}
</script>

The following is correct

<script language="javascript" src="../jscripts/validate.js">
</script>


 
Raveendran Karunakaran
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i think i can solve your problem. but one thing clear before that. you have the java script embedded in your Html right ? after that when you convert into a Servlet it automatically comes into the out.println okay?
in JSP you dont even do anything like this. it is automatically embedded there.
i think i got your question correctly.
 
Prabhu Chandrasekaran
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raveendra,
I think U have got my problem right ...
But the import tag is not working in servlets ..
Thanks,
Prabhu.V.C
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!