|
|
Java Server
Pages (JSP) Programming
Like most of our other technologies, JSP lets developers create dynamic HTML or XML pages that combine static page elements with dynamic content. This allows smart developers to separate the user bits like HTML from the logic bits, like the JSP code. JSP was created to simplify the Java Servlets technology, which we'll cover in a future article, and to be simpler than the other offerings, like CGI, available at the time of its creation.
So we understand that JSP is an extension of Java, for web pages, but what is it really about? For most people, that is Java's biggest appeal; that they can tie into existing Java elements, and therefore save a lot of development time.
JSP is based on components. It uses JavaBeans and Enterprise JavaBeans (EJB) components, which hold the business logic for an application, and it composes tags and a scripting platform for presenting the content generated and returned by the beans into HTML pages. The components structure means that non-Java developers can use JSP to manipulate beans that developers have built. On the other hand, Java developers can use these beans and Java in JSP pages for more advanced productions based on the beans.
What is really happening in this process? A user calls a JSP page through their browser, so Resin (for instance), located on the web server, converts JavaScript, JSP tags, and HTML into segments of Java code, which the engine then consequentially arranges into a core Java servlet. This core servlet is therefore pre-assembled and works 'behind the scenes'. It is called every time that particular page is requested by a user, saving valuable recompiling time. The next time a user calls that page from their browser, because the JSP code has already been compiled, it does not have to convert the JavaScript, HTML, etc each time. That is, the servlet engine needs only to produce that servlet once, or after the last code change was updated.
JSP uses a combination of XML and CFM-like tags, as well as scripts written in Java, to generate page content. Applications written to the JSP specification can be run on compliant web servers, and web servers such as Apache, Netscape Enterprise Server, and Microsoft IIS that have had Java support added.
Advantages
- Strong integration with JavaBeans and other elements
- Ease of use for experienced Java developers
- Rapid Application Development
- Scales well to heavy loads
- Cross-platform
- Open Source
Disadvantages
- JSP pages often run slower than similar pages such as PHP due to being more robust and intensive
- Steeper learning curve than many other technologies
|
|