I am new to vaadin I came from GWT based project where we have persistence and business logic as Java EE modules and web client as Java Web app. Now I have my modules ready with my app logic intact the only problem I am having now is how to inject my beans to vaadin app because using the vaadin cdi addon, I can only inject classes from the vaadin app. Is there a way I can inject my classes? I added the classes to my vaadin app as dependencies. Any help please?
This should work, but there are some issues, especially with some environments. Makes sure you use the latest Vaadin CDI release. With the current 1.0.2 there are this kind of issues with some servers, but the workaround is to upgrade the project to use explicitly DeltaSpike 1.2.1. I a helper project that does this and adds also some handy helper libraries called vaadin-java-ee-essentials. If you don't want to start using it, check its pom.xml how Deltapike version can be upgraded. An example that uses it.
If you can't make it work, let me know more about your server and setup so we can fix it.
Related
I have created a server-side rendering react app using .net core (which is already given by .net core).
I want to have more than one react app inside .net core app.
I didn't get any related links to it.
Please help me with this.
Thanks
You can use webpack to make multiple react builds from different react projects. Then when you use SSR in your .net core controllers, you can set different views using multiple view layouts or just views, each targeting a different react app. - Of course you'll need to dig deeper since what you are asking is a lot of setup and coding but this is one possible solution.
Write your react apps / if you are using create-react-app, use the 'eject' feature to get the hidden files so you can expand on them.
Use one Webpack config to make separate builds
Make multiple controllers with SSR or one that selectively issues view pages based on your use case - SPA Services SSR is gone in .net core 5, you can still use core 3.1 or there are many libs in the works and require some reworking your startup setup and controller
Add View pages or Razor pages targeting the react app
This is not the only way but will get you going with the least amount of fuss.
Webpack is the key here, hope this helps you in the right direction.
I am trying to build an Enterprise System that will evolve over time with features being added as time progresses.
I am planing to go with ASP.Net Core microservices architecture with Angular for the UI. I am unable to find a sample that shows how we can introduce new modules without changing any existing angular code.
I was able to do this in the traditional winforms applications using technology like MEF and dropping the dll in to a folder that shell watches and loads.
Looks like there is no such example using the Angular framework. So I was curious if its even possible to achieve an architecture as shown below?
Module are the asp.net core services that serve the angular files that the shell can render and Service are the logic services that are used by the applications themselves.
I did see this post, that is close to what I want to do, but I am not sure if this is even the right solution being discussed.
Any pointers appreciated.
I tried to implement a plugin architecture making use of ABP, Angular and ASP.NET Core: https://github.com/chanjunweimy/abp_plugin_with_ui
Basically, I developed angular plugins using different angular application, then I dynamically add them together.
More Information on how I achieve it:
I have 2 angular-cli application, 1 is the main angular cli application, and another is the plugin angular cli application. The problem we are facing in Angular-cli plugin architecture approach is how we integrate them.
Right now, what I did was, I run ng-build on both of the applications, and put them into a "wwwroot" folder, which then hosted in a ASP.NET core 2.0 server.
abp_plugin_with_ui is a repository which works on developing a plugin which contains both the backend and Angular cli. For the backend, I made use of the aspnetboilerplate framework, which the frontend is developed using multiple angular-cli application.
To have the main application integrated with the plugin application, we have to run "ng-build" on both of the application (note that we have to change to href of the plugin application as well), then we move the built contents of plugin angular cli application, to the main application "wwwroot" folder. After achieving all this, we can then run "dotnet run" to serve the ASP.NET Core 2.0 Web Application to host the static files generated by "ng build". In this approach, plugin Angular UI applications are independent from the main Angular UI application: they are connected using IFrame.
Recently, I realized that we could create components on the fly, which means that maybe it is better to download the "NgModule" and create that module dynamically instead. This option is better because plugins UI would directly integrated into the main application UI. I am still trying out this method.
Another option suggested by #bruno was to develop the UI in SOA instead. This means that, we could choose not to separate the UI into plugins, but separate them into modules as independent service instead. You need to have a so-called "IT/Ops Client" that could help you manage what view to show in the UI, and the main UI is just a frame/template that will show what "IT/Ops Client" want to show. Using this way, we could register these services, and chose what service to be used. This is the microservice architecture and might be closed to what you want. The microservice expert Udi Dahan has a post blogged about this (link: http://udidahan.com/2014/07/30/service-oriented-composition-with-video/)
In my Xamarin Forms project i have following architecture:
A portable project which handle common gui stuff and is inherited by each mobile platform project.
Portable Common project which handles all logic stuff and is inherited by each mobile platform project.
I'm planning to use MVVM Light libraries and SimpleIOC.
Now to the question, in my portable project with common gui stuff i can add a servicelocator (to handle all the viewmodels) to App.cs so that's fine.
But how can i add it to the common project, to handle services and other logic stuff ?
You won't need an instance of ServiceLocator in every library.
Let's say you got a class LibraryDependency in your library and register it to a ServiceLocator in the library, your main ServiceLocator can't resolve the dependency if you add it to a ViewModel contructor.
Just register all desired dependencies to the SimpleIoC container in your (executable) main project.
I can create a minimal web application by using the maven-archetype-webapp .
Now I want to make my webapp Spring-Web-MVC powered.
Can I directly modify my POM, and how?
What's the best practices for the folder structure, and so on?
Can you show me a spring web mvc archetype, or a hello world example?
The STS (Spring Source Tool Suite) ships with the Spring Template Project, this project wizard will create a simple Spring MVC webapp + maven support.
Hope this helps
You can refer the step-by-step instructions, under the below link.
http://webapptutorials.wordpress.com/category/spring-mvc/
Maven Overlays document describes in great detail how web application should be structured using Maven. Here you'll find my simple Spring MVC showcase (REST-oriented).
Of course you are allowed to modify pom.xml (if the file is so complicated that users are afraid to modify it, then there must be something wrong with Maven...)
The only Spring-specific convention is to place general applicationContext.xml file under /WEB-INF - but this can be easily overridden.
You may also want to look using appfuse to bootstrap your spring-mvc application.
In our organization, we'd like to use JSF 2.0, Primefaces and Spring Webflow on a fresh big web app project. In examples we see that those stack integrates well enough.
But we are concerned about the development activity and support for Spring Webflow. In the project JIRA there are releases that are long overdue. Is SWF going to be discarded from Spring Portfolio and not supported any more? Should we use it in our fresh projects?
There are major alternatives for the backend of JSF other than Spring WebFlow like Seam3 and Java EE's CDI.
According to this article, in STS 2.6 there is a graphical Web Flow editor, so it's not totally abandoned, though in fisheye there is basically no activity, download page isn't refreshed to newest version etc.
Unless you have have some serious reason (like having developers with massive JSF knowledge), I'd recommend against Web Flow and would go for GWT or Wicket. (Though if I'd go the JSF way, I'd choose exactly the stack you described)