The Struts2.0 View: -JSP Pages & Presentation Components

The Struts2.0 View: -JSP Pages & Presentation Components

Previous Home Next

 

The view is the presentation component of the MVC pattern. we see that the result returns the page to the web browser. This page is represent the user interface application’s state. These are commonly JSP pages, Velocity templates, or some other presentation-layer technology .While there are many choices for the view, the role of the view is clear-cut: it translates the state of the application into a visual presentation with which the user can interact .With rich clients and Ajax applications increasingly complicating the details of the view, it becomes even more important to have clean MVC separation of concerns. Good MVC lays the groundwork for easily managing the most complex front end.

 
Struts HTML/JSP View layer support can be broken down into the following major components:- 
  • JSP page 
  • Form Beans 
  • JSP tag libraries includes 
  • Struts2 include an extensive custom tag library that facilitates creating user interfaces that are fully internationalized. 

<%@ taglib uri="/struts-tags" prefix="s"%>
<table cellpadding="0" cellspacing="0">
<tr><td height="300" width="300" style="background-image: url('images/2.JPG');color: yellow;" align="center">
<h1 style="color: yellow;">Login Page</h1>
<s:actionerror/>
<s:form action="login" cssStyle="color:yellow;">
<s:textfield name="name" label="Name"/>
<s:password name="password" label="Password"/>
<s:submit value="Login"/>
</s:form></td></tr></table>


Previous Home Next