1

I am converting a project from Seam to CDI and I am quite new in these fields. I am stuck in converting @Startup, @Cretae, @RequestParameter , @Out , @AutoCreate ,@ Destroy tags, what is the alternative for these tags in Weld CDI?

Yashar
  • 1,122
  • 2
  • 15
  • 43

3 Answers3

1

There's an @Startup EJB annotation and the @PostConstruct annotation that map to what you're looking for. Have you seen the migration bit on jdf http://www.jboss.org/jdf/migrations/seam2/open18_migration/ ?

LightGuard
  • 5,298
  • 19
  • 19
  • Thank you , that was a very useful link. It solved some of my problems :) – Yashar May 02 '13 at 14:48
  • Do you have any idea about the replacement for @Out and RequestParameter. Can we outject in Weld? – Yashar May 02 '13 at 14:51
  • No, there is no outjection. Use Producers. RequestParams are not in there either. Might be a worthwhile extension to write. – LightGuard May 03 '13 at 03:15
  • If you want to inject request parameters and use JSF2 you could take a look at this: http://stackoverflow.com/questions/13239975/depedency-inject-request-parameter-with-cdi-and-jsf2 – Karl Kildén May 03 '13 at 12:19
1

Also, you can use @Disposes in your CDI objects to destroy a produced object, @PreDestroy would do it if it's an auto created bean whereas @Disposes destroys an object created by @Produces. @Produces is the rough equivalent of @Out.

@RequestParameter can be brought in via Solder Servlet, no direct equivalent in CDI directly.

John Ament
  • 11,595
  • 1
  • 36
  • 45
1

Check this automated Seam to CDI conversion application:

https://github.com/jharting/classic

Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277