This is a discussion on Advantages of JSP over servlets within the Java Server Pages (JSP) forums, part of the Web Development category; Can anyone tell me war are all the advantages of JSP over servlets...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi Lavanya, Java Server Pages (JSP) is basically Sun's answer to Microsoft's Active Server Pages (ASP). They work in very similar ways. ASP allows for VBScript, JScript, or PerlScript code to be placed in between sections of HTML. JSP does the exact same thing only using Java as the language of choice. Both ASP and JSP combine the design (HTML) and the code (ASP or JSP) in the same file. Java Servlets are a Java equivalent of a CGI script. Like CGI it can generate HTML, but it does not allow for HTML to live in "raw" form within the program. Servlets can be used to process a set of instructions and then return the values that were created by the Servlet. JSP also supports "Tag Libraries" These are simple tags that you embed in your JSP, which execute java code that is stored in a separate class. This allows you to keep your keep complex page logic encapsulated in separate classes, while keeping your JSP pages "clean", and free of java code. By doing this, you keep the page design in the JSP, and the page logic elsewhere. This makes it easier to develop and maintain your pages. In addition to writing your own tag libraries, you can also obtain free open-source tag libraries to perform various functions. Hope informative,, |
| |||
| Hi lavanya, * vs. Active Server Pages (ASP). ASP is a similar technology from Microsoft. The advantages of JSP are twofold. First, the dynamic part is written in Java, not Visual Basic or other MS-specific language, so it is more powerful and easier to use. Second, it is portable to other operating systems and non-Microsoft Web servers. * vs. Pure Servlets. JSP doesn't give you anything that you couldn't in principle do with a servlet. But it is more convenient to write (and to modify!) regular HTML than to have a zillion println statements that generate the HTML. Plus, by separating the look from the content you can put different people on different tasks: your Web page design experts can build the HTML, leaving places for your servlet programmers to insert the dynamic content. * vs. Server-Side Includes (SSI). SSI is a widely-supported technology for including externally-defined pieces into a static Web page. JSP is better because it lets you use servlets instead of a separate program to generate that dynamic part. Besides, SSI is really only intended for simple inclusions, not for "real" programs that use form data, make database connections, and the like. * vs. JavaScript. JavaScript can generate HTML dynamically on the client. This is a useful capability, but only handles situations where the dynamic information is based on the client's environment. With the exception of cookies, HTTP and form submission data is not available to JavaScript. And, since it runs on the client, JavaScript can't access server-side resources like databases, catalogs, pricing information, and the like. * vs. Static HTML. Regular HTML, of course, cannot contain dynamic information. JSP is so easy and convenient that it is quite feasible to augment HTML pages that only benefit marginally by the insertion of small amounts of dynamic data. Previously, the cost of using dynamic data would preclude its use in all but the most valuable instances.
__________________ The OXYGEN Delivers edgy, intelligent Technology to all... |
| |||
| each jsp is automatically converted to servlet while executing. advantages are.. in servlet we have to put all html code in printwriter.println() statement whrer its not needed in jsp which increses the ease of progeramming.... we can call a servelt from a jsp.... |
| |||
| 1. Using jsp we can easily embeded the html coding. -------------------------------------------------- for exmple we need to build a table using servlet ou.println("<table>"); ou.println("<tr>"); ou.println("<td"); ou.println("User Name"); ou.println("</td>"); ou.println("<td"); ou.println("Kamala Kannan"); ou.println("</td>"); ou.println("</tr>"); ou.println("<tr>"); ou.println("<td"); ou.println("Password"); ou.println("</td>"); ou.println("<td"); ou.println("kannan"); ou.println("</td>"); ou.println("</tr"); ou.println("</table>"); but this can easily write in JSP <table width="31%" border="1"> <tr> <td width="35%">User Name</td> <td width="65%">Kamala Kannan</td> </tr> <tr> <td>Password</td> <td>kannan</td> </tr> </table> in jsp iits very easy to find bugs in html and java coding to 2.easy to deployment ---------------------- a.a servlets must be compiled before deploy into application b.after compiled the class file must be placed into WEB_INF/clasess folder if we need find hundreds of bugs, thats not possible every time compile and deploy the class file into the application 3.There is no other difrents bcoz every JSP pages compiled into servlets |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| servlets | swoosh | Java Server Pages (JSP) | 4 | 08-29-2007 05:36 AM |
| Advantages of VB.NET? | anbuchezhians | VB.NET Programming | 4 | 08-20-2007 11:19 PM |
| What is the use of Servlets ? | oxygen | Java Programming | 3 | 08-06-2007 11:59 PM |
| Advantages of 80 Pin Ide Bus | itbarota | Computer Hardware | 0 | 08-06-2007 09:35 AM |
| What are advantages of SQL 2000 over SQl 7.0 ? | sundarraja | Database Support | 2 | 08-02-2007 02:51 AM |