Skip to main content

[javaee-spec users] [jsr342-experts] [jsr345-experts] Bean Validation aligment in EE 7 (was [jsr345-experts] Bean Validation support for EJBs?)

  • From: Antonio Goncalves <antonio.goncalves@...>
  • To: jsr342-experts <jsr342-experts@...>
  • Cc: Emmanuel Bernard <emmanuel@...>
  • Subject: [javaee-spec users] [jsr342-experts] [jsr345-experts] Bean Validation aligment in EE 7 (was [jsr345-experts] Bean Validation support for EJBs?)
  • Date: Sat, 27 Oct 2012 17:49:41 +0200
  • List-id: <jsr342-experts.javaee-spec.java.net>

Hi all,

A few months ago in the EJB 3.2 EG ML we talked about aligning BV in EJBs. We've also exchanged a few emails with Emmanuel Bernard (CCed) about BV aligment in other  specification. As a developer I expect BV method level validation to work in every EE specification. What do you think ? If it's the case, I would expect this to work :


@WebServlet
public class MyServlet {

    public void doGet(@NotNull HttpServletRequest req, @NotNull HttpServletResponse resp) {}
}

or

@WebService
public class MyWS {

    @WebMethod
    @NotNull
    public String methodA(@WebParam(name = "myParam") @NotNull String s )
}


So that means a JAX-WS update will have to be made (JAX-WS 2.3 ?). With WebServices that would also mean that BV will be integrated with JAXB (but I think it's planned, Emmanuel correct me if I'm wrong). 


What do you think ?
Antonio


On Wed, Aug 29, 2012 at 10:05 AM, Antonio Goncalves <antonio.goncalves@...> wrote:
Hi all,

With the new Bean Validation 1.1 method-level validation I expect something to work out of the box (with or without CDI) :

@Stateless
public class AccountService {

    public Account get(@NotNull Account model) { }
}


As for Stateful bean the question is "is there a possible integration between BV and EJB like JPA or JSF" ? For example, in the following code, shall we automatically validate the bean on @Remove (like @PreRemove on JPA) :

@Stateful
public class ShoppingCart {

    @NotNull
    private List<CartItem> cartItems;

    @Remove
    public voide checkout { // validate cartItems ? }
}

I don't really see the point in something like that, but I might miss something. Could there be another possible integration ?

Antonio

On Wed, Aug 29, 2012 at 12:41 AM, Marina Vatkina <marina.vatkina@...> wrote:
Experts,

As you know, EJB spec currently doesn't support Bean Validation. Do we want to change that?

Let me know if you think that:

a) BV should be supported for EJBs without CDI being enabled (probably with an opt-in flag to be backward compatible)
b) BV should be supported for EJBs only if CDI is enabled
c) there is no need for standardizing BV with respect to EJBs
d) you don't care either way :(


thanks,
-marina


--
Antonio Goncalves
Software architect and Java Champion

Web site | TwitterLinkedInParis JUG | Devoxx France


[javaee-spec users] [jsr342-experts] [jsr345-experts] Bean Validation aligment in EE 7 (was [jsr345-experts] Bean Validation support for EJBs?)

Antonio Goncalves 10/27/2012

[javaee-spec users] [jsr342-experts] Re: [jsr345-experts] Bean Validation aligment in EE 7 (was [jsr345-experts] Bean Validation support for EJBs?)

Antonio Goncalves 10/29/2012

[javaee-spec users] [jsr342-experts] Re: [jsr345-experts] Bean Validation aligment in EE 7 (was [jsr345-experts] Bean Validation support for EJBs?)

Pete Muir 10/29/2012
 
 
Close
loading
Please Confirm
Close