Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-08-2007, 10:18 AM
Member
 
Join Date: Nov 2007
Posts: 97
javaplus is on a distinguished road
Servlet vs JSP
I am exploring J2EE. I have basic knowledge of JSP and Servlets but I am confused when to use what. What I know is, what we can do iwit JSP, can also be done with Servlets. So when to use what?

Is there any performance issue related?

Thanks in advance.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-26-2007, 07:52 PM
Member
 
Join Date: Nov 2007
Posts: 2
Shahid is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-03-2007, 04:23 PM
Member
 
Join Date: Jun 2007
Location: Bali, ID
Posts: 92
wsaryada is on a distinguished road
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:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Blog:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 10:20 AM
freddieMaize's Avatar
Member
 
Join Date: Apr 2008
Location: Bangalore,India
Posts: 55
freddieMaize is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 10:28 AM
Member
 
Join Date: Apr 2008
Posts: 91
javarishi is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 06-26-2008, 10:21 PM
Member
 
Join Date: Jun 2008
Posts: 13
weiwei is on a distinguished road
新加的空白文章1
这是新加的空白文章1,可以在UBB可视化编辑器中,添加和修改文章内容。
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 06-26-2008, 11:19 PM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 134
fishtoprecords is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
my first servlet sireesha Java Servlet 4 Today 06:54 AM
Regarding Servlet Sudha New To Java 1 02-12-2008 01:44 AM
JSP or Servlet ravian JavaServer Pages (JSP) and JSTL 4 12-03-2007 04:00 PM
How to mix servlet & JSP Swamipsn Java Servlet 1 08-08-2007 01:57 AM
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2 osval Advanced Java 1 08-07-2007 04:47 PM


All times are GMT +3. The time now is 01:23 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org