aspose file tools*
The moose likes Servlets and the fly likes how to use javascript in servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to use javascript in servlet?" Watch "how to use javascript in servlet?" New topic
Author

how to use javascript in servlet?

kuni patel
Greenhorn

Joined: Jun 04, 2005
Posts: 7
how to use javascript in servlet?



Plz, give me solution .......


Thanx
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You don't use Javascript in a servlet.
To a servlet, Javascript is nothing more than text (just as HTML is).


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Ben Souther:
You don't use Javascript in a servlet.
To a servlet, Javascript is nothing more than text (just as HTML is).


Quite right.
It means you can write javascript in your response like HTML. And it will get executed at client-side.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42292
    
  64
If you're talking about executing a JavaScript script in a servlet (as opposed to executing it in the web browser), have a look at Rhino. It is a JavaScript engine written in Java, and thus embeddable into a servlet.


Ping & DNS - my free Android networking tools app
Hetal Thakkar
Greenhorn

Joined: Jul 21, 2005
Posts: 5
[Comments removed, sorry]
[ September 26, 2005: Message edited by: David O'Meara ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

We are unable to moderate posts that are not in English.
My apologies for removing you post, please post it again.

thanks,
Dave.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to use javascript in servlet?