1 / 14

JAVA SERVER PAGES

JAVA SERVER PAGES. -by Rubeena Memon Deepti Jain Jaya Thakar Jisha Vettuventra. What is JSP?. JSP is a technology used to generate dynamic HTML on the server side. It lets you separate the dynamic part of your pages from the static HTML.

cstainbrook
Download Presentation

JAVA SERVER PAGES

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JAVA SERVER PAGES -by Rubeena Memon Deepti Jain Jaya Thakar Jisha Vettuventra

  2. What is JSP? • JSP is a technology used to generate dynamic HTML on the server side. • It lets you separate the dynamic part of your pages from the static HTML. • You simply write the regular HTML in the normal manner, using whatever Web-page-building tools you normally use.

  3. (Contd.) • You then enclose the code for the dynamic parts in special tags, most of which start with "<%" and end with "%>". • Although what you write often looks more like a regular HTML file than a servlet, behind the scenes, the JSP page just gets converted to a normal servlet, with the static HTML simply being printed to the output stream associated with the servlet's service method.

  4. Types of JSP Constructs • Aside from the regular HTML, there are three main types of JSP constructs that you embed in a page: . • Scripting elements :They let you specify Java code that will become part of the resultant servlet. • Directives :lets you control the overall structure of the servlet.

  5. Steps of JSP Requests • Client Requests a JSP Page. • The JSP engine compiles the JSP into a servlet • The generated servlet is compiled and loaded. • The compiled servlet services the request and sends a response back to the client.

  6. (Contd.) • Actions let you specify existing components that should be used, and otherwise control the behavior of the JSP engine

  7. Syntax Summary • JSP Expression <%= expression %> • JSP scriptlet <% code %> • JSP Declaration <% ! code %> • JSP page Directive <%@ page att=“val” %> • JSP include Directive<%@ include file =“url” %> • JSP Comment <% -- comment --%>

  8. (Contd.) • The jsp:include Action <jsp:include page="relative URL flush="true"/> • The jsp:useBean Action <jsp:useBean att=val*/> or <jsp:useBean att=val*/> • The jsp:setProperty Action <jsp:setProperty att=val*/>

  9. (Contd.) • The jsp:getProperty Action <jsp:getProperty name=“idName”> • The jsp:forward Action <jsp:forward page="relative URL"/>

  10. Advantages of JSP • vs. ASP: ASP is a similar technology from Microsoft. In JSP, 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.

  11. Vs. Servlets • JSP doesn't give you anything that you couldn't in principle do with a servlet. But it is more convenient to write 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.

  12. Vs. Javascript • JavaScript can generate HTML dynamically on the client. It only handles situations where the dynamic information is based on the client's environment. Since it runs on the client. JavaScript can't access server-side resources like databases, catalogs, pricing information, and the like.

  13. Project Overview • Aim: Generating students mess bills. • Interfaces: • Student Interface : View Mess Bill • View Balance in Bank • After Authentication , • Mess Manager’s Interface : • Compute Bills

  14. Mess Manager’s Interface(contd.) • Display Bills (With or Without Details) • Update Bills • Record Expenditure • Display Expenditure • Display Fines

More Related