Results 1 to 6 of 6
Thread: Servlet vs JSP
- 11-08-2007, 09:18 AM #1
Member
- Join Date
- Nov 2007
- Posts
- 97
- Rep Power
- 0
- 11-26-2007, 06:52 PM #2
Member
- Join Date
- Nov 2007
- Posts
- 2
- Rep Power
- 0
JSP allows you to embed java code in the HTML.thus, u can create the webpage using the HTML coding and use java code to handle the logic wherever required.
Servlet doesnt allow u to embed java code in the HTML. Servlet is saved as a separate file, and can be accessed from the HTML document.
- 12-03-2007, 03:23 PM #3
Senior Member
- Join Date
- Jun 2007
- Location
- Bali, Indonesia
- Posts
- 696
- Rep Power
- 6
For the basic rule use JSP for the presentation layer where the data should be displayed and it will look, etc. And the servlet is use for a controller to your web application, take a request from user; for instance a JSP page; get the submitted data and save it to the database.
Website: Learn Java by Examples
- 04-09-2008, 09:20 AM #4
hi,
jsp page wen compiled, ll become a servlet only.. and in servlet also u can embed html codes...
use jsp for design
and servlet for bussiness logic......
regards
- 04-09-2008, 09:28 AM #5
Member
- Join Date
- Apr 2008
- Posts
- 91
- Rep Power
- 0
Hei,
Both JSP And Servlet Are ServerSide Components For Serving
Http Requests. But The Purpose Is Defferent.
Use Jsp Wherever you want to display some data to User as
UserInterface. jsp will be used for presentation logic.
Servlet Can Be Used To Implement Controller Logic. That Is to
implement the request-response flow scenarios in your application.
- 06-26-2008, 10:19 PM #6
Servlets came first. They are just java classes that inherit from some useful base classes can can easily read parameters from a GET/POST command and can write a response to the user/client's browser.
JSP is a way to have something look mostly like HTML interact with servlets.
Anything you can do with JSP pages, you can do by hand with servlets. But JSP makes it easier, and you can use WYSIWYG tools like Dreamweaver to make a jsp page.
And you don't need J2EE all all its evil overhead to use jsp pages and servlets.
Similar Threads
-
my first servlet
By sireesha in forum Java ServletReplies: 3Last Post: 04-09-2008, 03:11 PM -
Regarding Servlet
By Sudha in forum New To JavaReplies: 1Last Post: 02-12-2008, 12:44 AM -
JSP or Servlet
By ravian in forum JavaServer Pages (JSP) and JSTLReplies: 4Last Post: 12-03-2007, 03:00 PM -
How to mix servlet & JSP
By Swamipsn in forum Java ServletReplies: 1Last Post: 08-08-2007, 12:57 AM -
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2
By osval in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 03:47 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks