Java Reference
In-Depth Information
When you use this mechanism, users access the application as shown in the following ex-
ample:
http://localhost:8080/guessNumber
In the case of extension mapping, if a request comes to the server for a page with an
.xhtml extension, the container will send the request to the FacesServlet instance,
which will expect a corresponding page of the same name containing the content to exist.
If you are using NetBeans IDE to create your application, a web deployment descriptor is
automatically created for you with default configurations. If you created your application
without an IDE, you can create a web deployment descriptor.
To Specify a Path to an Application Configuration Resource File
As explained in “ Application Configuration Resource File on page 144 , an application
can have multiple application configuration resource files. If these files are not located
in the directories that the implementation searches by default or the files are not named
faces-config.xml , you need to specify paths to these files.
To specify these paths using NetBeans IDE, do the following.
1. Expand the node of your project in the Projects pane.
2. Expand the Web Pages and WEB-INF nodes that are under the project node.
3. Double-click web.xml .
4. After the web.xml file appears in the editor pane, click General at the top of
the editor pane.
5. Expand the Context Parameters node.
6. Click Add.
7. In the Add Context Parameter dialog:
a. Type javax.faces.CONFIG_FILES in the Param Name field.
b. Type the path to your configuration file in the Param Value field.
c. Click OK.
8. Repeat steps 1 through 7 for each configuration file.
To Specify Where State Is Saved
For all the components in a web application, you can specify in your deployment
descriptor where you want the state to be saved, on either client or server. You do this by
setting a context parameter in your deployment descriptor. By default, state is saved on the
Search WWH ::




Custom Search