Results 1 to 4 of 4

Thread: Which Technology is best, servlets or JSP?

  1. #1
    Join Date
    Feb 2009
    Posts
    62

    Which Technology is best, servlets or JSP?

    Hi,

    Can Anyone Suggest which of the Two technology i.e Servlet or JSP is best when I wanted to upload my pages on the Web, Even though both the technology serves the same purpose on the web, but I have intuition that there will be some points which makes them different from each other, so please help me in understanding the difference between both.

    Regards,

  2. #2
    Join Date
    Dec 2008
    Posts
    202

    Re: Which Technology is best, servlets or JSP?

    Servlets tend to be better at providing validation for HTTP requests, interpreting the request parameters and directing the outcome of the interaction. JSP are a good way of providing fairly static, template-style character output for Web applications that include some programming logic.

  3. #3
    Join Date
    Jan 2006
    Posts
    211

    Re: Which Technology is best, servlets or JSP?

    JSPs are compiled to servlets, effectively allowing you to produce a servlet by just writing the HTML page, without knowing Java. Of course, in practice, to get anything serious done, you need to use some server-side code in there...

    If you write servlets, you need to know Java to write the servlet body, and HTML to write the output.

    The real advantage of JSP is the use of special tags that allow you to call Java beans directly, and the ability to produce your own custom tags (in Java) to do stuff that you can't do with a single call to a Java bean (e.g. inserting a list of items into the HTML, which needs a loop construct).

    The idea of JSP is that a development house can put a team of specialists onto developing their web applications. A HTML web page writer/designer can write the JSP without knowing Java, using beans and custom tags written by Java experts.

    Unfortunately, custom tags are a bit tedious to produce, and for very simple stuff, like simple loops, or stuff that's unlikely to get re-used, they can seem like overkill.

    So JSP allows you to put real Java directly into the HTML inside special tags.

    All this Java code will be executed before the HTML is sent to the client, and is generally used to modify the HTML page.

    Ironically, individuals producing JSP applications on their own often end up with a JSP containing HTML, JavaScript, and Java all in the one file, which can be a little confusing, especially with all the JSP tags scattered around!

  4. #4
    Join Date
    Dec 2008
    Posts
    183

    Re: Which Technology is best, servlets or JSP?

    Servlets and Java Server Pages are complementary APIs, both providing a means for generating dynamic Web content,The advantage of Java Server Pages is that they are document-centric. Servlets, on the other hand, look and act like programs. A Java Server Page can contain Java program fragments that instantiate and execute Java classes, but these occur inside an HTML template file and are primarily used to generate dynamic content.

Similar Threads

  1. Sessions with Java Servlets
    By Sheenas in forum Software Development
    Replies: 5
    Last Post: 15-02-2010, 08:15 PM
  2. Java Beans Vs Servlets
    By Ram Bharose in forum Software Development
    Replies: 5
    Last Post: 02-02-2010, 11:53 AM
  3. What are the advantages of java servlets over JSP?
    By Mithun Seth in forum Software Development
    Replies: 5
    Last Post: 23-01-2010, 01:21 PM
  4. What are the advantages of the servlets?
    By Sheenas in forum Software Development
    Replies: 3
    Last Post: 01-12-2009, 02:56 PM
  5. How to use Java Servlets
    By Wyvern in forum Software Development
    Replies: 3
    Last Post: 24-10-2009, 06:24 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,544,829.25180 seconds with 17 queries