tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: TomEE and CDI
Date Sun, 04 May 2014 14:40:25 GMT
hi

do you have a beans.xml (even empty) in WEB-INF?


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-05-04 11:53 GMT+02:00 john77eipe <john77eipe@gmail.com>:
> I'm a start in CDI.
>
> To test CDI. I created 2 classes.
>
> public class Exam {
>         @Inject
>         private Student student;
>
>         private int examCode;
>
>         @PostConstruct
>         private void init(){
>                 System.out.println("Init in Exam");
>                 this.setExamCode(11);
>         }
> }
>
> public class Student {
>         private String name;
>
>         @PostConstruct
>         public void init(){
>                 System.out.println("Init in Student");
>                 this.name = "John Eipe";
>         }
> }
>
>
> Isn't it possible to do this in Servlet's doGet.
>
> Exam exam = new Exam();
> System.out.println(exam);
>
> But I don't see Injection happening.
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/TomEE-and-CDI-tp4669131.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message