Java Server Pages or JSP for short is Sun’s solution for developing dynamic web sites. JSP provide excellent server side scripting support for creating database driven web applications. JSP enable the developers to directly insert java code into jsp file, this makes the development process very simple and its maintenance also becomes very easy. JSP pages are efficient, it loads into the web servers memory on receiving the request very first time and the subsequent calls are served within a very short period of time. In today’s environment most web sites servers dynamic pages based on user request. Database is very convenient way to store the data of users and other things. JDBC provide excellent database connectivity in heterogeneous database environment. Using JSP and JDBC its very easy to develop database driven web application. Java is known for its characteristic of “write once, run anywhere.” JSP pages are platform independent. Your port your .jsp pages to any platform.
First of all download JavaServer Web Development Kit (JSWDK1.0.1) from http://java.sun.com/products/servlet/download.html. JSWDK comes with full documentation and it’s very easy to install, so the installation process is not mentioned here. The JSWDK is the official reference implementation of the servlet 2.1 and JSP 1.0 specifications. It is used as a small stand-alone server for testing servlets and JSP pages before they are deployed to a full Web server that supports these technologies. It is free and reliable, but takes quite a bit of effort to install and configure.
Other Servers that support JSP
• Apache Tomcat.
Tomcat is the official reference implementation of the servlet 2.2 and JSP 1.1 specifications. It can be used as a small stand-alone server for testing servlets and JSP pages, or can be integrated into the Apache Web server.
• Allaire JRun.
JRun is a servlet and JSP engine that can be plugged into Netscape Enterprise or FastTrack servers, IIS, Microsoft Personal Web Server, older versions of Apache, O?Reilly?s WebSite, or StarNine WebSTAR.
• New Atlanta?s ServletExec.
ServletExec is a fast servlet and JSP engine that can be plugged into most popular Web servers for Solaris, Windows, MacOS, HP-UX and Linux. You can download and use it for free, but many of the advanced features and administration utilities are disabled until you purchase a license. • Gefion’s LiteWebServer (LWS). LWS is a small free Web server that supports servlets version 2.2 and JSP 1.1. • GNU JSP. free, open source engine that can be installed on apache web server. • PolyJSP. PolyJsp is based on XML/XSL and has been designed to be extensible. Now supports WebL • JRUN. Available for IIS server.
• WebSphere. IBM’s WebSphere very large application server now implements JSP.
Developing first JSP
Java Server Pages are save with .jsp extension. Following code which generates a simple html page.
Execute the example.
First JSP page.
In jsp java codes are written between ” tags. So it takes the following form : In this example we have use
Tutorials – Java Server Pages Technology
JavaServer Pages (JSP) technology is the Java platform technology for delivering dynamic content to web clients in a portable, secure and well-defined way.
Java Server Pages
Java Server Pages (JSP) technology is the Java platform technology for delivering dynamic content to web clients in a portable, secure and well-defined way. The Java Server Pages specification extends the Java Servlet API to provide web application developers with a robust framework for creating dynamic web content on the server using HTML, and XML templates, and Java code, which is secure, fast, and independent of server platforms. JSP has been built on top of the Servlet API and utilizes Servlet semantics. JSP has become the preferred request handler and response mechanism. Although JSP technology is going to be a powerful successor to basic Servlets, they have an evolutionary relationship and can be used in a cooperative and complementary manner. Servlets are powerful and sometimes they are a bit cumbersome when it comes to generating complex HTML. Most Servlets contain a little code that handles application logic and a lot more code that handles output formatting. This can make it difficult to separate and reuse portions of the code when a different output format is needed. For these reasons, web application developers turn towards JSP as their preferred Servlet environment.
Evolution of Web Applications
Over the last few years, web server applications have evolved from static to dynamic applications. This evolution became necessary due to some deficiencies in earlier web site design. For example, to put more of business processes on the web, whether in business-to-consumer (B2C) or business-to-business (B2B) markets, conventional web site design technologies are not enough. The main issues, every developer faces when developing web applications, are: 1. Scalability – a successful site will have more users and as the number of users is increasing fastly, the web applications have to scale correspondingly. 2. Integration of data and business logic – the web is just another way to conduct business, and so it should be able to use the same middle-tier and data-access code.
3. Manageability – web sites just keep getting bigger and we need some viable mechanism to manage the ever-increasing content and its interaction with business systems. 4. Personalization – adding a personal touch to the web page becomes an essential factor to keep our customer coming back again. Knowing their preferences, allowing them to configure the information they view, remembering their past transactions or frequent search keywords are all important in providing feedback and interaction from what is otherwise a fairly one-sided conversation. Apart from these general needs for a business-oriented web site, the necessity for new technologies to create robust, dynamic and compact server-side web applications has been realized. The main characteristics of today’s dynamic web server applications are as follows: 1. Serve HTML and XML, and stream data to the web client
2. Separate presentation, logic and data
3. Interface to databases, other Java applications, CORBA, directory and mail services 4. Make use of application server middleware to provide transactional support. 5. Track client sessions Now let us have a look on the role of Java technology and platform in this regard.
Java’s Role for Server Applications Sun Microsystems, having consulted many expert partners from other related IT industries, has come out with a number of open APIs for the technologies and services on server side. This collection of APIs is named as Java 2 Enterprise Edition (J2EE). The J2EE specification provides a platform for enterprise applications, with full API support for enterprise code and guarantees of portability between server implementations. Also it brings a clear division between code which deals with presentation, business logic and data.
The J2EE specification meets the needs of web applications because it provides: 1. Rich interaction with a web server via Servlets and built-in support for sessions available in both Servlets and EJBs. 2. The use of EJBs to mirror the user interaction with data by providing automatic session and transaction support to EJBs operating in the EJB server. 3. Entity EJBs to represent data as an object and seamless integration with the Java data access APIs 4. Flexible template-based output using JSP and XML
This family of APIs mean that the final web page can be generated from a user input request, which was processed by a servlet or JSP and a session EJB, which represents the user’s session with the server, using data extracted from a database and put into an entity EJB. Thus, the Java revolution of portable code and open APIs is married with an evolution in existing products such as database, application, mail and web servers. The wide availability of products to run Java applications on the server has made this a fast-moving and very competitive market, but the essential compatibility through specifications, standard APIs and class libraries has held. This makes server-side Java a very exciting area.
Java Server Pages – An Overview
The Java Server Pages 1.2 specification provides web developers with a framework to build applications containing dynamic web content such as HTML, DHTML, XHTML and XML. A JSP page is a text based document containing static HTML and dynamic actions which describe how to process a response to the client in a more powerful and flexible manner. Most of a JSP file is plain HTML but it also has, interspersed with it, special JSP tags. There are many JSP tags such as:
• JSP directive denoted by
Courtney from Study Moose
Hi there, would you like to get such a paper? How about receiving a customized one? Check it out https://goo.gl/3TYhaX