tags:

views:

61

answers:

1

I have the next code:

<li>
    <h:form rendered="#{!loginController.session}">
        <h3>Inicio de Sesi&oacute;n</h3>
        <h:panelGrid columns="2" cellpadding="7">
            <h:outputText value="Usuario: " />
            <h:inputText id="loginname" value="#{loginController.loginname}" maxlength="16" />
            <h:outputText value="Contrase&ntilde;a: " />
            <h:inputSecret id="password" value="#{loginController.password}" maxlength="16"/>
            <h:outputText value="" />
            <h:commandButton value="Iniciar Sesi&oacute;n" action="#{loginController.CheckValidUser}"    />
        </h:panelGrid>
    </h:form>
</li>

But when run that the page doesn't render the form, anybody can tell me why?

+1  A: 

If you're using the ancient JSF 1.0/1.1 implementations, then you need to wrap HTML in <f:verbatim> tags like so:

<f:verbatim><li></f:verbatim>
    <h:form rendered="#{!loginController.session}">
        <f:verbatim><h3>Inicio de Sesi&oacute;n</h3></f:verbatim>
        <h:panelGrid columns="2" cellpadding="7">
            ...

Otherwise they will end up in the top of the generated document, before all JSF components.

If you're using a JSF 1.2 implementation or newer, then you should be able to write plain HTML in template text without problems since they are automatically taken as verbatim in the component tree. The only cause for the form not being rendered would be that LoginController#isSession() returned true since that's what its rendered attribute is depending on.

BalusC
Man..I'm using JSF 2.0... the rendered attribute is getting true... any another idea?
RhigoHR
Well.. I found the problem... it was a silly thing.The trouble was in the web-config.xml the url of the <welcome-file> was without faces/ at the beggining =)
RhigoHR
In the future questions, please mention the obvious as well :) Also taking a peek in the generated HTML source (rightclick page in browser, view source) may also give a lot insights. When the `FacesServlet` wasn't invoked, you should have seen the entire JSF source code plain vanilla in the client side's page source.
BalusC