dev@glassfish.java.net

Re: glassfish v3.1 jsf form authentication

From: Jason Lee <jason.d.lee_at_oracle.com>
Date: Thu, 24 Mar 2011 09:11:10 -0500

What URL is the browser requesting? It should be login.jsf.

For what it's worth, once you solve the processing issue, I expect the
page might break as h:commandButton and h:commandLink require that they
are enclosed in h:form. For this login form, I think you're going to
want to use regular HTML forms and inputs. The GlassFish Admin Console
login form does the same thing.

On 3/24/11 3:12 AM, java4dev wrote:
> Hello,
>
> I am trying to use form authentication, because I want to allow users
> to register if they are not members but
> I have the following problem,
> The login.xhtml file is attached
>
> Now my problem is that when I try to access a page where the form
> should I appear I get in Safari
> Username:Password:
> In mozilla I get a message that the XML has no format information.
>
> It seems that the source sent by the server is
>
> <?xml version='1.0' encoding='UTF-8' ?>
> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
> template="./../templates/TemplateHeaderFooter.xhtml"
> xmlns:h="http://java.sun.com/jsf/html">
>
>
>
> <ui:define name="content">
> <form method="POST" action="j_security_check">
> <h:outputLabel for="j_username">Username:</h:outputLabel>
> <h:inputText id="j_username" required="true" />
> <h:message for="j_username" />
> <h:outputLabel for="j_password">Password:</h:outputLabel>
> <h:inputSecret id="j_password" required="true" />
> <h:message for="j_password" />
> <h:commandButton value="Login" />
> <h:commandLink value="Register" action="registerUser" />
> </form>
> </ui:define>
>
>
>
> </ui:composition>
>
> It seems as the page is not been parsed/rendered properly.
> The template is not integrated and no html code is generated.
>
> Are there any ideas on how to solve this issue.
>
> thank you
>
> Nikolas
>


-- 
Jason Lee
Senior Member of Technical Staff
GlassFish REST API / Administration Console
Oracle Corporation
Phone +1 405-216-3193
Blog http://blogs.steeplesoft.com