Can we use javascript in Servlets?
Answers were Sorted based on User's Feedback
Answer / gsrgsrgsr
Yes you can,
In
PrintWriter out=response.getWriter();
out.println("<script langauage='javaScript'>");
out.println("your code here");
out.println("</script>");
| Is This Answer Correct ? | 42 Yes | 5 No |
Answer / sanjeev
Yes, If we are able to write javascript in jsp then Obviously
we can write javascript in a servlet because internally jsp
will be converted to servlet.
| Is This Answer Correct ? | 14 Yes | 3 No |
What’s the difference between forward() and sendredirect() methods?
What is the difference between using getSession(true) and getSession(false) methods?
Describe the phases of servlet lifecycle?
What is HTTP Tunneling?
Which java application server is the best?
How ThreadSafe page attribute will be working in Servlet as well as in JSP?Automatically ThresdSafe is true in JSP so service method will be destroy in each and every request or not?so how thresd will handle srevice method?
Why doesn’t a servlet include main()? How does it work?
Which are the different ways you can communicate between servlets?
What do you mean by scope object and what are its types?
What's the advantages using servlets than using cgi?
What are the types of protocols supported by httpservlet ?
What are the methods in HttpServlet?