10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Web Client<br />

1066<br />

HTML form that requires a customer to enter an identifier and password. This form is rendered<br />

by a <strong>Java</strong>Server Faces custom component. A custom tag represents the component on the page.<br />

In the following piece of logon.jsp, the tag represents the custom<br />

component:<br />

<br />

...<br />

<br />

.<br />

<br />

<br />

<br />

Note that there is no h:form tag. This is because the custom component renders the form tag<br />

along with the complete HTML form that customers use to log in:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

...<br />

<br />

Note that the action invoked by the form, j_security_check, is specified by the <strong>Java</strong> Servlet<br />

specification, as are the request parameters j_username and j_password. <strong>The</strong> web container<br />

retrieves this information, maps it to a security role, and verifies that the role matches that<br />

specified in the security constraint. In order for the web container to check the validity of the<br />

authentication information and perform the mapping, you must perform these two steps when<br />

you deploy the application:<br />

1. Add the customer’s group, ID, and password to the default realm of the container using the<br />

Admin Console.<br />

2. Map the bankCustomer role to the customer or the customer’s group in the deployment<br />

descriptor.<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!