By using Spring 2.5,i have done a leave management project and it was adoptable.But in the reality,many of the controllers and other have been deprecated like "SimpleFormController",
"MultiController" ...so on in the other verion i.e 3.0.Iam little bit in secured ,does they reflect to my project like that.I know at some far,it is secured ,but not sure.suggestion are most welcome and your answers are more help full to me gain confidence.
No, in general spring controllers are not deprecated.
There is whole chapter about Controllers in Spring 4
Related
I have a Struts 1 application and I am exploring different options for upgrading the system. One option is Spring MVC or Spring Boot. If I were to choose either framework to migrate the application to, can I do so transitionally (piece by piece) or would it be a complete wholesale change or complete rewrite. Don't know if I'm making myself understood.
Spring 3.0, had explicit support for integrating struts 1. This was two major versions of spring and 9 years ago. There is documentation here:
https://docs.spring.io/spring/docs/3.0.5.RELEASE/reference/web-integration.html#struts
Integration consisted in either using the ContextLoaderPlugin to allow spring to manage all your action classes, or to make your action classes aware of the spring context. A fair amount of struts specific code was available to do things like map struts action handlers to action beans in the spring context.
You could probably reproduce a lot of this in spring 5, but you'd have to do a lot of heavy lifting on your own. There are probably very few struts/spring 5 users out there to help you.
You could also go with spring 3.0 to make the integration easier, allowing you to do the migration in steps, but then you are in a different bad place. You have an old version of spring that fewer people use, and none of the goodness that 9 years of releases have wrought.
If you want to migrate your struts 1 app to spring, you are probably going to have to do it all at once. Redo your action classes as springmvc controllers and then rewrite your views (templates). spring mvc is pretty view agnostic and there are many good choices.
Good luck and have fun!
I have used spring 3 but not sure what is the equivalent of a grails plugin. And now need to suggest a stack for a new app. Looking at grails it seems to be great for making data base models and has a lot of plugins. but it seems its more expensive at runtime.
So my question is that is there a equal or better repo of spring for every little thing you can need like facebook login or other social actions, ajax upload, joda etc or is this what we call a dependency and some code from a blog/ stack?
Is there any repo of small reusable code like we have on grails plug ins for regular spring mvc projects?
I know that your question is about pure spring alternatives, but I would honestly recommend just using Grails. I've done projects in both stacks. If you want to get rid of the configuration headaches and get started quickly on a new project while staying within the Spring stack, it is the way to go. It is a great framework and some of my employers have many production Grails applications supporting thousands of customers.
You can also upgrade to Grails 3 when it comes out next year and take advantage of the leaner code they provide in it due to Spring Boot!
You may need to check into Spring Boot. It does not provide a full stack framework, but it is hiding much of the extra coding you may need to do for a spring application. There are some new projects that enable you to get the benefits of spring boot. Check the below projects:
1- http://jhipster.github.io/ , use it if you need to make SPA with AngularJS also have commands to generate Entities for you using Yeoman
2- http://lightadmin.org/ , use it if you want to create CRUD pages based on Spring Data Entities
For both, you may have to use Spring Data and maybe even Spring Data REST. These may be helpful too.
I am learning Java EE and wanna build up a complete management system for a restaurant. Now I am confused what presentation layer should I use for my RMS because I heard that the struts 2 is one of the best UI layer but, the thing is, if I am using spring for my business logic layer then I can use the spring MVC can't I? By the way, I am really interested to build a complete application which is follow the multi-tier architecture.
Yes, of course you can use Spring MVC.
You can use Struts 2 if you'd like as well, because Spring integrates with it nicely.
But I don't see any reason why you'd want to do that. The person who told you that Struts 2 is
one of the best UI layer [sic]
is misguided. If you compare it to Spring MVC, you'll see that the two are based on similar ideas, but Spring improves on Struts. JSF has superceded Struts as the default Java EE web view technology, so it's not even considered "best" by the Java EE standard.
Stick with Spring. You won't be sorry.
I will not blame struts 2, indeed it's a great product, I work with it every day. But in my experience spring MVC is a lot simpler and clearer. This doesn't mean you don't get as much features.
Try both, and you'll see what I mean.
Tell us which one you choose!
I'm building a menu with Spring and I'm trying to understand if there is a clean way of doing this. By clean way I mean some module that allows the following:
create a link on a menu entry only if the page shown is not the one to be linked;
apply some CSS class depending on the condition above.
I've just ran accross the spring:url tag: does it have anything to do with what I'm looking for?
No, this is a complexity of user interface way beyond that offered by Spring MVC. You need something higher-level such as JSF or maybe a javascript framework like jquery-ui.
Of course, you could build it yourself using the low-parts provided by Spring MVC, but it's going to be a lot of work.
I would recommend you to have a look at Tiles 2 in combination with SpringMVC. Sample app available on Spring By Example, search for Simple Tiles 2 Spring MVC Webapp.
(I am not familar with technologies related to HTML delivery, like JSP... But I know basic concepts...)
In my application I use Spring Beans and Spring Security together with Blaze DS to communicate with Flex applications over AMF protocol. Everything works just fine.
Now I have a task to deliver some services via HTTP/HTML eg. it should be some sort of servlets or JSP pages that generates HTML for users. To not reproduce all business and data access logic I want to utilize my existing Spring Beans (I love Spring.). So, basically I want to create HTML view for my Spring Beans.
My question: What would be the best way to do it? Which technologies I should use? What guru-guys will suggest?
The best tip would be a link to small tutorial that will explain how to access Spring Beans for JSP pages. I tried to goole myself but there are too much information and I am a little bit nixed up with different version - so I really have no clue what should I start with...
You should look into Spring MVC. You can find an introduction here.
Also the accepted answer to this question discusses how to do what you want specifically (i.e. access your Spring Beans from JSP pages).