Sunday, October 17, 2010

How to pass action parameter from jsf pages to Bean class


How to pass action parameter  from jsf pages to Bean class ?
1-<f:setPropertyActionListener >
   1-  it have only two attribute
     1) target
     2) value
   2-target attribute is used to set value in the backing bean .and value attribute is hold the value which       target used to set in the backing bean .
   3-this is work on the both action and actionListener case .



<h:form>
    <h:commandButton value="Submit" action="#{jsf.action}">
        <f:setPropertyActionListener target="#{jsf.name1}" value="value1" />
        <f:setPropertyActionListener target="#{jsf.name2}" value="value2" />
    </h:commandButton>
</h:form>



2-<f:attribute>
1-it also have two attribute
  1)name
  2)value
2-value is use to hold the value if you want to used this value then you can access using name .
3-This is work on the only actionListener .because using ActionEvent object we get the component and the we get attributes and then use the get method to take the value of attribute .

<h:form>
    <h:commandButton value="Submit" actionListener="#{jsf.action}">
        <f:attribute name="#{jsf.name1}" value="value1" />
        <f:attribute name="#{jsf.name2}" value="value2" />
    </h:commandButton>
</h:form>
3-<f:param>
1-it is work on the and .
2-it content following attribute
     1-name
     2-value
3-and it's work on the action and actionListener
<h:form>
    <h:commandLink value="Submit" actionListener="#{jsf.action}">
        <f:param name="#{jsf.name1}" value="value1" />
        <f:param name="#{jsf.name2}" value="value2" />
    </h:commandLink>
</h:form>



Friday, October 15, 2010

Jsf LIfe Cycle :

Jsf Life Cycle :
1-like servlet and jsp, jsf also have life cycle .jsf life cycle is divided into six part .if you are beginner in jsf then it paramount to learrn the jsf life cycle in depth .life cycle is vital of the jsf .here i going to explain the jsf life cycle in the depth.
2-A JavaServer Faces page is represented by a tree of UI components, called a view. When a client makes a request for the page, the life cycle starts. During the life cycle, the JavaServer Faces implementation must build the view while considering state saved from a previous submission of the page.
3-When the client submits a page, the JavaServer Faces implementation must perform following several tasks.
  1-create viewid and store state in FacesContext .
  2-assign user value in the UI component
  3-convert the user value and validate the value .

1-restore view
2-apply request value
3-process validation
4-update model value
5-invoke application
6-render response

1-Restore View :If the request is first time then it create new component tree .if the pages display already then set to their prior state.

UIViewRoot  is class who responsible to maintain the state .
package javax.faces.component;

public class UIViewRoot
    extends javax.faces.component.UIComponentBase
{
    //
    // Constructors
    //
    public UIViewRoot() { }

    //
    // Fields
    //
    public static final java.lang.String COMPONENT_TYPE;

    public static final java.lang.String COMPONENT_FAMILY;

    public static final java.lang.String UNIQUE_ID_PREFIX;

    private static javax.faces.lifecycle.Lifecycle lifecycle;

    private static final java.util.logging.Logger LOGGER;

    private int lastId;

    private boolean skipPhase;

    private boolean beforeMethodException;

    private java.util.ListIterator phaseListenerIterator;

    private java.lang.String renderKitId;

    private java.lang.String viewId;

    private javax.el.MethodExpression beforePhase;

    private javax.el.MethodExpression afterPhase;

    private java.util.List phaseListeners;

    private java.util.List events;

    private java.util.Locale locale;

    private java.lang.Object[] values;

    //
    // Methods
    //
    public java.lang.String getFamily() { }

    public java.lang.String getRenderKitId() { }

    public void setRenderKitId(java.lang.String p1) { }

    public java.lang.String getViewId() { }

    public void setViewId(java.lang.String p1) { }

    public javax.el.MethodExpression getBeforePhaseListener() { }

    public void setBeforePhaseListener(javax.el.MethodExpression p1) { }

    public javax.el.MethodExpression getAfterPhaseListener() { }

    public void setAfterPhaseListener(javax.el.MethodExpression p1) { }

    public void removePhaseListener(javax.faces.event.PhaseListener p1) { }

    public void addPhaseListener(javax.faces.event.PhaseListener p1) { }

    public void queueEvent(javax.faces.event.FacesEvent p1) { }

    private void broadcastEvents(javax.faces.context.FacesContext p1,

javax.faces.event.PhaseId p2) { }

    private void initState() { }

    private void notifyBefore(javax.faces.context.FacesContext p1,

javax.faces.event.PhaseId p2) { }

    private void notifyAfter(javax.faces.context.FacesContext p1,

javax.faces.event.PhaseId p2) { }

    public void processDecodes(javax.faces.context.FacesContext p1) { }

    public void encodeBegin(javax.faces.context.FacesContext p1) { }

    public void encodeEnd(javax.faces.context.FacesContext p1) { }

    private void notifyPhaseListeners(javax.faces.context.FacesContext p1,

javax.faces.event.PhaseId p2, boolean p3) { }

    private static javax.faces.event.PhaseEvent

createPhaseEvent(javax.faces.context.FacesContext p1, javax.faces.event.PhaseId p2) { }

    public void processValidators(javax.faces.context.FacesContext p1) { }

    public void processUpdates(javax.faces.context.FacesContext p1) { }

    public void processApplication(javax.faces.context.FacesContext p1) { }

    private void clearFacesEvents(javax.faces.context.FacesContext p1) { }

    public java.lang.String createUniqueId() { }

    public java.util.Locale getLocale() { }

    private static java.util.Locale getLocaleFromString(java.lang.String p1) { }

    private static int indexOfSet(java.lang.String p1, char[] p2, int p3) { }

    public void setLocale(java.util.Locale p1) { }

    public java.lang.Object saveState(javax.faces.context.FacesContext p1) { }

    public void restoreState(javax.faces.context.FacesContext p1, java.lang.Object p2) {

}
}
this phase is entry of the jsf life cycel and also maintain the state of component .
basically the view id is same as name of jsp page .suppose your jsp name hello.jsp then
the view id is /hello.jsp.

2-Apply Request value:
 1-in this phase fetch the parameter value from the request  scope and set in relevant components in the UIViewRoot.
  Example:outputText.setSubmittedValue("JSF");
2- the component tree is restored, each component in the tree extracts its new value from the request parameters by using its decode method.
3-The value is then stored locally on the component. If the conversion of the value fails, an error message associated with the component is generated and queued on FacesContext.
4- If any decode methods or event listeners called renderResponse on the current FacesContext instance, the JavaServer Faces implementation skips to the render response phase.
5-JavaServer Faces components, it can call FacesContext.responseComplete.
6-

3-Process Validations Phase 
1-During this phase, the JavaServer Faces implementation processes all validators registered on the components in the tree. It examines the component attributes that specify the rules for the validation and compares these rules to the local value stored for the component.
2-If the local value is invalid, the JavaServer Faces implementation adds an error message to the FacesContext instance, and the life cycle advances directly to the render response phase so that the page is rendered again with the error messages displayed. If there were conversion errors from the apply request values phase, the messages for these errors are also displayed.
3-If any validate methods or event listeners called renderResponse on the current FacesContext, the JavaServer Faces implementation skips to the render response phase.
4-At this point, if the application needs to redirect to a different web application resource or generate a response that does not contain any JavaServer Faces components, it can call FacesContext.responseComplete.
5-If events have been queued during this phase, the JavaServer Faces implementation broadcasts them to interested listeners.

4-Update Model Values Phase

1-After the JavaServer Faces implementation determines that the data is valid, it can walk the component tree and set the corresponding server-side object properties to the components' local values. The JavaServer Faces implementation will update only the bean properties pointed at by an input component's value attribute. If the local data cannot be converted to the types specified by the bean properties, the life cycle advances directly to the render response phase so that the page is rerendered with errors displayed. This is similar to what happens with validation errors.
2-If any updateModels methods or any listeners called renderResponse on the current FacesContext instance, the JavaServer Faces implementation skips to the render response phase.
3-At this point, if the application needs to redirect to a different web application resource or generate a response that does not contain any JavaServer Faces components, it can call FacesContext.responseComplete.
4-If events have been queued during this phase, the JavaServer Faces implementation broadcasts them to interested listeners.

5-Invoke Application Phase

1-During this phase, the JavaServer Faces implementation handles any application-level events, such as submitting a form or linking to another page.
2-At this point, if the application needs to redirect to a different web application resource or generate a response that does not contain any JavaServer Faces components, it can call FacesContext.responseComplete.
3-If the view being processed was reconstructed from state information from a previous request and if a component has fired an event, these events are broadcast to interested listeners.

6-Render Response Phase

1-During this phase, the JavaServer Faces implementation delegates authority for rendering the page to the JSP container if the application is using JSP pages. If this is an initial request, the components represented on the page will be added to the component tree as the JSP container executes the page. If this is not an initial request, the components are already added to the tree so they needn't be added again. In either case, the components will render themselves as the JSP container traverses the tags in the page.
2-If the request is a postback and errors were encountered during the apply request values phase, process validations phase, or update model values phase, the original page is rendered during this phase. If the pages contain message or messages tags, any queued error messages are displayed on the page.
3-After the content of the view is rendered, the state of the response is saved so that subsequent requests can access it and it is available to the restore view phase.

Request Processing Life Cycle Scenarios

A JavaServer Faces application supports two kinds of responses and two kinds of requests:
Faces response: A servlet response that was created by the execution of the Render Response Phase of the request processing life cycle.
Non-Faces response: A servlet response that was not created by the execution of the render response phase. An example is a JSP page that does not incorporate JavaServer Faces components.
Faces request: A servlet request that was sent from a previously generated Faces response. An example is a form submit from a JavaServer Faces user interface component, where the request URI identifies the JavaServer Faces component tree to use for processing the request.
Non-Faces request: A servlet request that was sent to an application component, such as a servlet or JSP page, rather than directed to a JavaServer Faces component tree.
These different requests and responses result in three possible life cycle scenarios that can exist for a JavaServer Faces application:
Scenario 1: Non-Faces Request Generates Faces Response
An example of this scenario occurs when clicking a hyperlink on an HTML page opens a JavaServer Faces page. To render a Faces response from a non-Faces request, an application must provide a mapping to FacesServlet, which accepts incoming requests and passes them to the life cycle implementation for processing. Identifying the Servlet for Life Cycle Processing describes how to provide a mapping to the FacesServlet. When generating a Faces response, the application must create a new view, store it in the FacesContext, acquire object references needed by the view, and call FacesContext.renderResponse, which forces immediate rendering of the view by skipping to the Render Response Phase.
Scenario 2: Faces Request Generates Non-Faces Response
Sometimes a JavaServer Faces application might need to redirect to a different web application resource or might need to generate a response that does not contain any JavaServer Faces components. In these situations, the developer must skip the rendering phase (Render Response Phase) by calling FacesContext.responseComplete. The FacesContext contains all the information associated with a particular Faces request. This method can be invoked during the Apply Request Values Phase, Process Validations Phase, or the Update Model Values Phase.
Scenario 3: Faces Request Generates Faces Response
This is the most common scenario for the life cycle of a JavaServer Faces application. It is also the scenario represented by the standard request processing life cycle described in the next section. This scenario involves a JavaServer Faces component submitting a request to a JavaServer Faces application utilizing the FacesServlet. Because the request has been handled by the JavaServer Faces implementation, no additional steps are required by the application to generate the response. All listeners, validators and converters will automatically be invoked during the appropriate phase of the standard life cycle, which the next section describes. 

How the jsf Life cycle is work in actual life ?

How the jsf Life cycle is work in actual life
Life cycle is consist of the six step .but main question is that .when the life cycle is start ?
the life cycle is depend on the request of user .the request is also divided into two part
1-initial request
2-post back
flow of the life cycle is depend on these request .

Initial request :
1-using the address of the jsf we call jsf pages .this type of the request is call initial request
2-When a user makes an initial request for a page, he or she is requesting the page for the first time.
3-If the request for the page is an initial request, the JavaServer Faces implementation creates an empty view during Restore View Phase phase and the life cycle advances to the render response phase. The empty view will be populated when the page is processed during a postback.
4-it only executes the restore view and render response phases because there is no user input or actions to process.
Post Request :
1-when user click on any link or button in jsf page this post request  created .
2-When a user executes a postback, he or she submits the form contained on a page that was previously loaded into the browser as a result of executing an initial request.
3-when the life cycle handles a postback, it executes all of the phases.
4-If the request for the page is a postback, a view corresponding to this page already exists. During this phase, the JavaServer Faces implementation restores the view by using the state information saved on the client or the server.

Thursday, October 14, 2010

Custom Validation Components

Custom Validation Components :


If you want validated  email ,zip code and other  type of validation which are dependent on the application then you should need to create the custom validation

Following step are depict the way of implementing  validation

1-First you create a class which should be implement the Validation interface
Description Of the Validator Interface
  Validator interface have only one method
  Name : public void validate(FacesContext arg0, UIComponent arg1, .Object arg2) throws javax.faces.validator.ValidatorException;
}
And this method have three argument which are following type
  1-FacesContext
  2-UIcomponent
  3-Object
public class ValidationExample implements Validator {

}
Step 2: Implement the validate method
the interface have one method so we should need to override this method
Pattern partten=Pattern.compile(number);
Matcher mat=partten.matcher(number);
if(mat.matches()){
}
else{
FacesMessage message=new FacesMessage();
message.setSeverity(FacesMessage.SEVERITY_ERROR);
message.setSummary("Value Should be number and also lenght should be 10");
message.setDetail("Value Should be number and also lenght should be 10");
throw new ValidatorException(message);
}
}

Step 3: Register your custom validator with the FacesContext
The code to register the custom validator with the FacesContext should look familiar to you by now.



<validator>
<validator-id>ValidationExample</validator-id>
<validator-class>ValidationExample</validator-class>
</validator>


Step 4: Use the tag in your JSPs

Custom Converters

Custom Converters :
This type of converter is base on the requirment of the application .if you want to convert any object in the basic of the application object then you should need to implement this way .you should follow these following step

1-fist create class which should be implement the Converter interface .
   Interface name:Converter
   package name :javax.faces.converter
   method description :
         this class have two method
                1-getAsObject()
                2-getAsString()

2-after first step implenment getAsobject .this method is responsible to convert the string(user in put value ) into any type of object(Application specific) .


3-implement the getAsString method which converts an object (application specific ) to string
4-then register this converter to faces-cofig.xml
5-the used this converter in your application using tag

when apply restore view execute then it called your implemented method getAsObject() .and convert user(your) input value which is string into the specified object .
and at last before render response phases it called the getAsStrign() method and convert specific type object into the string object .




Let Start with playing Code:
Step1:Create a class and Implement the Converter interface
public class ConvertClassWhichImplement implements Converter{
  .......
..........
}

Step 2: Implement the getAsObject method 
In this method i just create object of my bean class and assign the user value in this class
  public Object getAsObject(FacesContext faces,UIComponent ui,String value){
UserClass claseuser=new UserClass();
claseuser.setUserName(value);
System.out.println("ConvertClassWhichImplement"+value);
return claseuser;
}

Step 3: Implement the getAsString method:
in this method i just convert the application object to string .
public String getAsString(FacesContext facescontext,UIComponent uicompnent,Object value){
     return value.toString();
}

Step 4: Register custom converter with faces context:
This is a very importance step and we have two choice to impement this step
1-register our converter class with id like this.and used tag to call this conveter .

<converter>
<converter-id>convertbyuser</converter-id>
<converter-class>ConvertClassWhichImplement</converter-class>
</converter>
2-second way going to minimize your work littel bits .in this way you just need to bind convert to class .and also you do not need to used the .because it automatically figur out that this class is bind with this Converter like this
<converter>
<converter-for-class>UserClass</converter-for-class>
<converter-class>ConvertClassWhichImplement</converter-class>
</converter>


Step 5: Use the converter tag in your JSP
        yes friends this is last step .which show our whole work.This is for the first part of the fourth  phases
        1-<h:inputText value="#{userName.userclassvalue}" id="user1" >
<f:converter converterId="convertbyuser"/>
</h:inputText>

      2-This is for second

</h:outputLabel>
<h:inputText value="#{userName.userclassvalue}" id="user1" >
</h:inputText>

Wednesday, October 13, 2010

How to implement the encoding and decoding data ?

How to implement the encoding and decoding data ?
ANS: JSF provide the two way implement of these
direct implementation
delegated implementation
direct implement the component itself implement encoding and decoding
delegated implementation the component delegate to the renderer that does the encoding and decoding .this is not render specific.
JSF component consist of the two thinks
1-Component
2-Renderer
1-Component class used to define state and behavior of a UI component .
2-Renderer define how the component will be read form the request and how it will be displayed usually though HTML .

The jsf component model :


The jsf component model :
It have some type of properties and events just like the swing .jsf also have the containers  that contains components and that also are components that can be contained by other containers .
component functionality  typically combination of two part
1-decoding
2-encoding
Decoding is the process of converting incoming request parameters to the values of the components and encoding is the process in which convert the current value of components into corresponding markup  language that is html.

Jsf Validation

Jsf Validation:
In jsf the validation is divided in to four part
    1-built in validation components
    2-application-level validation
    3-custom validation components(this is achieve using the Validate interface )
    4-validation method in backing beans (inline)

1-Build in validation also called Standard validation
   1-DoubleRangeValidator
       1)value should be numeric
       2)range should be between minimum and maximum values
Example:
<h:inputText id="user3" >
<f:validateDoubleRange minimum="2" maximum="100"></f:validateDoubleRange>
<h:message for="user3"></h:message>
</h:inputText>
Error Message:Validation Error: Specified attribute is not between the expected values of 2 and 100.

     2-LongRangeValidator:
         1)valve(Local Value) must be numeric and belong to range of long
         2)must be in range specified by minimum and maximum values
Example:
<h:inputText id="user2" >
<f:validateLongRange minimum="2" maximum="100"></f:validateLongRange>
<h:message for="user2"></h:message>
</h:inputText>
Error Message: Validation Error: Specified attribute is not between the expected values of 2 and 100.
3-LenghtValidator: 
   1)type must be in range specified by minimum and maximum value
Example:
<h:inputText value="#{userName.userclassvalue}" id="user1" >
<f:validateLength maximum="4" minimum="2"> </f:validateLength>
<h:message for="user1"></h:message>
</h:inputText>
ErrorMessage:Validation Error: Value is less than allowable minimum of '2'
It also validate the type of data you insert .

DoubleRangeValidator is require the Numeric value
LongRangeValidator is require the numeric but should be between the long rang
LenghtValidator :this apply to check the length of string type 

Application level validation :Application level validation Is business level validation .validation shift from form level to the bean level (backing bean level ).if you want to check the credit card limit then on command button you need to add the action method ,and in this action method you check the value of the filed one the basic of the business requirement .
Example : in this example ,first I just create a method in my backing bean class and in this bean I am going to perform the validation logic . I just check the value of the input field. if it is null then show the errors message on the same pages .
Method code :
public String actionsubmit(){
FacesContext faces=FacesContext.getCurrentInstance();
Application app= faces.getApplication();
String inputvalue=(String) app.createValueBinding("#{ForValidation.name}").getValue(faces);
FacesMessage message=new FacesMessage();
message.setSeverity(FacesMessage.SEVERITY_ERROR);
message.setSummary("the field is blank which should not be");
message.setDetail("the field is blank which should not be");
if(a.equals("")){
faces.addMessage("val:field", message );
return somepage;
}
return otherpage;
}
Jsp code :
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>untitled4</title>
</head>
<body>
<h:form id="val">
<h:inputText value="#{ForValidation.name}" id="field">
</h:inputText>
<h:messages></h:messages>
<h:commandButton value="submit" action="#{ForValidation.actionsubmit}" ></h:commandButton>
</h:form>
</body>
</html>
</f:view>
</jsp:root>
Pros and cons of application level validation
Pros –
1-very easy to used
2-no need to be specified any tag on jsp pages
3-also no need to separate class for writing the code .
Cons –
1-called after the custom validation
2-not suitable for large application

Tuesday, October 12, 2010

How the immediate attribute work in jsf


Immediate in jSF :immediate is attribute of UIComponent it may be UICommand or  UIInput.
The main  used of the immediate is to interrupt the flow of the jsf life cycle .
This is vital prosperities  in jsf .
The biggest myth about the immediate is that it’s skip the Process Validation which is not totally true .
Life cycle :the life cycle of the jsf is divided into six following step

1-Restore view
2-apply request values
3-Process validation 
4-Update Model values
5-Invoake Application
6-Render Response

The main used of the immediate attribute to skip the some phases and also process phases before it’s normal flow .
First immediate have two state .it’s means it a Boolean .either true or false .by default it value is false .
Case 1:
What happen if we used the immediate attribute true on the command button or command link ?

by default the immediate is false in this situation it’s validate  all the current ui component before going to navigate to different pages .
to solve this problem define the immediate as true on the command button .in this case it escape all the validation on the component  and navigation you different pages . 

Code of simple.jsp is following 


<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html">
  <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
  <jsp:directive.page contentType="text/html;charset=UTF-8"/>
  <f:view>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>simpleonetwozeo</title>
      </head>
      <body>
        <h:form>
          <p>
            userName<h:inputText  value="#{backingbean.userName}"
                                 valueChangeListener="#{backingbean.valueString}"  >
            <f:validateLength maximum="5" minimum="2" >
                         </f:validateLength>
            </h:inputText>
          </p>
          <p>
            passWord<h:inputText  value="#{backingbean.passWord}">
            <f:validateLength maximum="5" minimum="3" >
                         </f:validateLength>
     </h:inputText>
          </p>
          <p>
            <h:commandButton value="Submit"
                             actionListener="#{backingbean.stringMethod}"
                             action="success"   immediate="true"  />
            <h:messages ></h:messages>
          </p>
        </h:form>
      </body>
    </html>
  </f:view>
</jsp:root>



Behind the screen :Here the only one  main aspect is that jsf skip the three phases and direct come on the render response phase  from the apply request values .
Apply request values   ----------------------------------------------------------------àRender Response

Case 2:what happened if you put immediate true on the UIInput component ?
In this situation the immediate true component are validated before normal component .so the validation message is less. And this case you are not able to call the action listener or action attribute of the command button .this just like make one or more input components high priority for validation .
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html">
  <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
  <jsp:directive.page contentType="text/html;charset=UTF-8"/>
  <f:view>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>simpleonetwozeo</title>
      </head>
      <body>
        <h:form>
          <p>
            userName<h:inputText  value="#{backingbean.userName}" 
                                 valueChangeListener="#{backingbean.valueString}"
                                 binding="#{backingbean.usernamebind}" immediate="true">
            <f:validateLength maximum="5" minimum="2" >
                         </f:validateLength>
            </h:inputText>
          </p>
          <p>
            passWord<h:inputText id="az"  value="#{backingbean.passWord}"   binding="#{backingbean.passwordbind}">
            <f:validateLength maximum="5" minimum="3" >
                         </f:validateLength>
     </h:inputText>
          </p>
          <p>
            <h:commandButton value="Submit"
                             actionListener="#{backingbean.stringMethod}"
                             action="success"  />
            <h:messages ></h:messages>
          </p>
        </h:form>
      </body>
    </html>
  </f:view>
</jsp:root>