dev@glassfish.java.net

Re: Problem looking up the LocalSession on JSF Validator...

From: <jacob_at_hookom.net>
Date: Mon, 05 Jun 2006 15:57:52 -0400

You can provide a non-scoped managed bean to do this kind of business logic and then specify your validator via EL.

<h:inputText value="#{bean.prop}" validator="#{biz.validate}"/>

public class Biz {

  @EJB
  private MyLittleLocal localBean;

  public void validate(FacesContext, UIComponent, Object) throws ValidationException {
    if (!localBean.bizTest((BizObject) obj)) {
       throw new ValidationException(...);
    }
  }
}

>Hi Dyego,
>
>Dyego Souza Dantas Leal wrote On 06/05/06 11:58,:
>
>> I have a JSF Custom Validator on my jsf project , and this project
>> have a EJB project...
>>
>>
>> I need to access a SessionBean with Local Inteface...
>>
>> But... the JSF Spect not inject if i try
>>
>> @EJB
>> private MylittleLocal localBean;
>>
>> And the GlassFish not expose the LocalInterface in JNDI ( only remote
>> as package.RemoteInterface )
>>
>> Exists way to access with LocalInterface this bean ?
>
>
>Looks like you've filed this as
>
> https://glassfish.dev.java.net/issues/show_bug.cgi?id=704
>
>This issue was closed as invalid, because according to the JSF spec,
>only managed beans, but not JSF validators are subject to dependency
>injection.
>
>
>Jan
>
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>