When implementing the state-holder methods (described in Saving and Restoring State), you specify in your deployment descriptor where you want the state to be saved, either client or server. You do this by setting a context parameter in your deployment descriptor.
To specify where state is saved using NetBeans IDE, do the following:
Expand the node of your project in the Projects pane.
Expand the Web Pages and WEB-INF nodes that are under the project node.
After the web.xml file appears in the editor pane, click General at the top of the editor pane.
Expand the Context Parameters node.
In the Add Context Parameter dialog:
Enter javax.faces.STATE_SAVING_METHOD in the Param Name field.
Enter client or server in the Param Value field.
To specify where state is saved by editing the deployment descriptor directly follow these steps:
Add a context-param element to the deployment descriptor.
Add a param-name element inside the context-param element and give it the name javax.faces.STATE_SAVING_METHOD.
Add a param-value element to the context-param element and give it the value client or server, depending on whether you want state saved in the client or the server.
If state is saved on the client, the state of the entire view is rendered to a hidden field on the page. The JavaServer Faces implementation saves the state on the client by default. Duke’s Bookstore saves its state in the client.