Servlets vs JSP

Servlets vs JSP

What is the main difference between Servlets and JSP?
View Answers

March 17, 2010 at 12:18 PM

Hi Friend,

Differences:

1)In MVC, jsp act as a view and servlet act as a controller.

2)JSP pages contain a mixture of HTML, Java scripts, JSP elements, and JSP directives while servlet is totally uses java code.

3)Java Server Pages is that they are document-centric. Servlets, on the other hand, look and act like programs.

4)JSP is basically used for presentation and servlet is used for
bussiness logic

5)Servlets are faster than jsp.

6)In Servlet, clientside validation is possible whereas clientside validation is not possible in JSP.

Thanks









Related Tutorials/Questions & Answers:
Servlets vs JSP - JSP-Servlet
Servlets vs JSP  What is the main difference between Servlets and JSP?  Hi Friend, Differences: 1)In MVC, jsp act as a view... and servlet is used for bussiness logic 5)Servlets are faster than jsp. 6
Servlets Vs Jsp - JSP-Servlet
Servlets Vs Jsp  In servlets and Jsp's which one is important? and also tell me the Is Servlets are best or jsp's are best? give me the(reason also... with servlets but not with jsp's)Most of cases we use jsp's for presentation.i.e
Advertisements
jsp -servlets
jsp -servlets  i have servlets s1 in this servlets i have created emplooyee object, other servlets is s2, then how can we find employee information in s2 servlets
jsp and servlets
jsp and servlets  what is difference between jsp and servlet?? what should a person use to develop website ??   JSP is used for view in MVC... the request submitted from browser and process the data and redirect it to JSP
jsp and servlets
jsp and servlets  i want code for remember password and forget password so please send as early as possible ............. thanks in advance   Please visit the following link: http://www.roseindia.net/jsf/richfaces
jsp,servlets - JSP-Servlet
jsp,servlets   Good Afternoon Sir, I am sowmya i have a doubt that is whether it is possible to use arrays in servlets.how to declare that arrays in servlets and i am getting values from textbox in jsp
Struts ForwardAction vs Forward tag in jsp - Struts
Struts ForwardAction vs Forward tag in jsp  difference between struts ForwardAction class and Forward tag in jsp
servlets and jsp - JSP-Servlet
servlets and jsp  HELLO GOOD MORNING, PROCEDURE:HOW TO RUN A SERVLET AND JSP IN COMMANDPROMPT AND ALSO IN NETBEANS IDE6.0,IT'S VERY URGENT FOR ME,IN ADVANCE THANK U VERY MUCH.   TO Run Servlets in Compand
Difference between JSP and Servlets
Difference between JSP and Servlets  What is the difference between JSP and Servlets ?   JSP is used mainly for presentation only. A JSP can only be HttpServlet that means the only supported protocol in JSP is HTTP
JSP and servlets - JSP-Servlet
JSP and servlets  Hi sir, This is vanisree in my project i need to add the start time of examination and end time of examinaion and if the time between end and start are greater than one hour then i need to close that session
JSP-Servlets-JDBC
JSP-Servlets-JDBC  Hi all, 1, Create - i want sample code ( if possible with explanation) to create a registration form in JSP, and the form..... It will be helpful if it's made into sub modules, JSP, Driver Constants, Servlets, Java Beans
servlets - JSP-Servlet
servlets link . you can learn more information about servlets structure. To develop an application using servlet or jsp make the directory structure Read for more information. http://www.roseindia.net/servlets/directory
Servlets in JSF - JSP-Servlet
in the form itself by double clicking why should i go for servlets to write code.... Simply what is the role of servlets in JSF. which one is the best one..jsp...Servlets in JSF  Hi! I am using Java Visual Studio to develop my
how to execute jsp and servlets with eclipse
how to execute jsp and servlets with eclipse  hi kindly tell me how to execute jsp or servlets with the help of eclipse with some small program
servlets - JSP-Servlet
an application using Servlets or jsp make the directory structure given below link http://www.roseindia.net/servlets/directory-structure.shtml Now visit
servlets - JSP-Servlet
servlets.  Hi friend, employee form in servlets...;This is servlets code. package javacode; import java.io.*; import java.sql.... Servlet and JSP Examples. Servlet and JSP
servlets output to jsp - JSP-Servlet
servlets output to jsp  hey i have writing a code lately and wanted to print the output to the jsp page from the servlet.the servlet would read the command prompt n thn return the output as string to the jsp page here
servlets and jsp - JDBC
servlets and jsp  I want to display textboxes dynamically in my page using JSP and servlets (javascript for validation). For eg, consider the recruitment application form for various jobs. The name, address and tel
Servlets,Jsp,Javascript - JSP-Servlet
Servlets,Jsp,Javascript  Hi in my application i am creating a file... ExportToExcel button, jsp Upload plot nos (.xls format). GO Reset ExportToExcel... the browse button which is in my jsp it open the browse window i dont want
servlets - JSP-Servlet
servlets  How would you set an error message in the servlet,and send the user back to the JSP page?Please give java or pseudo code examples.  ...(""); } } --------------------------------------------------- Read for more information. http://www.roseindia.net/servlets
java Servlets - JSP-Servlet
java Servlets  Hi i am having a doubt regarding servlets as i am in learning stage give me any clew how to retrive data from mysql database after... here i am not using any jsp's. i got up to retriving data from data base but i am
Business logic vs Presentation logic - JSP-Servlet
Business logic vs Presentation logic  what is the difference between Business logic and Presentation logic
servlets - JSP-Servlet
servlets  how to upload images in servlets  Hi friend, For solving the problem : http://www.roseindia.net/servlets/upload-image.shtml Thanks
servlets - JSP-Servlet
servlets  hi, can anybody help me as what exactly to be done to for compilation,execution of servlets. i also want to know the software required in this execution
Servlets - JSP-Servlet
Servlets  Hi,im d beginner to learn servlets and jsp.please can u... with the host server.It also allows the servlets to write events to a log file... to: http://www.roseindia.net/servlets/ServletContext.shtml http://www.roseindia.net
Servlets and Jsp - JDBC
Servlets and Jsp  Sir I am getting Nullpointer exception in netbeans ,while running this program. Please help me. http://www.roseindia.net/mysql/select-box.shtml
servlets - JSP-Servlet
servlets  i want to write a simple program on servlet context listener.  Hi Friend, Please visit the following link: http://www.roseindia.net/servlets/ServletContextListener-example.shtml Hope
servlets - JSP-Servlet
/servlets/HowToRunAServlet.shtml Thanks
servlets - JSP-Servlet
servlets  I want to write a simple program on servlet context attribute listener.  Hi Friend, Please visit the following link: http://www.roseindia.net/servlets/ServletContextAttributeListener.shtml Hope
Servlets And Jsp - JDBC
Servlets And Jsp  Sir, I need a program for when i select the one of the field name of table,It has to display the table.Please anyone help me.I need this program fully
servlets execution - JSP-Servlet
servlets execution  the xml file is web.xml file in which the servlet name,servlet class,mapping etc which has to be done.   What u want...://www.roseindia.net/servlets/ Thanks. Amardeep
servlets execution - JSP-Servlet
servlets execution  hi friends, i wanted to know how to compile and run a servlet which has got an html file with it. this html file..., To visit this link for solving the problem: http://www.roseindia.net/servlets
Servlets and Jsp - JDBC
Servlets and Jsp  Sir How to perform the insert for the specified input and remaining fields must be select the values automatically.  Hi Friend, Please clarify your question. Thanks  first you post
Servlets and Jsp - JDBC
Servlets and Jsp  Sir I have seven fields like Matcode ,Matname,Type,Min value,Max Value and Fixed value.Type I have set as dropdownlistbox ,When...,Min value ,Otherfields has to be set as zero.How can i do this in servlets
servlets - JSP-Servlet
servlets  Hello, I am newbie to servlets. Today, i installed the j2ee sdk. How to compile and run a servlet? i dont wanna use apache or any other server. by defult glssfish eenterprise server was installed along with the j2ee
Servlets - JSP-Servlet
visit the following link: http://www.roseindia.net/servlets
servlets And Jsp - JDBC
servlets And Jsp  Sir, I did updation,deletion and addition, I had taken the program from roseindia web site.http://www.roseindia.net/servlets/multiplemenu.shtml. I did this program.I have included the codings for displaying
servlets execution - JSP-Servlet
servlets execution  hello friend, thanks for the reply.. the link which u `ve provided contains the hello world program which has got html embedded...-linuxproject.blogspot.com/2007/10/running-servlets-on-windows-xp.html u simply provide path name
servlets - JSP-Servlet
servlets link , read more and more information about servlet. how to compile and how to run servlets program.This is running program but you are not able... at : http://www.roseindia.net/servlets/ Thanks
java servlets - JSP-Servlet
java servlets  how to get the parameter value of input type file using java servlets  Hi, You can use request.getParameter(). In Jsp, --- --- IN servlet, String fileName=request.getParameter('fl'); If you
servlets - JSP-Servlet
servlets  how to generate reports in servelts pls tell me from first onwards i.e., i don't know about reports only i know upto servlets... link: http://www.roseindia.net/servlets/index.shtml Thanks
Doubt in servlets - JSP-Servlet
the following link: http://www.roseindia.net/servlets/index.shtml Thanks
how to execute jsp and servlets with eclipse
how to execute jsp and servlets with eclipse  hi kindly tell me how to execute jsp or servlets with the help of eclipse with some small program... http://www.roseindia.net/jsp/crud-application.shtml This will help you in how
servlets DD file - JSP-Servlet
servlets DD file  how many DD files can we possibly have in our servlets project
why business logic in servlets - JSP-Interview Questions
why business logic in servlets  why business logic written using servlets not in jsp. Jsp used for presentation purpose. serlvet used for coding business logic and controller logic. Reason for using servlets in business logic
which should be learned 1st, either servlets or jsp??
which should be learned 1st, either servlets or jsp??  which should be learned 1st either servlets or jsp??? help me out asap plz
Using Servlets, JSP for Online Shopping
Using Servlets, JSP for Online Shopping  What is wrong with my code ? JSP <form action="LoginServlet "method="post" > <table> <tr ><td>Username:</td><td><input type="text" name="Id
courier management service (using servlets,jsp,jdbc)
courier management service (using servlets,jsp,jdbc)   is anyone having information about courier management service ? plz share it .its urgent THANKING YOU IN ADVANCE
Creating methods in servlets - JSP-Servlet
Creating methods in servlets  I created servlet and jsp file.I... --%> JSP Page... mistake and check it : 1.In the JSP page having a "Form" Tag You have
Register page using servlets,jsp and java beans
Register page using servlets,jsp and java beans  i want code for register page using jsp,serlets and java beans.iam getting error for my code in java...: http://www.roseindia.net/jsp/javascriptpagerefresh.shtml http

Ads