Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use j_security_check. All you do is post to it, and it will handle authentication based on the realm you've defined, and the application-specific configuration in your web.xml. </p> <p>Depending on your app server, there is an additional step of linking the defined role (app-specific) to a group (realm-specific).</p> <p>Here is a typical configuration:</p> <pre><code>&lt;servlet&gt; &lt;servlet-name&gt;Login&lt;/servlet-name&gt; &lt;servlet-class&gt;com.example.Login&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Login&lt;/servlet-name&gt; &lt;url-pattern&gt;/Login&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet&gt; &lt;servlet-name&gt;Error&lt;/servlet-name&gt; &lt;servlet-class&gt;com.example.Error&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Error&lt;/servlet-name&gt; &lt;url-pattern&gt;/Error&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;login-config&gt; &lt;auth-method&gt;FORM&lt;/auth-method&gt; &lt;realm-name&gt;example.com&lt;/realm-name&gt; &lt;form-login-config&gt; &lt;form-login-page&gt;/Login&lt;/form-login-page&gt; &lt;form-error-page&gt;/Error&lt;/form-error-page&gt; &lt;/form-login-config&gt; &lt;/login-config&gt; &lt;security-role&gt; &lt;role-name&gt;arbitraryRoleName&lt;/role-name&gt; &lt;/security-role&gt; &lt;security-constraint&gt; &lt;web-resource-collection&gt; &lt;web-resource-name&gt;All Pages&lt;/web-resource-name&gt; &lt;url-pattern&gt;/index.xhtml&lt;/url-pattern&gt; &lt;/web-resource-collection&gt; &lt;auth-constraint&gt; &lt;role-name&gt;arbitraryRoleName&lt;/role-name&gt; &lt;/auth-constraint&gt; &lt;/security-constraint&gt; </code></pre> <p>Note the <code>security-role</code>. This still needs linked into a group, or whatever you are defining to differentiate users that can use a page from users who can't.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload