Validators - JSF 1.0 Final

Hi
I'm getting the following exception
Mar 8, 2004 9:22:08 AM com.sun.faces.lifecycle.ProcessValidationsPhase execute
SEVERE: validateDate: com.eaac.jsf.FacesValidations.validateDate(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
javax.faces.el.MethodNotFoundException: validateDate: com.eaac.jsf.FacesValidations.validateDate(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
     at com.sun.faces.el.MethodBindingImpl.method(MethodBindingImpl.java:206)
     at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:124)
     at javax.faces.component.UIInput.validate(UIInput.java:733)
     at javax.faces.component.UIInput.executeValidate(UIInput.java:796)
     at javax.faces.component.UIInput.processValidators(UIInput.java:412)
     at javax.faces.component.UIForm.processValidators(UIForm.java:165)
     at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:905)
     at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:341)
     at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:78)
     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:286)
This was working happily with the 1.0 Beta version
Any ideas ??

Some more info - in my FacesValidations class
Which is an application scoped managedBean
public class FacesValidations
     public static void validateDate(FacesContext context, UIInput toValidate)

Similar Messages

  • JSF 1.0 final release problem.

    My application was working when I was using the beta release. (with the old tag like input_text)
    I downloaded the JSF 1.0 final release from Sun and everything stopped working.
    The funny part is the the samples in the fina release are working. However, they are using the old jar files!!! The jsf-impl.jar inside the samples is different from the one inside the jsf-1_0/lib directory. How can we follow those samples???
    When I tried to use the jsf-impl.jar inside the sample application, my application gave me the famous NullPointerException when the listener ConfigLister is initialized.
    When I tried to use the jsf-1_0/lib/jsf-impl.jar inside the lib directory, my application gave me:
    org.apache.jasper.JasperException: Error setting property 'description' in bean of type null
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
    Looks like my bean is not found. Has anyone seen this before? I got the same error when I tried to move an application from Java Creator to tomcat.
    I am using tomcat 4.1.29
    Someone from Sun please fix the samples inside th final release.

    Thanks.
    The second exception is gone. It ends up to be I am using binding instead of value for one attribute inside my jsp.
    Still, it's so confusing to have the older version implementtion inside the samples for final release.
    In the old verion, it's called ConfigListener and the version called ConfigureListener.

  • Jsf-1.0 Final Release and tomcat 5.019

    I post again to say that is works well finally.
    To make it works:
    - download jsf-1.0 FR
    - in your application .war put in WEB-INF/lib/: common-digester.jar, jsf-api.jar, jsf-impl.jar, common-beanutils.jar and jstl.jar. (libs of jsf + lib of jsp).
    - dont use in web.xml <listener-class>com.sun.config.configListener<listener-class>
    - put your appli in jakarata.../webapps
    It works without a class extending ServletContextListener (servlet-api.jar).
    If you have problems erase jakarta.../work/Catalina/yourappli and reload.

    Just for my own information : where did you get jstl.jar and standard.jar ?
    I had to dig in the latest nightly snapshot from jstl jakarta web site to find them but I don't even know if the one I use are final releases of not...

  • WLS8.1 & JSF 1.0 Final: "Faces Servlet" failed to preload

    Ok, this i what I've done. Modified the samples proprties file so everythings gets build without problems with the 1.0.x taglib.
    <copy todir="${build}/${example}/WEB-INF/lib" file="${jstl.jar}"/>
    <copy todir="${build}/${example}/WEB-INF/lib" file="${standard.jar}"/>
    <copy todir="${build}/${example}/WEB-INF/lib" file="/jakarta-taglibs-standard-1.0.5/lib/jaxen-full.jar"/>
    <copy todir="${build}/${example}/WEB-INF/lib" file="/jakarta-taglibs-standard-1.0.5/lib/saxpath.jar"/>
    The jst.jar, standard.jar also point to /jakarta-taglibs-standard-1.0.5/lib
    I updated the web.xml for the listener
    <listener>
         <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>     
    ant the web.cml validated against http://java.sun.com/dtd/web-app_2_3.dtd
    If I deploy the cardemo I see:
    <5/03/2004 10:28:30 PM CET> <Error> <HTTP> <BEA-101216> <Servlet: "Faces Servlet" failed to preload on startup in Web application: "jsf-cardemo".
    javax.servlet.ServletException
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:884)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:848)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:787)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3252)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3197)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3174)
    at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java:688)
    at weblogic.servlet.internal.WebService.preloadResources(WebService.java:483)
    at weblogic.servlet.internal.ServletInitService.resume(ServletInitService.java:30)
    at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
    at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:964)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:359)
    at weblogic.Server.main(Server.java:32)
    >
    5/03/2004 22:28:32 com.sun.faces.config.rules.NavigationRuleRule end
    WARNING: [NavigationRuleRule]{faces-config/navigation-rule} Merge(/confirmChoices.jsp)
    What am I still missing here? I really want to start using JSF!
    Regards,
    Peter

    I believe I have found the issue to the problem. The issue seems to be Weblogic is not respecting part of the Servlet 2.3 spec. It states that all ServletContextListener implementations should be called before the Servlet's init method is called. Tomcat respects this and that's why JSF works when deployed in Tomcat. Weblogic 8.1 calls this instance AFTER the Servlet's init's methods are called. This results in a NullPointerException being thrown.
         You can see how the ordering changes between Weblogic and Tomcat for yourself by editing the log4j.properties file and add the following:
    log4j.category.com.sun.faces.config = DEBUG, config log4j.additivity.com.sun.faces.config=false
    log4j.appender.config = org.apache.log4j.ConsoleAppender log4j.appender.config.layout = org.apache.log4j.PatternLayout log4j.appender.config.layout.ConversionPattern = ...
         Deploy the example application to both Weblogic and Tomcat and observe the order.
         I've developed a work around for this issue. Weblogic seems to respect the <load-on-startup> element in the web.xml file. I have written a Servlet which manually loads the ServletContextListener for JSF. The code below:
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import javax.faces.FactoryFinder;
    import javax.faces.lifecycle.LifecycleFactory;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContextEvent;
    import javax.servlet.ServletContextListener;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    public class WeblogicHackServlet extends HttpServlet {
    public static final String CONFIGURE_LISTENER_KEY = "CONFIGURE_LISTENER"; public static final transient Log logger = LogFactory.getLog(WeblogicHackServlet.class);
    public void init(ServletConfig servletConfig) throws ServletException {
    LifecycleFactory factory =(LifecycleFactory)      
    FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
    if (factory != null)
    return;
    String className = servletConfig.getInitParameter(CONFIGURE_LISTENER_KEY);
    if (className == null) {
    logger.fatal("Did not find the init parameter " + CONFIGURE_LISTENER_KEY);
    return;
    try {
    Class aClass = Class.forName(className);
    ServletContextListener listener = (ServletContextListener)
                   aClass.newInstance();
    listener.contextInitialized(
         new ServletContextEvent(servletConfig.getServletContext()));
    } catch (Exception e) {
    logger.fatal("The ConfigureListener could not be triggered", e);
         The web.xml file also needs to be changed to the following:
    <servlet>
    <servlet-name>WeblogicHackServlet</servlet-name>
    <servlet-class>WeblogicHackServlet</servlet-class>
    <init-param>
    <param-name>CONFIGURE_LISTENER</param-name>
    <param-value>com.sun.faces.config.ConfigureListener</param-value>
    </init-param>
    <load-on-startup> 1 </load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup> 2 </load-on-startup>
    </servlet>
    This causes JSF to load properly. Hopefully, BEA can resolve this issue so my hack can be removed.
    Thanks,
    Louis Calisi
    Applications Architect

  • [Announcement] MyFaces 0.9.1 (JSF 1.0 final!)

    MyFaces 0.9.1 released today.
    This is the first (early access) MyFaces release that conforms to the final JSF specification 1.0 and is compatible to the final jsf-api.jar library 1.0.
    Look at http://myfaces.sourceforge.net
    Cheers,
    Manfred
    P.S.:
    Sun and JCP thanks for a powerful new specification, that will boost web GUI development.
    Great work!
    mailto:[email protected]

    I've had success getting MyFaces examples to work on WebLogic which is more than I can say for the RI. Thanks Manfred good work.

  • Tomcat5.0.19 cannot run Cardemo (JSF 1.0 final)

    I try to immigrate my project from JSF1.0 beta to final, but tomcat (version 5.0.19) cannot preload the file. When I used cardemo to test, I found Tomcat5.0.19 could not run cardemo (JSF1.0 final). But It could run old cardemo (JSF1.0beta).
    Any body find a turn arround. please let me know.
    Daping

    Thanks for the tips on reading the web.xml file...
    I read the web.xml file for the car demo example...it restricts access to all jsp files (*.jsp). This is why you can't see the file because you aren't allowed to access the index.jsp page (it's a jsp page). For testing purposes, I just chose a random file like <url-pattern>/bottomMatter.jsp</url-pattern> to be restricted. After redeploying the application, I was able to view the cardemo sample. I tried to leave an empty entry between the <url-pattern> tags, but you won't be able to redeploy the application - exception thrown. It seems that an entry is required. Because I don't know which pages should be accessed or not...(nor do I care at the moment since it's a sample application), I just set it to restrict a bogus file <url-pattern>/index.html</url-pattern>. This works!
    I discovered this security feature by earlier recommedations in looking at the jsf-guessNumber sample. The web.xml file restricts access to greeting.jsp and response.jsp. If you attempt to enter the url with these files in mind, you will get the same access error page as you did with the cardemo example. It makes sense to restrict people to accessing these files because you don't want someone to access this file before going to the index.jsp page.
    Hope this helps!

  • JSF 1.0 Final - no backing bean validation of empty imputs

    Hi,
    I have simple inputText with validator in backing bean :
    <h:inputText id="layName" maxlength="30" value="#{shp.layerName}" validator="#{shp.validate}"/>
    and validator is executed properly when inputText isn't empty, but when is empty it isn't !.
    In my opinion validator should be executed in every reason, so I wonder if it is a bug ?
    I know that I can set required attribute to "true" and have additional validation of empty values :
    <h:inputText required="true" id="layName" maxlength="30" value="#{shp.layerName}" validator="#{shp.validate}"/>
    <h:message id="errors1" for="layName"/>
    but in this case I will receive standard error message. So my second question is how to overwrite this message with localized massage if backing bean validator isn't executed ?
    Thanks in advance.
    Olek

    If required is "false", then validators will not execute when the field is empty.
    The spec defines how to override the error message for when "required" validation fails, though I don't have the spec handy at the moment.
    -- Adam Winer (EG member)

  • [ANNOUNCE] Faces Console 1.0 Final

    I'd like to announce the availability of Faces Console 1.0 Final. This new version supports JSF 1.0 Final and conrtains a few bug fixes and enhancements.
    --- BIG ENHANCEMENT ---
    The Faces Console Eclipse plugin now has an emdedded editor for users of Eclipse 3.0m7 and later. This is a huge improvement over the old plugin where Faces Console opened into a separate window.
    --- BIG ENHANCEMENT ---
    The Faces Console is a FREE standalone Java Swing application for managing JavaServer Faces-based applications. With the Faces Console you can visually edit JavaServer Faces configuration files as well as JSP Tag Library files.
    The Faces Console also plugs into multiple, popular Java IDEs for seamless management of Faces applications from one central development tool.
    Version 1.0 Final can be downloaded from my website at:
    http://www.jamesholmes.com/JavaServerFaces/console/
    Please give it a try and let me know if you have any problems.
    Thanks,
    -james
    [email protected]
    http://www.jamesholmes.com/JavaServerFaces/

    Hi James,
    Quick question: I've been trying to use Faces Console since the beta, and even with the final I'm having the same problem.
    When I first open a faces-config.xml file with the Faces Console, it puts an empty:
    xmlns=""
    attribute in all of my top level tags. This makes the document invalid and Faces Console can't reload it next time. If it helps, my root tag looks like:
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
    Any idea why this might be?
    Ryan

  • Security with jsf

    Hello,
    my website has 5 roles groups and each one can access to differents pages.
    How can i forbid the access to pages of the role group 1 to the others?
    In fact, a bean has a "level" variable which contain the role group of the user.
    I would like to test this value and if it is the good one, give access.
    Otherwise, i would like to redirect the user to the login page
    Thx u in advance !
    PS: All is made with JSF

    Hi
    Put this in Ur web.xml
    <filter>
              <filter-name>SecurityFilter</filter-name>
              <filter-class>adjuvant.poa.util.SecurityFilter</filter-class>
         </filter>
         <filter-mapping>
              <filter-name>SecurityFilter</filter-name>
              <url-pattern>*.jsf</url-pattern>
         </filter-mapping>
    here is ur security class
    adjuvant.poa.util.SecurityFilter
    * [email protected]
    package adjuvant.poa.util;
    import javax.servlet.Filter;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.FilterChain;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import java.io.IOException;
    import java.util.Iterator;
    import java.util.Set;
    import java.util.HashSet;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import adjuvant.poa.jsf.backingbeans.UserBean;
    * This Filter class handle the security of the application.
    * <p>
    * It should be configured inside the web.xml.
    public class SecurityFilter implements Filter {
         //the login page uri
         private static final String LOGIN_PAGE_URI = "login.jsf";
         private static final String ADMIN_LOGIN_PAGE_URI = "../login.jsf";
         private static final String USER_BEAN = "nurse";
         //the logger object
         private Log logger = LogFactory.getLog(this.getClass());
         //a set of restricted resources
         private Set restrictedResources;
         * Initializes the Filter.
         public void init(FilterConfig filterConfig) throws ServletException {
              this.restrictedResources = new HashSet();
              this.restrictedResources.add("/assessment.jsf");
              this.restrictedResources.add("/patients.jsf");
              this.restrictedResources.add("/anesthetic.jsf");
              this.restrictedResources.add("/baseline.jsf");
              this.restrictedResources.add("/drugs.jsf");
              this.restrictedResources.add("/endocrine.jsf");
              this.restrictedResources.add("/haematological.jsf");
              this.restrictedResources.add("/labwork.jsf");
              this.restrictedResources.add("/medication.jsf");
              this.restrictedResources.add("/neurologocal.jsf");
              this.restrictedResources.add("/newpatient.jsf");
              this.restrictedResources.add("/patientdetails.jsf");
              this.restrictedResources.add("/renal.jsf");
              this.restrictedResources.add("/respiratory.jsf");
              this.restrictedResources.add("/riskassessment.jsf");
              this.restrictedResources.add("/summary.jsf");
              this.restrictedResources.add("/minimalquestions.jsf");
              //admin Pages
              this.restrictedResources.add("/admin/admin.jsf");
              this.restrictedResources.add("/admin/drugs.jsf");
              this.restrictedResources.add("/admin/drugs.jsf");
              this.restrictedResources.add("/admin/editdrugs.jsf");
              this.restrictedResources.add("/admin/nurses.jsf");
              this.restrictedResources.add("/admin/newnurse.jsf");
              this.restrictedResources.add("/admin/transaction.jsf");
         * Standard doFilter object.
         public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
                   throws IOException, ServletException {
              this.logger.debug("doFilter");
              String contextPath = ((HttpServletRequest)req).getContextPath();
              String requestUri = ((HttpServletRequest)req).getRequestURI();
              this.logger.debug("contextPath = " + contextPath);
              this.logger.debug("requestUri = " + requestUri);
              if (this.contains(requestUri, contextPath) && !(requestUri.contains("admin") ? this.authorizeAdmin((HttpServletRequest)req) : this.authorize((HttpServletRequest)req))) {
                   this.logger.debug("authorization failed");
                   ((HttpServletRequest)req).getRequestDispatcher(LOGIN_PAGE_URI).forward(req, res);
              else {
                   this.logger.debug("authorization succeeded");
                   chain.doFilter(req, res);
         public void destroy() {}
         private boolean contains(String value, String contextPath) {
              Iterator ite = this.restrictedResources.iterator();
              while (ite.hasNext()) {
                   String restrictedResource = (String)ite.next();
                   if ((contextPath + restrictedResource).equalsIgnoreCase(value)) {
                        return true;
              return false;
         private boolean authorize(HttpServletRequest req) {
              UserBean user = (UserBean)req.getSession().getAttribute(USER_BEAN);          
              if (user != null ) {
                   //user logged in
                   return true;
              else {
                   return false;
         private boolean authorizeAdmin(HttpServletRequest request) {
              UserBean user = (UserBean)request.getSession().getAttribute(USER_BEAN);
              if (user != null && user.getUserId() != null && user.getUserId().equals("admin") ) {
                   //user logged in
                   return true;
              else {
                   return false;
    }

  • Managed session bean in servlet filter

    Hi,
    Is there a way to get hold of a managed bean with session scope in a servlet filter? The code below throws an error due to the fact that the faces context is null.
    FacesContext facesContext = FacesContext.getCurrentInstance();
    System.out.println("facesContext: " + facesContext); // shows that facesContext is null
    ApplicationFactory appFactory = ApplicationFactory)FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    Application app = appFactory.getApplication();
    Object obj = app.createValueBinding("user").getValue(facesContext); //throws the error due to the null parameter
    Object obj2 = app.createValueBinding("user"); //results in a valid ValueBindingHere is the faces-config snippet for the managed bean:
    <managed-bean>
        <managed-bean-name>user</managed-bean-name>
        <managed-bean-class>biz.libereco.skemo.info.asl.beans.User</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>For the record, I am using JSF 1.0 Final.
    Thank you,
    Marcel

    wynton_0 wrote:
    Yes, there is a way to get hold of a managed bean with session scope in a servlet filter.
    See here:
    [http://wiki.apache.org/myfaces/AccessFacesContextFromServlet]
    and here:
    [how to access faces context and backing beans in a servlet filter|http://www.thoughtsabout.net/blog/archives/000033.html]
    This makes no utter sense. A JSF session scoped managed bean is under the hood just put as a HttpSession attribute with the managed bean name as key. Guess what, you can just access the HttpSession in Filter by ((HttpServletRequest) request).getSession() and then just call getAttribute() on it. If it isn't there yet, then just do a setAttribute() with a new instance.
    After I get User bean in my Servlet filter, I populate value to this bean, for example:
    user.setLanguage(request.getParameter("locale"));
    The User bean is in session scope. The User bean's language attribute suppose to be same in the whole session scope, but later on, I got null. My question is:
    how to keep this value in session scope?The the session was apparently invalidated/renewed or you manually removed the bean or replaced it by null.
    In the future, please don't resurrect old topics, just start a new topic for each independent problem/question.

  • RenderKitId and ViewHandler in JSF1.2

    I've been reading the JSF 1.2 spec, and I am a bit confused about how the ViewHandler interacts with the view's renderKitId.
    From the JSF 1.2 Final Draft (May 2006), Section 9.4.20 (f:view) indicates that the renderKitId attribute is set in this order:
    1) user supplied value
    2) Application.getDefaultRenderKitId if not null
    3) RenderKitFactory.HTML_BASIC_RENDER_KIT
    Section 7.5.1 (View Handler) indicates that the ViewHandler .createView calls .calculateRenderKitId "to find out which renderKitId should be used for rendering the view."
    Section 2.4.2.2 (Configure the Desired RenderKit) indicates "the default ViewHandler must call calculateRenderKitId() on itself and set the result into the UIViewRoot's renderKitId property."
    Does this mean that it is the responsibility of the default ViewHandler .calculateRenderKitId method to follow the steps described in section 9.4.20 for determining the renderKitId to put on the UIViewRoot?
    I'm trying to figure this out because I want to know how a custom ViewHandler should act.
    I created a ViewHandler implementation for JSF 1.1_01 which delegated everything except .calculateRenderKitId. In .calculateRenderKitId, I determine the type of device that is connecting. If it is a "telnet device" (actually a server sitting between the telnet emulator and the application), I return the renderKitId for a telnet RenderKit. Otherwise, I would delegate (which, in the default case, the default-render-kit-id in faces.config.xml would be used).
    I'm trying to figure out how similar functionality would work with JSF 1.2. Ideally, a user-supplied value for the f:view renderKitId should be used if present. Only if it is not present should I check for the telnet device, and, if not, then delegate.
    But if my understanding of the JSF 1.2 spec is correct, I would be "interjecting" myself in the middle of the standard processing.

    Some people have indicated that they have had success making custom component out of existing components by using a delegation strategy for rendering, decodes, etc.
    Alternatively you might need to override the state saving and restore methods to overcome your problems with your existing code.
    Another possibility is to use a page fragment, if you are using Facelets or another templating library which supports it.

  • Help needed get JSF final release running on tomcat 5

    Hi there,
    I know my topic seems to be a easy thing which is often discusseb but I tell you it's not. And after searching the forum an the web... it's driving me crazy I want to make some development and tests but I can' get my stuff running on tomcat 5 and jsf final release.
    This is my last error message... seems like tomcat don't know anything about jsf...
    my directories---------------------------
    my webbapp
    -- WEB-INF
    classes
    lib
    scr
    web.xml
    faces-config.xml
    WEB-INF
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-logging.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    standard.jar
    web.xml ------------------------------------------------------------------------
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>MyWeb</display-name>
    <description>
    FElix
    </description>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <!-- ############# Faces Servlet ############# -->
    <servlet>
    <servlet-name>JavaServer Faces Servlet</servlet-name>
    <servlet-class>
    javax.faces.webapp.FacesServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- ############# Mapping ############### -->
    <servlet-mapping>
    <servlet-name>JavaServer Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <listener>
    <listener-class>
    com.sun.faces.config.ConfigureListener
    </listener-class>
    </listener>
    </web-app>
    faces-config.xml---------------------------------
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
    <navigation-rule>
    <from-view-id>/eingabe.jsp</from-view-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/ausgabe.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <managed-bean>
    <managed-bean-name>Square</managed-bean-name>
    <managed-bean-class>src.com.edu.jsf.bean.SquareBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    </faces-config>
    ERROR - MESSAGE
    org.apache.jasper.JasperException: /eingabe.jsp(19,3) No tag "input_number" defined in tag library imported with prefix "h"
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
    org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1346)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598)
    org.apache.jasper.compiler.Parser.parseBody(Parser.java:1827)
    org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100)
    org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1405)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598)
    org.apache.jasper.compiler.Parser.parseBody(Parser.java:1827)
    org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1100)
    org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1405)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1598)
    org.apache.jasper.compiler.Parser.parse(Parser.java:171)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:258)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:139)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    I really stuck so any help is appriciated...
    I also tried to put the jars in the common/lib
    but still not working...
    I tried to get it running with jwsdp ... but same s*** ...
    best regards
    Felix

    thanks....
    this means... everything was working and I better should have read the notes...
    I went back.... installed jwsdp1.3 and everything was fine...
    so I will give it a try... change the classes and at this time i use the right tags...
    but this will also work for the tomcat downloaded from the apache.org site?
    I only need the jar files in the jsf-1.0/lib file and the latest jstl-jars ---
    thanks again
    reagards felix

  • JSF 2.0 - Validators

    Do JSF 2.0 Validators get fired if the input is null?

    JSF 2.0 is going to require a minimum of Servlet 2.5/JSP 2.1.
    Edited by: rlubke on Mar 17, 2009 12:53 PM

  • Using container managed form-based security in JSF

    h1. Using container managed, form-based security in a JSF web app.
    A Practical Solution
    h2. {color:#993300}*But first, some background on the problem*{color}
    The Form components available in JSF will not let you specify the target action, everything is a post-back. When using container security, however, you have to specifically submit to the magic action j_security_check to trigger authentication. This means that the only way to do this in a JSF page is to use an HTML form tag enclosed in verbatim tags. This has the side effect that the post is not handled by JSF at all meaning you can't take advantage of normal JSF functionality such as validators, plus you have a horrible chimera of a page containing both markup and components. This screws up things like skinning. ([credit to Duncan Mills in this 2 years old article|http://groundside.com/blog/DuncanMills.php?title=j2ee_security_a_jsf_based_login_form&more=1&c=1&tb=1&pb=1]).
    In this solution, I will use a pure JSF page as the login page that the end user interacts with. This page will simply gather the input for the username and password and pass that on to a plain old jsp proxy to do the actual submit. This will avoid the whole problem of having to use verbatim tags or a mixture of JSF and JSP in the user view.
    h2. {color:#993300}*Step 1: Configure the Security Realm in the Web App Container*{color}
    What is a container? A container is basically a security framework that is implemented directly by whatever app server you are running, in my case Glassfish v2ur2 that comes with Netbeans 6.1. Your container can have multiple security realms. Each realm manages a definition of the security "*principles*" that are defined to interact with your application. A security principle is basically just a user of the system that is defined by three fields:
    - Username
    - Group
    - Password
    The security realm can be set up to authenticate using a simple file, or through JDBC, or LDAP, and more. In my case, I am using a "file" based realm. The users are statically defined directly through the app server interface. Here's how to do it (on Glassfish):
    1. Start up your app server and log into the admin interface (http://localhost:4848)
    2. Drill down into Configuration > Security > Realms.
    3. Here you will see the default realms defined on the server. Drill down into the file realm.
    4. There is no need to change any of the default settings. Click the Manage Users button.
    5. Create a new user by entering username/password.
    Note: If you enter a group name then you will be able to define permissions based on group in your app, which is much more usefull in a real app.
    I entered a group named "Users" since my app will only have one set of permissions and all users should be authenticated and treated the same.
    That way I will be able to set permissions to resources for the "Users" group that will apply to all users that have this group assigned.
    TIP: After you get everything working, you can hook it all up to JDBC instead of "file" so that you can manage your users in a database.
    h2. {color:#993300}*Step 2: Create the project*{color}
    Since I'm a newbie to JSF, I am using Netbeans 6.1 so that I can play around with all of the fancy Visual Web JavaServer Faces components and the visual designer.
    1. Start by creating a new Visual Web JSF project.
    2. Next, create a new subfolder under your web root called "secure". This is the folder that we will define a Security Constraint for in a later step, so that any user trying to access any page in this folder will be redirected to a login page to sign in, if they haven't already.
    h2. {color:#993300}*Step 3: Create the JSF and JSP files*{color}
    In my very simple project I have 3 pages set up. Create the following files using the default templates in Netbeans 6.1:
    1. login.jsp (A Visual Web JSF file)
    2. loginproxy.jspx (A plain JSPX file)
    3. secure/securepage.jsp (A Visual Web JSF file... Note that it is in the sub-folder named secure)
    Code follows for each of the files:
    h3. {color:#ff6600}*First we need to add a navigation rule to faces-config.xml:*{color}
        <navigation-rule>
    <from-view-id>/login.jsp</from-view-id>
            <navigation-case>
    <from-outcome>loginproxy</from-outcome>
    <to-view-id>/loginproxy.jspx</to-view-id>
            </navigation-case>
        </navigation-rule>
    NOTE: This navigation rule simply forwards the request to loginproxy.jspx whenever the user clicks the submit button. The button1_action() method below returns the "loginproxy" case to make this happen.
    h3. {color:#ff6600}*login.jsp -- A very simple Visual Web JSF file with two input fields and a button:*{color}
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
        <jsp:directive.page
    contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page
    id="page1">
    <webuijsf:html id="html1">
    <webuijsf:head id="head1">
    <webuijsf:link id="link1"
    url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body id="body1" style="-rave-layout: grid">
    <webuijsf:form id="form1">
    <webuijsf:textField binding="#{login.username}"
    id="username" style="position: absolute; left: 216px; top:
    96px"/>
    <webuijsf:passwordField binding="#{login.password}" id="password"
    style="left: 216px; top: 144px; position: absolute"/>
    <webuijsf:button actionExpression="#{login.button1_action}"
    id="button1" style="position: absolute; left: 216px; top:
    216px" text="GO"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>h3. *login.java -- implent the
    button1_action() method in the login.java backing bean*
        public String button1_action() {
            setValue("#{requestScope.username}",
    (String)username.getValue());
    setValue("#{requestScope.password}", (String)password.getValue());
            return "loginproxy";
        }h3. {color:#ff6600}*loginproxy.jspx -- a login proxy that the user never sees. The onload="document.forms[0].submit()" automatically submits the form as soon as it is rendered in the browser.*{color}
    {code}
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    version="2.0">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-W3CDTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html"
    pageEncoding="UTF-8"/>
    <html>
    <head> <meta
    http-equiv="Content-Type" content="text/html;
    charset=UTF-8"/>
    <title>Logging in...</title>
    </head>
    <body
    onload="document.forms[0].submit()">
    <form
    action="j_security_check" method="POST">
    <input type="hidden" name="j_username"
    value="${requestScope.username}" />
    <input type="hidden" name="j_password"
    value="${requestScope.password}" />
    </form>
    </body>
    </html>
    </jsp:root>
    {code}
    h3. {color:#ff6600}*secure/securepage.jsp -- A simple JSF{color}
    target page, placed in the secure folder to test access*
    {code}
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page
    contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"/>
    <f:view>
    <webuijsf:page
    id="page1">
    <webuijsf:html id="html1">
    <webuijsf:head id="head1">
    <webuijsf:link id="link1"
    url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body id="body1" style="-rave-layout: grid">
    <webuijsf:form id="form1">
    <webuijsf:staticText id="staticText1" style="position:
    absolute; left: 168px; top: 144px" text="A Secure Page"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
    </webuijsf:page>
    </f:view>
    </jsp:root>
    {code}
    h2. {color:#993300}*_Step 4: Configure Declarative Security_*{color}
    This type of security is called +declarative+ because it is not configured programatically. It is configured by declaring all of the relevant parameters in the configuration files: *web.xml* and *sun-web.xml*. Once you have it configured, the container (application server and java framework) already have the implementation to make everything work for you.
    *web.xml will be used to define:*
    - Type of security - We will be using "form based". The loginpage.jsp we created will be set as both the login and error page.
    - Security Roles - The security role defined here will be mapped (in sun-web.xml) to users or groups.
    - Security Constraints - A security constraint defines the resource(s) that is being secured, and which Roles are able to authenticate to them.
    *sun-web.xml will be used to define:*
    - This is where you map a Role to the Users or Groups that are allowed to use it.
    +I know this is confusing the first time, but basically it works like this:+
    *Security Constraint for a URL* -> mapped to -> *Role* -> mapped to -> *Users & Groups*
    h3. {color:#ff6600}*web.xml -- here's the relevant section:*{color}
    {code}
    <security-constraint>
    <display-name>SecurityConstraint</display-name>
    <web-resource-collection>
    <web-resource-name>SecurePages</web-resource-name>
    <description/>
    <url-pattern>/faces/secure/*</url-pattern>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
    <http-method>HEAD</http-method>
    <http-method>PUT</http-method>
    <http-method>OPTIONS</http-method>
    <http-method>TRACE</http-method>
    <http-method>DELETE</http-method>
    </web-resource-collection>
    <auth-constraint>
    <description/>
    <role-name>User</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name/>
    <form-login-config>
    <form-login-page>/faces/login.jsp</form-login-page>
    <form-error-page>/faces/login.jsp</form-error-page>
    </form-login-config>
    </login-config>
    <security-role>
    <description/>
    <role-name>User</role-name>
    </security-role>
    {code}
    h3. {color:#ff6600}*sun-web.xml -- here's the relevant section:*{color}
    {code}
    <security-role-mapping>
    <role-name>User</role-name>
    <group-name>Users</group-name>
    </security-role-mapping>
    {code}
    h3. {color:#ff6600}*Almost done!!!*{color}
    h2. {color:#993300}*_Step 5: A couple of minor "Gotcha's"_ *{color}
    h3. {color:#ff6600}*_Gotcha #1_*{color}
    You need to configure the "welcome page" in web.xml to point to faces/secure/securepage.jsp ... Note that there is *_no_* leading / ... If you put a / in there it will barf all over itself .
    h3. {color:#ff6600}*_Gotcha #2_*{color}
    Note that we set the <form-login-page> in web.xml to /faces/login.jsp ... Note the leading / ... This time, you NEED the leading slash, or the server will gag.
    *DONE!!!*
    h2. {color:#993300}*_Here's how it works:_*{color}
    1. The user requests the a page from your context (http://localhost/MyLogin/)
    2. The servlet forwards the request to the welcome page: faces/secure/securepage.jsp
    3. faces/secure/securepage.jsp has a security constraint defined, so the servlet checks to see if the user is authenticated for the session.
    4. Of course the user is not authenticated since this is the first request, so the servlet forwards the request to the login page we configured in web.xml (/faces/login.jsp).
    5. The user enters username and password and clicks a button to submit.
    6. The button's action method stores away the username and password in the request scope.
    7. The button returns "loginproxy" navigation case which tells the navigation handler to forward the request to loginproxy.jspx
    8. loginproxy.jspx renders a blank page to the user which has hidden username and password fields.
    9. The hidden username and password fields grab the username and password variables from the request scope.
    10. The loginproxy page is automatically submitted with the magic action "j_security_check"
    11. j_security_check notifies the container that authentication needs to be intercepted and handled.
    12. The container authenticates the user credentials.
    13. If the credentials fail, the container forwards the request to the login.jsp page.
    14. If the credentials pass, the container forwards the request to *+the last protected resource that was attempted.+*
    +Note the last point! I don't know how, but no matter how many times you fail authentication, the container remembers the last page that triggered authentication and once you finally succeed the container forwards your request there!!!!+
    +The user is now at the secure welcome page.+
    If you have read this far, I thank you for your time, and I seriously question your ability to ration your time pragmatically.
    Kerry Randolph

    If you want login security on your web app, this is one way to do it. (the easiest way i have seen).
    This method allows you to create a custom login form and error page using JSF.
    The container handles the actual authentication and protection of the resources based on what you declare in web.xml and sun-web.xml.
    This example uses a statically defined user/password, stored in a file, but you can also configure JDBC realm in Glassfish, so that that users can register for access and your program can store the username/passwrod in a database.
    I'm new to programming, so none of this may be a good practice, or may not be secure at all.
    I really don't know what I'm doing, but I'm learning, and this has been the easiest way that I have found to add authentication to a web app, without having to write the login modules yourself.
    Another benefit, and I think this is key ***You don't have to include any extra code in the pages that you want to protect*** The container manages this for you, based on the constraints you declare in web.xml.
    So basically you set it up to protect certain folders, then when any user tries to access pages in that folder, they are required to authenticate.
    --Kerry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • JSF Custom Validator Problem

    Please help,
    I have written a handful of custom validators and I'm having a small problem with them. For some reason the validator will not display there message in a <h:message> tag. They do however display in a <h:messages> tag as long as the globalOnly attribute is set to false. I'm guessing this is being caused by the fact that the validators are not being registered properly with their parent components. My question is how do I accomplish registering the validator correctly with its parent component.
    Below is an example of one of the valiators and its use in the page.
    <c:form validationType="Server">
        <label>Phone Number</label>
        <h:inputText id="PhoneNumber">
         <c:validatePhoneNumber errorSummary="Please enter a valid Phone number" errorDetail="Blah"></c:validatePhoneNumber>
        </h:inputText>
        <h:message style="color: red" for="PhoneNumber" />
        <h:commandButton value="Submit"></h:commandButton>
    </c:form>
    public class PhoneNumberValidatorTag extends ValidatorTag {
      private static final long serialVersionUID = -3061371618875302020L;
      private final String validatorId = "jsf.validators.PhoneNumber";
      private String validationType;
      private String validateAgainst = PhoneNumberValidator.US;
      private String errorSummary = "";
      protected String errorDetail = "";
      public PhoneNumberValidatorTag() {
        setValidatorId( validatorId );
      public Validator createValidator() throws JspException {
        PhoneNumberValidator validator = ( PhoneNumberValidator ) super
            .createValidator( );
        FacesContext context = FacesContext.getCurrentInstance( );
        Application app = context.getApplication( );
        Util.doAssert( null != validator );
        UIComponentTag tag = UIComponentTag.getParentUIComponentTag( pageContext );
        UIComponent component = tag.getComponentInstance( );
        UIComponent parentForm = component;
        while ( !( parentForm instanceof HtmlForm ) ) {
          parentForm = parentForm.getParent( );
        ValidationHtmlForm vhf = ( ValidationHtmlForm ) ( ( HtmlForm ) parentForm );
        if ( "client".equalsIgnoreCase( vhf.getValidationType( ) ) ) {
          validator.setServerValidate( false );
        } else {
          validator.setServerValidate( true );
          if ( errorSummary != null ) {
            if ( UIComponentTag.isValueReference( errorSummary ) ) {
              validator.setErrorSummary( ( String ) app.createValueBinding(
                  errorSummary ).getValue( context ) );
            } else {
              validator.setErrorSummary( errorSummary );
          if ( validateAgainst != null ) {
            if ( UIComponentTag.isValueReference( validateAgainst ) ) {
              validator.setErrorSummary( ( String ) app.createValueBinding(
                  validateAgainst ).getValue( context ) );
            } else {
              validator.setErrorSummary( validateAgainst );
        return validator;
      public void release()
        super.release();
      public int doEndTag() throws JspException {
        FacesContext context = FacesContext.getCurrentInstance( );
        ResponseWriter writer = context.getResponseWriter( );
        try {
          UIComponentTag tag = UIComponentTag.getParentUIComponentTag( pageContext );
          UIComponent component = tag.getComponentInstance( );
          UIComponent parentForm = component;
          while ( !( parentForm instanceof HtmlForm ) ) {
            parentForm = parentForm.getParent( );
          ValidationHtmlForm vhf = ( ValidationHtmlForm ) parentForm;
          if ( "client".equalsIgnoreCase( vhf.getValidationType( ) )
              || "both".equalsIgnoreCase( vhf.getValidationType( ) ) ) {
            writer
                .write( StringUtil
                    .format(
                        "<script language='JavaScript'>"
                            + " formValidator.addValidator('{0}',new PhoneNumberValidator('{1}', PhoneNumberValidator.{2} ,'{3}'));"
                            + "</script>", new Object[] {
                            parentForm.getClientId( context ),
                            component.getClientId( context ), validateAgainst,
                            errorSummary } ) );
        } catch ( IOException e ) {
          e.printStackTrace( );
        return 1;
      � Getters and Setters removed to shorten code
    public class PhoneNumberValidator extends BaseValidator {
      private static final long serialVersionUID = -1925668990356710828L;
      public static final String US = "US";
      public static final String INTERNATIONAL = "INTERNATIONAL";
      public static HashMap REG = new HashMap( );
      static{
        REG.put( "US", "^\\(?\\d{3}\\)?(\\s|-)\\d{3}-\\d{4}$" );
        REG.put( "INTERNATIONAL",
            "^((\\+\\d(\\d)?)?(\\(\\d\\{3}?)))? \\d{3}?-\\d{4}$" );
      public PhoneNumberValidator() {
        super( );
      public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
        if ( !serverValidate )
          return;
        if ( value == null )
          return;
        if ( context == null || component == null )
          throw new NullPointerException( );
        String regex;
        if ( REG.containsKey( validateAgainst ) )
          regex = ( String ) REG.get( validateAgainst );
        else
          regex = ( String ) REG.get( US );
        Pattern pattern = Pattern.compile( regex );
        if ( !"".equals( value.toString( ).trim( ) )
            && !pattern.matcher( value.toString( ).trim( ) ).matches( ) ) {
          Object[] params = new Object[] { value };
          Locale locale = context.getViewRoot( ).getLocale( );
          String summary;
          if ( errorSummary == null )
            summary = Messages.getString(
                "resource.ValidationMessages", "badPhoneNumber",
                params );
          else
            summary = new MessageFormat( errorSummary, locale ).format( params );
          String detail;
          if ( errorDetail == null )
            detail = Messages.getString(
                "resource.ValidationMessages",
                "badPhoneNumber_detail", params );
          else
            detail = new MessageFormat( errorDetail, locale ).format( params );
          FacesMessage message = new FacesMessage( FacesMessage.SEVERITY_ERROR,
              summary, detail );
          throw new ValidatorException( message );
      public String getJavaScript() {
         � Method body removed to shorten post
    }I probably should also mention I overrode the HtmlForm tag so I could add an attribute to the tag that allows the developer to specify client, server, or both when they are choosing the valiation type they want to use.
    Thank you in advance for any help you can provide.
    Grape Ape

    I do not think what you want to do is possible with the standard panelGrid. The panelGrid sees each child (of the panelGrid) as 1 component. The childrens children are considered a part of the child.
    Heh, did I confuse you with that? You have probably already guessed that though.
    At one time, I considered creating a custom component like yours. One that would just allow rendering of it's children or not. I decided that it was easier and better to add the rendered attribute to each of my other custom components (since the functionality is already supported by UIComponent). All you have to do is add the rendered attribute to your TLD doc for each custom component and your component can now use the "rendered" attribute. Oh, and you'll have to call super.setProperties() in the component tag.
    All JSF standard components can use the rendered attribute.
    Let me know if you'd like me to explain things better or post some code examples.
    Hope this helps,
    CowKing

Maybe you are looking for