• Embed Doc
  • Readcast
  • Collections
  • 1
    CommentGo Back
 
What is Struts?
Struts Frame work is the implementation of Model-View-Controller (MVC) design patternfor the JSP. Struts is maintained as a part of Apache Jakarta project and is open source.Struts Framework is suited for the application of any size. Latest version of struts can bedownloaded fromhttp://jakarta.apache.org/. We are using jakarta-struts-1.1 and jakarta-tomcat-5.0.4 for this tutorial.
What is Model-View-Controller (MVC) Architecture?
Model-View-Controller architecture is all about dividing application components intothree different categories Model, View and the Controller. Components of the MVCarchitecture has unique responsibility and each component is independent of the other component. Changes in one component will have no or less impact on other component. Responsibilities of the components are:
Model:
Model is responsible for providing the data from thedatabaseand saving the data into the data store. All the business logic are implemented in theModel. Data entered by the user through View are check in the model before saving intothe database. Data access, Data validation and the data saving logic are part of Model.
View:
View represents the user view of the application and is responsible for takingthe input from the user, dispatching the request to the controller and then receivingresponse from the controller and displaying the result to the user. HTML, JSPs, Custom Tag Libraries and Resources files are the part of view component.
Controller:
Controller is intermediary between Model and View. Controller isresponsible for receiving the request from client. Once request is received from client itexecutes the appropriate business logic from the Model and then produce the output tothe user using the View component. ActionServlet, Action, ActionForm and struts-config.xml are the part of Controller.1.Java Server Pages or JSP for short is Sun's solution for developing dynamic websites. JSP provide excellent server side scripting support for creatingdatabasedriven web applications. 2.
JavaServer Pages (JSP)technologyis the Java platform technology for deliveringdynamic content to web clients in a portable, secure and well-defined way.
 
1.JPS pages are high level extension of servlet and it enable the developers to embed java code in html pages. JSP files are finally compiled into a servlet by the JSPengine. Compiled servlet is used by the engine to serve the requests.<%@directive attribute="value" %>Wheredirectivemay be:1. page: page is used to provide the information about it.Example:<%@page language=" java" %>  2.include: include is used to include a file in the JSP page.Example:<%@ include file="/header.jsp" %> 3.taglib: taglib is used to use thecustom tagsin the JSP pages (custom tags allows us to defined our own tags).Example:<%@ taglib uri="tlds/taglib.tld" prefix="mytag" %> 
 
andattributemay be:1.language="java"This tells theserver that the page is using the java language. Current JSP specification supports only java language.Example:<%@page language="java" %> 2.extends="mypackage.myclass"This attribute is used when we want to extend any class. We can use comma(,) toimport more than one packages.Example:<%@page language="java" import="java.sql.*,mypackage.myclass"%> 3.session="true"When this value is true session data is available to the JSP page otherwise not. Bydefault this value is true.Example:<%@page language="java" session="true" %> 4.errorPage="error.jsp"errorPage is used to handle the un-handled exceptions in the page.Example:<%@page language="java" session="true" errorPage="error.jsp" %> 5.contentType="text/html;charset=ISO-8859-1"Use this attribute to set the mime type and character set of the JSP.Example:<%@page language="java" session="true"contentType="text/html;charset=ISO-8859-1" %> 1.
Scriplets
In this tag we can insert any amount of valid java code and these codes are placedin _ 
 jspService
method by the JSP engine. 2.
Expressions
We can use this tag to output any data on the generated page. These data areautomatically converted to string and printed on the output stream. 
What is JSP Actions?
Servlet container provides many built in functionality to ease the development of theapplications.Programmers
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...

Hi karthi i want Jsp syntax book .....

You must be to leave a comment.
Submit
Characters: ...