answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: How can you move the data from servlet to jsp?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Basic Math

How do JSP methods get translated to Servlet methods?

A JSP gets converted into a Servlet for execution and hence the methods in a JSP are similar to the ones in a Servlet.Scriptlets and Expressions will end up in the body of doGet or doPostDeclarations will end up as instance variablesjspInit() and jspDestroy() will get translated to Servlet's init() and destroy() methods


What is different between jsp and servlets?

A JSP is typically oriented more towards displaying information, and a servlet is more oriented towards processing information. For example, a JSP might display a report, while a servlet would process a user submitted form. These uses are not exclusive, but they are optimized more for performing tasks in this manner. It is much easier to incorporate HTML coding into a JSP than a Servlet. It is also easier to write more complex Java code in a servlet.


What is the difference between JSP and Servlets?

A JSP is typically oriented more towards displaying information, and a servlet is more oriented towards processing information. For example, a JSP might display a report, while a servlet would process a user submitted form. These uses are not exclusive, but they are optimized more for performing tasks in this manner. It is much easier to incorporate HTML coding into a JSP than a Servlet. It is also easier to write more complex Java code in a servlet.AnswerJSP has Implicit objects and Servlets do not. AnswerJSP and Servlet both define the server end functionality to provide dynamic outputs ,As we know our HTML is only the client end technology version which runs on client browser. JSP and Servlet differ each other in terms of represntation and execution cycle. Servlet are full functional java codes that define the output like write to stream files in protocol defined ways, JSP on the other hand is Role Sepated format to do so where a ordinary web designer designes how will be the presentation of the data and Programmer defines the functinality to provide the underlying things represented in conditional and non conditinal ways , But here is the magic of JSp that merges the both HTML represntation mixed with JAVA scriptlets. Look at http://www.jsptube.com/jsp-tutorials/jsp-introduction.html, it explains how does JSP differs from servlet.


How you can display servlet page in jsp page?

You cannot. You display JSP Pages using the help of Servlets. Servlets are of the background classes and you cannot display them


What is doGet method in servlet?

The doGet() method is the method inside a servlet that gets called every time a request from a jsp page is submitted. The control first reaches the doGet() method of the servlet and then the servlet decides what functionality to invoke based on the submit request. The get method called when the type of page submission is "GET" There is another way of submitting requests from a jsp page is "POST" and when that happens it calls the doPost() method inside the servlet.

Related questions

How do you import jsp file in servlet?

I think the name of the jsp file is included in the web.xml of the servlet


How do you proove servlets are faster than JSP?

because JSP internally changes in servlet and then follow servlet life cycle, so it is slower than servlet


How do you call a Servlet from JSP?

I have created a .jsp file, in which, I am calling a class.method() through TagLib. REQUIREMENT is, I want to call a servlet instead of a simple class. And Servlet will get the response, and request object from Jsp, and manipulate that, and produce the response object, and control is transfered back to JSP again.


Why donot you have doget in jsp also?

Because the doGet is the work of the Servlet and not the JSP


How do JSP methods get translated to Servlet methods?

A JSP gets converted into a Servlet for execution and hence the methods in a JSP are similar to the ones in a Servlet.Scriptlets and Expressions will end up in the body of doGet or doPostDeclarations will end up as instance variablesjspInit() and jspDestroy() will get translated to Servlet's init() and destroy() methods


Can insert javascript coding in servlet?

No. Javascript code can be present inside a JSP but not inside a servlet. A Servlet is a pure java class.


Which one is faster servlet OR jsp?

Servlet is more faster than JSP, but JSP is more convenient than Servlet and JSP is clearly superior, shorter, simple and easier to use. JSP can be perceived as Java in HTML code. JSP require no explicit compilation as like servlets and can keep in the web application server as HTML file. The web application server in turn compile the java code in JSP and load it in its library for future execution. Servlet can be perceived as HTML in Java code. The servlet is the class file, which would be loaded in the web application server as a program. The program output will be directed to the outstream object which in turn direct to the client as HTML elements.


What is the difference between requestgetattribute and requestgetParameter in JSP?

request.getAttribute() is used on the Server side Java code to get values submitted from the form onto the Servlet or other java classes request.getParameter() is used on the JSP page to get values sent by the servlet and display it in the jsp page


What is different between jsp and servlets?

A JSP is typically oriented more towards displaying information, and a servlet is more oriented towards processing information. For example, a JSP might display a report, while a servlet would process a user submitted form. These uses are not exclusive, but they are optimized more for performing tasks in this manner. It is much easier to incorporate HTML coding into a JSP than a Servlet. It is also easier to write more complex Java code in a servlet.


What is the latest version of servlet specification?

Servlets 3.0 and JSP 2.1


How do you get the image file from the database with JSP?

You can retrieve an image file from a database in JSP by writing a servlet that fetches the image from the database and streams it to the JSP page. The servlet will set the content type to "image/jpeg" or the appropriate image format and write the image data to the response output stream. In the JSP page, you can then display the image by setting the source attribute of the img tag to the servlet URL.


What is the difference between JSP and Servlets?

A JSP is typically oriented more towards displaying information, and a servlet is more oriented towards processing information. For example, a JSP might display a report, while a servlet would process a user submitted form. These uses are not exclusive, but they are optimized more for performing tasks in this manner. It is much easier to incorporate HTML coding into a JSP than a Servlet. It is also easier to write more complex Java code in a servlet.AnswerJSP has Implicit objects and Servlets do not. AnswerJSP and Servlet both define the server end functionality to provide dynamic outputs ,As we know our HTML is only the client end technology version which runs on client browser. JSP and Servlet differ each other in terms of represntation and execution cycle. Servlet are full functional java codes that define the output like write to stream files in protocol defined ways, JSP on the other hand is Role Sepated format to do so where a ordinary web designer designes how will be the presentation of the data and Programmer defines the functinality to provide the underlying things represented in conditional and non conditinal ways , But here is the magic of JSp that merges the both HTML represntation mixed with JAVA scriptlets. Look at http://www.jsptube.com/jsp-tutorials/jsp-introduction.html, it explains how does JSP differs from servlet.