The View: -JSP Pages & Presentation Components

The View: -JSP Pages & Presentation Components

Previous Home Next

 

JavaServer Pages (JSP) technology is used to make the View portion of a Struts-based application.
View serves as the screen representation of the model .It present the current state of the data object.


 Struts HTML/JSP View layer support can be broken down into the following major components:- >>JSP page >>Form Beans >>JSP tag libraries includes Struts include an extensive custom tag library that facilitates creating user interfaces that are fully internationalized. These are :-
1. The HTML Tag Library.
2.The Bean Tag Library.
3. The Logic Tag Library.
4.The Nested Tag Library.
Resource bundles In this tutorial provide the information of view in the struts1.3 framework. The view portion are written in JSP,Velocity,etc. The view provide the presentation logic of this MVC pattern. The following format provide the example of view:-

success.jsp


<%@taglib uri=
"http://struts.apache.org/tags-bean" prefix="bean"%> UserName:-<bean:write name="helloForm" property="userName"/><br/> UserDOB:-<bean:write name="helloForm" property="userDOB"/><br/> UserCourse:-<bean:write name="helloForm" property="userCourse"/><br/> UserCity:-<bean:write name="helloForm" property="userCity"/><br/> UserState:-<bean:write name="helloForm" property="userState"/><br/> UserCountry:-<bean:write name="helloForm" property="userCountry"/><br/> UserPhone:-<bean:write name="helloForm" property="userPhone"/>


index.jsp

<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>

<html:form action="helloAction">
User Name:-<html:text property="userName"/><br/>
User Date Of Birth:-<html:text property="userDOB"/><br/>
User Course:-<html:text property="userCourse"/><br/>
User City:-<html:text property="userCity"/><br/>
User State:-<html:text property="userState"/><br/>
User Country:-<html:text property="userCountry"/><br/>
User Phone:-<html:text property="userPhone"/><br/>
<html:submit></html:submit>
</html:form>



Previous Home Next