guice-servlet & vaadin7

Hi, greetings from Argentina! And thanks for such a nice work at vaadin! :smiley:

I was trying to configure a web-app with vaadin7 and guice (using guice-servlet module).
It turns out that, VaadinServletSession uses a bunch a private methods till it calls

VaadinServletSession#createVaadinSession(HttpServletRequest)

which in turns uses an static factory-method

com.vaadin.server.ServletPortletHelper#initDefaultUIProvider(VaadinSession application, VaadinService)

So, given this situation, apart from copy&paste brutally all this code, changing the UI creation process, I don’t see any possibility of specialize VaadinServletSession to use guice-servlet (and all its posibilities).

Am I missing somethig? Should I copy&paste vaadin original code? Is this point under development?

As I was expecting a nice and easy integration between Vaadin&Guice (as it is with 6.x) I was shocked by this implementation details :frowning:

Best Regards,
Juanjo

ps: I’ve already see the implementation carried on by ‘codeturn’ which uses init events, but I would apreciate been able to use guice-servlet, not only guice :slight_smile:

I was mistaken, it is not

VaadinServletSession#createVaadinSession(HttpServletRequest)

it is:

VaadinServlet#createVaadinSession(HttpServletRequest)

I’m sorry :frowning:

Regards,
Juanjo

Hi Juan José,

the implementation over at
codeturm
uses guice-servlet. The BasicFilter extends com.google.inject.servlet.GuiceFilter which resides in guice-servlet.jar. The
BasicModule
extends ServletModule and cares about the servlet mapping.

Cheers,
Christian

ups!
I saw the code at googlecode, but as it was creating the Injector I assumed that it was using plain guice.
my fault.

but, to be 100% sincere, it still doesn’t like me the idea of listening an event to be able to create/inject the UI and its corresponding BI :S. It doesn’t feels good at my guts :frowning:

Is there another way to do IoC in vaadin 7?

To me, but this is 110% un-objective, vaadin 6 resolves this issue in much much cleaner way
Don’t you think?

regards,
Juanjo