Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


Antony Devassy
Diff b/w servlet n jsp
2 Answer(s)      5 years and 9 months ago
Posted in : Java Interview Questions



Advertisement
View Answers

November 17, 2008 at 1:49 AM


Nothing my friend. Both are same.
Only thing is Servlet is pure Java and JSP is mixture of html or php code.
servlet is static and JSP is dynamic. There is no class in JSP.In JSP there is no need to configure "web.xml" where as in class we have to configure "web.xml'...
That's it..... Have a nice day...........


November 17, 2008 at 4:16 AM


Hi friend,


JSP is Java code embedded in HTML; the Java code is compiled and run by the container on the server and the client only sees the results of that code's execution mixed in appropriately with the html.

Servlets are compiled pure Java class files (not mixed with HTML) that get posts from the client and send html to in return.

Servlet is used to exceute on the webbased,which is used to seperate the Dynamic and static Content.It acts as a Controller in MVC. JSP is a Presentation Layer.Which has the Dynamic Html it embedded with java code.Its use to mix both Dynamic and Static content


JSP is the extension of HttpServlet instance. JSP is basically used for presentation and servlet is used for bussiness logic although you use servlet for presentation after all JSP page also boil down to jsp servlet but presentation with servlet is realy labours and boring. Servlet are free from Http protocol you can use GenericServlet class as base class of your custom servlet class to perform communication with client either in http protocal and others but with JSP page your are married only
to HTTP protocol. JSP page provides you with set of implicit objects that are page, request, response, session, pageContext, config, out, application, exception (only for error page) whereas you do not find them in servlet at your disposal.


---------------------------------------------

Visit for more information.

http://www.roseindia.net/jsp/

http://www.roseindia.net/servlets/

Thanks.


Related Tutorials/Questions & Answers:
Diff b/w servlet n jsp - Java Interview Questions
Diff b/w servlet n jsp  hii i want to know the difference between servlet and jsp. please give me the details to understand them in correct... is Servlet is pure Java and JSP is mixture of html or php code. servlet is static
diff b/w applet and servlet
diff b/w applet and servlet  what is the difference between applet and servlet?   Difference between servlet and applet: 1)An applet is client side programming whereas servlet is server side programming. 2)Applets run
Advertisements
Diff b\w C++ & Java
Diff b\w C++ & Java  What is the difference between C++ & Java
diff b/w struts 1.0 and 1.2
diff b/w struts 1.0 and 1.2  diff b/w struts 1.0 and 1.2
difference b/w == and equals()
difference b/w == and equals()  what is the difference between == operator and equals()   Hi Friend, The == operator checks if the two objects were actually the same object. This operator looks at the actually memory
difference b/w viewdidload and ViewWillAppear
difference b/w viewdidload and ViewWillAppear   hello all, what is the difference b/w viewdidload and ViewWillAppear ???   hello, when view is loaded then this method run one time but ViewWillAppear run whenever
diff betn show n visible
diff betn show n visible  what is difference between show() & visible method in java
Diff ways to call a EJB from Servlet, JSP - Java Interview Questions
Diff ways to call a EJB from Servlet, JSP  How can I call EJB from Servlet or JSP
Underscore b/w consecutive capatalized words
Underscore b/w consecutive capatalized words  I have a text something like this "25km from N of Rio Negro" I want to add underscore between consecutive Capatalized words having space between them. Can some one give me
Difference b/w spring 2.x and 3.x
Difference b/w spring 2.x and 3.x  difference b/w spring 2.x and 3.x
drag n drop - JSP-Servlet
drag n drop  I want to implement drag n drop functionality for simple HTML/JSP without using applet,flash or any heavy components.using browse button... using drag and drop mode.when user drag n drop file then display the complete path
REQ for connection b/w jdbc and oracle database
REQ for connection b/w jdbc and oracle database    REQ for connection b/w jdbc and oracle database    The Java classes to connect.... b) If you are using oracle thin driver,you have to use: Connection conn
what is difference b/w oracle 8i, 9i and 10g
what is difference b/w oracle 8i, 9i and 10g  what are the difference between oracle 8i,9i and 10g? I am not considering the versions and their supported os, in the interview point of view
how to establish connection b/w java app and mobile phone
how to establish connection b/w java app and mobile phone  hello, my name is Dhanraj. i'm doing a project in my college. In that project we need to send SMS from our phone to a java application situated on a remote server
Difference b/w jdk 1.1 and 1.2 - Development process
Difference b/w jdk 1.1 and 1.2  Can you plz specify the changes/developments that have taken place from JDK 1.1 to JDK 1.2 and which version is the industry following currently.  Hi friend, Changes to CLASSPATH
RMI n JSP - RMI
RMI n JSP  Hi Friends, First of all let me appreciate ur promptness in delivering answers. Is it possible to make communication between RMI and JSP page ? Thanks
RMI n JSP - RMI
RMI n JSP  Hi Friends, First of all let me appreciate ur promptness in delivering answers. Is it possible to make communication between RMI and JSP page ? Thanks
servlet n jsps - Java Beginners
servlet n jsps  How to do: 1.After log-out, if user cilick on "back" button he shouldn't able see the previous page. 2.I want to expire the page...://www.roseindia.net/jsp/ Thanks.   hello, 1 = you can disable
How to connect to dao n bean classes with jsp
How to connect to dao n bean classes with jsp  I have made this edao... = totalvillagearea; } } **how to connect with this edao and ebean pkg with my jsp...; </table> <!-- End of New Village Registration --> <jsp:useBean
can pass list of n values in session and get in jsp
can pass list of n values in session and get in jsp  In dao: am... In servlet: list=userBean.selectUserBo(); HttpSession session = request.getSession(true); session.setAttribute("currentUser",list); In jsp: <
can pass list of n values in session and get in jsp
can pass list of n values in session and get in jsp  In dao: am... In servlet: list=userBean.selectUserBo(); HttpSession session = request.getSession(true); session.setAttribute("currentUser",list); In jsp: <
Problem insert data into database using servlet n javabean - Java Beginners
Problem insert data into database using servlet n javabean  I created a servlet for registration proses I got a problem compiling my servlet... to solve it.. i really new in jsp+servlet+javabean,dont really unnderstand 1)my
java - JSP-Servlet
java  Difference b/w Servlets and JSP  Hi friend, Main difference between Jsp and Servlet Jsp is better for view web pages, while servlet is good for request processing. Jsp has also all implicit objects
JSP-Servlet - JSP-Servlet
JSP-Servlet   how to pass the value or parameter from jsp page to servlet and view the passed value
JSP-Servlet - JSP-Servlet
JSP-Servlet   how to pass the value or parameter from jsp page to servlet and view the passed value
JSP-Servlet - JSP-Servlet
JSP-Servlet   how to pass the value or parameter from jsp page to servlet and view the passed value
Jsp ,Servlet Problem - JSP-Servlet
Jsp ,Servlet Problem  hi, m new to jsp n Servlet. i really find ur... with oracle. it worked wonders. now i m starting jsp n servlet learning.. pls suggest me a book from where i can strat from d scratch n also tell me d steps how
JSP-Servlet - JSP-Servlet
JSP-Servlet   how to pass the value or parameter from jsp page to servlet and view the passed value.   Hi Friend, Please visit the following links: http://www.roseindia.net/tutorial/servlet/passParameters.html
jsp/servlet - JSP-Servlet
jsp/servlet  How to create and save the excel file on given location using jsp/servlet?  hi Geetanjali, Read for more information, http://www.roseindia.net/jsp/poi/excelPOI.shtml Thanks
servlet and jsp
servlet and jsp  how to connect an jsp and an servlet without connecting to database
jsp and servlet
jsp and servlet  what is the difference between jsp and servlet ? what is the advantages and disadvantages of jsp and servlet
Servlet - JSP-Servlet
Servlet and Java Code  Example and source code in Servlet and JSP
JSP - JSP-Servlet
JSP & Servlet Example Code  Need example of JSP & Servlet
servlet and jsp - JSP-Servlet
servlet and jsp  can any one give me jsp-servlet related project-its urgent- 1-chat application 2-bug tracking system 3-online shopping 4-online...://www.roseindia.net/jsp/bank.shtml Thanks
servlet/jsp - JSP-Servlet
servlet/jsp  hi, get me the source code to upload all file formats in servlet/jsp plaese help me as soon as possible its urgent!!! by saravanan.k  Hi friend, Code to help in solving the problem
Servlet - JSP - JSP-Servlet
Servlet - JSP  i used arraylist in servlet as shown ArrayList total = new ArrayList (); ... total.add(k[i]); session.setAttribute("efg",total); when I code this like in my jsp <%ArrayList<Integer> data= new
servlet and jsp - JSP-Servlet
servlet and jsp  Hello folks, I am very new JDBC. I am doing a project on java messaging service on the part of the project we are using JDBC. In my...   write in the jsp form action="path of servlet" and wirite
servlet and jsp - JSP-Servlet
servlet and jsp  Hi friend, please show one sample program, how to connect jsp and servlet using backend a ms-access.  Hi friend,<%@ page language="java" import="java.sql.*,java.util.*,java.text.*"
Diff between ArrayList and Vector?
Diff between ArrayList and Vector?  What's The Difference between ArrayList and Vector Classes and Can you give me a simple Program for set and List Interface
java (servlet) - JSP-Servlet
java (servlet)  how can i disable back button in brower while using servlet or JSP
jsp/servlet - JSP-Servlet
jsp/servlet  Hello ! How can we call a servlet on a link on html page like a href="servletname"> Call Servlet Is it possible?   Hi friend, I am sending simple application using servlet. This is form
diff between encapsulation and abstraction code
diff between encapsulation and abstraction code  diff between encapsulation and abstraction code
diff between spring and struts in java
diff between spring and struts in java  diff between spring and struts in java
Diff Bn Actionform and Pojo - Struts
Diff Bn Actionform and Pojo   Hi Friends, I am confused with Pojo and ActionForm ,bcoz both have getter and setter methods.In both we declare fields and corresponding getter n setters also.plz  
Jsp-Servlet
Jsp-Servlet  how can i display the values in jsp pages as list from servlet ? can you help me out plz ? thanks
JSP,Servlet - JSP-Servlet
JSP,Servlet  How can i pass a list of objects from jsp to an Action? Please help me to do
jsp servlet
jsp servlet  i dont know how to write a code to Create a JSP with one text field to enter the URL and a submit button.On clicking the submit button, send the request to a servlet .Once the servlet receives the request, it need
jsp servlet
jsp servlet  i dont know how to write a code to Create a JSP with one text field to enter the URL and a submit button.On clicking the submit button, send the request to a servlet .Once the servlet receives the request, it need
servlet/jsp - JSP-Servlet
servlet/jsp  Thanks for ur feedback! But this program shows an error showing package.org.apache.commons.fileupload.servlet does not exists package.org.apache.commons.fileupload.disk does not exists
servlet session - JSP-Servlet
servlet session  hi, im working on a real estate web site.....n... login servlet fromabout us page now i want the servlet to redirect me... that called the servlet: like in JS we can call a previous page
Advertisements
 

 

 

DMCA.com