what is the difference between Servlet and JSP?Advantage of
JSP over Servelt?Any concept present in JSP which we cant
implement in Servlet?
Answer Posted / sree
Servlet is a Java Mechanism which is a part of J2SE(J2SE was also said by some pgmers as Java 2 Servlet edition) and further implemented into J2EE and now on JEE. The difference between servlets and jsp is that in JSP each page is considered as a single dynamic page from which the reference to other pages are very easy ... for example.. in servlet to forward a page from html we use:<form method=post action="http://localhost:8080/ctxt/java_class"> but in jsp we just give <form method=post action="filename.jsp"> ! But how does this work.. The server just takes the filename.jsp and converts that into a filename.class and inserts http://localhost :8080/ctxt root in front of it(A virtual assumption for understandability) and communicates...so the programming complexity is generaaly reduced.. and ther are loo of differences given by others and hence i just liked to share this information with you people.
Thankyou.
| Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
What is the main purpose of java servlets?
What do you mean by cgi?
What is cookie? Why is cookie used?
What are the phases of a servlet life cycle?
What is http servlet? Explain with the help of an example.
Explain servlet life cycle?
Differentiate between the print writer and servlet output stream?
What are the mechanisms used by a servlet container for maintaining session information?
What is the difference between CGI and Servlet?
Difference between java beans & servlets?
Explain the methods of request dispatcher in servlet?
How the servlet is loaded?
I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>
How to get the IP address of client in servlet?
How can you run a servlet program?