[jboss-dev-forums] [JBoss Microcontainer Development POJO Server] - Re: Deploying ValidatorFactory

stan.silvert@jboss.com do-not-reply at jboss.com
Mon Aug 24 09:49:12 EDT 2009


"alesj" wrote : "stan.silvert at jboss.com" wrote : But I can't use the JSF Deployer in AS5, so the VF has to be obtained from a ServletContextListener.
  |   | 
  | Is this an issue or what?
  | 
  | With MC-int/Servlet code this is trivial to do,
  | if you need me to hack it, just point me to the code that requires it.

If you want to do it that way it's fine with me.  Here is the code:
http://fisheye.jboss.org/browse/JBossAS/branches/Branch_5_x/tomcat/src/main/org/jboss/web/jsf/integration/config/JBossJSFConfigureListener.java?r=92409

My thought was that we need to put the instance into JNDI anyway, so I might as well get it from there.  I understand JNDI a lot better than MC.  But if you want to do it using MC then you just need to change this method:

  | private void addBeanValidatorFactory()
  | {
  |   this.servletContext.setAttribute(BeanValidator.VALIDATOR_FACTORY_KEY,                                                                Validation.buildDefaultValidatorFactory());
  | }

The ServletContext attribute must be set as shown, but we just need to get the VF instance that is created at deployment time instead of calling buildDefaultValidatorFactory().

If you decide to do it then please commit your code against this jira:
https://jira.jboss.org/jira/browse/JBAS-7178

Stan

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251201#4251201

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251201



More information about the jboss-dev-forums mailing list