java ee - Glasfish Realm Netbeans 8.0.2 Glasfish 4.1 -
Hello (again :) I am working on webpage. I am trying to secure access to jsp for logged users, I decide to use the glossfish area. I 've done a lot of tutorials from the internet but the problem It's always the same - I can not log in or this form or originally. Most tutorials are made on glossfish 3.x, can this be the case? I have seen the same post here but have not answered any
& lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Web-App version = "3.0" xmlns = "http://java.sun.com/xml/ns/javaee" xmlns: xsi = "http://www.w3.org/2001/XMLSchema -instance" Xsi: Schema Location = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> & Lt; Session-config & gt; & Lt; Session timeout & gt; 30 & lt; / Session-timeout & gt; & Lt; / Session-config & gt; & Lt; Security-lock & gt; & Lt; Display-name & gt; Admin & lt; / Display-name & gt; & Lt; Web resource collection & gt; & Lt; Web resource name & gt; Prywatne & lt; / Web resource name & gt; & Lt; Description / & gt; & Lt; URL pattern & gt; / Prywatne / * & lt; / URL pattern & gt; & Lt; Http-method & gt; Received & lt; / Http-method & gt; & Lt; Http-method & gt; Put & lt; / Http-method & gt; & Lt; Http-method & gt; HEAD & lt; / Http-method & gt; & Lt; Http-method & gt; Post & lt; / Http-method & gt; & Lt; Http-method & gt; Options & lt; / Http-method & gt; & Lt; Http-method & gt; Trace & lt; / Http-method & gt; & Lt; Http-method & gt; DELETE & lt; / Http-method & gt; & Lt; / Web resource collection & gt; & Lt; Auth-obstructing & gt; & Lt; Description / & gt; & Lt; Role Name & gt; Admin & lt; / Role Name & gt; & Lt; / Auth-Barrier & gt; & Lt; / Safety-barrier & gt; & Lt; Login to- config & gt; & Lt; Auth-Method & gt; Basic & lt; / Auth-method & gt; & Lt; Radius name & gt; AnnRealm & lt; / Circle-name & gt; & Lt; / Login-config & gt; & Lt; Security-roles & gt; & Lt; Description / & gt; & Lt; Role Name & gt; Admin & lt; / Role Name & gt; & Lt; / Safety-roles & gt; & Lt; Security-roles & gt; & Lt; Description / & gt; & Lt; Role Name & gt; Users & lt; / Role Name & gt; & Lt; / Safety-roles & gt; & Lt; / Web application & gt;
The problem is that you did not set FacesServlet Add to your web.xml
your web.xml :
& lt ; Servlet & gt; & Lt; Servlet-name & gt; Faces servlet & lt; / Servlet-name & gt; & Lt; Servlet category & gt; Javax.faces.webapp.FacesServlet & lt; / Servlet category & gt; & Lt; Load-On-Startup & gt; 1 & lt; / Load-on-startup & gt; & Lt; / Servlet & gt; & Lt; Servlet-mapping & gt; & Lt; Servlet-name & gt; Faces servlet & lt; / Servlet-name & gt; & Lt; URL pattern & gt; * Xhtml & Lt; / Url pattern & gt; & Lt; / Servlet-mapping & gt; & Lt; Welcome-file-list & gt; & Lt; Welcome-file & gt; LoginForm.xhtml & lt; / Welcome-file & gt; & Lt; / Welcome-file-list & gt; You can also change welcome-file if you wish.
Also see: