berndhopp / guice Goto Github PK
View Code? Open in Web Editor NEWThis project forked from vaadin/spring
guice-integration for the vaadin-framework
Home Page: https://vaadin.com/directory#!addon/guice-vaadin-integration
This project forked from vaadin/spring
guice-integration for the vaadin-framework
Home Page: https://vaadin.com/directory#!addon/guice-vaadin-integration
The addon has a dependency on the vaadin
(platform) acrtifact and therefore you also get all transitive depencencies of that artifact when you use this addon in a project. In fact, the addon would only need the flow-server
and flow-html-components
dependecies. As a user i would like this addon to come with a minimal set of depenencies to have more control over them. Especially when it comes to the vaadin version I would like to use. As it is now, I always get all depencencies for the latest Vaadin release.
A lot has changed since vaadin8, a quick guide or minimalistic starter-project would be a nice to have.
Since Vaadin 10, the need to extend the UI class to enter an application has been substituted in favour of the the Router (Route annotation).
To quote the Vaadin documentation
Most things you have previously done in the UI class, can be achieved in alternative, better ways.
I would like to request a new mechanism, to complement the existing UI code, where the Guice Servlet is able to locate and dependency inject Routes without having to define a UI as a single initial entry point. The use of Routes also allows us to easily define multiple URL entry points easily using Vaadin 10 semantics.
Many thanks. If this capability already exists, please correct me via the comments below.
With Java 9+ a ConcurrentModification was thrown when the injection of ViewScope Views occured the first time.
The reason is the changed behavior of HashMap::computeIfAbsent. Now a ConcurrentModification is thrown, if the map is changed in the mappingfunction. This pull request seems to fix the problem: #17
`SEVERE:
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1 error
at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:226)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1053)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1086)
at com.vaadin.guice.server.ViewProviderBase.getView(ViewProviderBase.java:22)
at com.vaadin.guice.server.GuiceViewProvider.createView(GuiceViewProvider.java:95)
at com.vaadin.guice.server.GuiceViewProvider.lambda$getView$5(GuiceViewProvider.java:87)
at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1133)
at com.vaadin.guice.server.GuiceViewProvider.getView(GuiceViewProvider.java:87)
at com.vaadin.navigator.Navigator.navigateTo(Navigator.java:652)
at de.test.views.DefaultView.lambda$new$91da45c0$1(DefaultView.java:18)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:499)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:273)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:237)
at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1014)
at com.vaadin.ui.Button.fireClick(Button.java:384)
at com.vaadin.ui.Button$1.click(Button.java:57)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:155)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:116)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:445)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:410)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:274)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1601)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at ...`
Results :
Failed tests: ui_scopes_should_not_overlap_in_same_session(com.vaadin.guice.server.UIScopeTest): Values should be different. Actual: com.vaadin.guice.testClasses.UIScoped1@1d2bd371
ui_scopes_should_not_overlap_in_different_sessions(com.vaadin.guice.server.UIScopeTest): expected:<com.vaadin.guice.testClasses.UIScoped2@4cf8b2dc> but was:<com.vaadin.guice.testClasses.UIScoped2@708400f6>
Tests run: 13, Failures: 2, Errors: 0, Skipped: 0
I'm trying to set up some security javax.servlet.Filter
s in Vaadin 10 and I realized that injector is being created in servlet init()
, not in a context listener, thus not available during the filter init()
.
Is it really by design?
Is there any way to set a filter using the injector that would be able to filter the VaadinServlet itself?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.