It's possible using Spring Web Mvc without annotations? - spring-mvc

I'm doing a training in computer consulting company.
The project manager gave me an exercise to do with spring web mvc where do I get the data sent from a form and I need to display them on another page. I did it, all right, and I used the annotation of spring mvc.
Now the project manager told me to do the reengineering exercise,
doing it without using the annotation.
I searched on 10 sites including:
tutorialspoint, html.it, mykong, and documentation of spring mvc web and I saw that spring web mvc only works with the annotation, the annotation that I used are nell'esrcizio # RequestMapping, # Controller, # ModelAttribute.
Thank you

You can use xml configuration refer this link, if it helps you then up vote please
http://examples.javacodegeeks.com/enterprise-java/spring/beans-spring/spring-3-hello-world-example/
http://www.mkyong.com/spring-mvc/spring-mvc-hello-world-example/

Related

ext-js with spring mvc integration

I am new to ext-js, I have gone through some sample of extjs. Now I need to integrate my existing Spring MVC application with ext-js. spring controller will act as rest controller and return the json data.
Now, as a best practices, do I need to create 2 different project for front end i.e one for purely ext-js project which does the UX layer and Spring rest controller which get the data from the back end and renders the json data. Or, should I create a single project which having both ext-js and spring-mvc code. Which one is better?
I am using ext-js version 5 and Spring 4.
Please find the below Link for the Integration of the Extjs with Spring MVC,Hibernate.
Ext JS 4 Spring MVC CRUD example

Backbone and spring mvc

Hi I am just starting to learn backbone.js and now I am trying to integrate it with spring mvc, I looked everywhere for a simple example using the two to get an idea how it works but all I found was a few complex examples which I tried and failed to understand.Could you please provide me examples and help me do a simple hello world example using Backbonejs and spring mvc.
If you are familliar with the usage of Spring MVC, you can try using the "jackson" extension on your controllers. Jackson has the ability to turn your data requests into replies that are in the form of Data Transfer Objects (specifically JSON).
Since Backbone.js will handle all of your frontend needs, it is alright to use only the Model and Controller parts of the Spring MVC framework. Backbone.js's models will therefore consume your jackson integrated Spring MVC rest service, and can the be rendered in Backbone Views.
Yo can start with Spring Getting Started Guide "Consuming a RESTful Web Service with Backbone.js"
Or go for a full stack like RESThub with the "Spring Stack tutorial".

Spring MVC portlet IBM WPS

In my job there was a debate about using Spring MVC portlet with IBM WPS, and architect is insisting it is have problem to use it without providing any reference, anyone have any input in this discussion based on actual experience, or any reference talking about issue of using Spring MVC portlet with IBM WPS, or have any reference can I use to show comparison of using Spring MVC portlet or other frameworks?
The standard Spring portlet MVC portlets work well. However they don't offer the fancy components offered by JSF frameworks.
Check out the spring documentation for getting started. You can check the outdated pet portal, not sure if it is working with 3.2 though.

Is there any ASP MVC 3 framework for a restful api?

I've been doing some digging in the web but all i find is either incomplete guides to do it by yourself or guides for the first version of MVC.
Is there any framework for getting a RESTful API or not?
And if no, is there anyway to add a global solution for all models (extending the model or routing of MVC it self), because what i've read involves adding the REST logic to each model/ controller of the application (Which don't look like a good solution to adopt REST)
WCF Web API for MVC3
Add WebAPI support to MVC3 application
Both of these should give you an idea of what's involved.
Are you able to start using MVC4?

ASP.NET MVC & Web Services

Does adding a Web Service to my ASP.NET MVC project break the whole concept of MVC?
That Web Service (WCF) depends on the Model layer from my MVC project to communicate with the back-end (so it looks to me like it needs to be part of the MVC solution).
Should I add this to the Controller or Model layer?
It sounds like you should split out your model into its own assembly and reference it from your MVC-application and WCF-application.
YourApp.Data -- Shared model and data access maybe
YourApp.Web -- If you want to share more across your web-apps
YourApp.Web.Mvc
YourApp.Web.WebService
If you want to do WebServices MVC-style maybe you should use MVC to build your own REST-application.
Is there a specific reason you need to add web services to your MVC application? Unless there is a specific reason you should use your controllers in a RESTful manner just as you would a RESTful web service.
Check out this post from Rob Connery for more information:
ASP.Net MVC: Using RESTful architecture
Separating the Model into it's own project is not breaking the "MVC" pattern. First off, it is just that -- a pattern. The intention of the MVC pattern is to clearly delineate between your data, the data handlers, and the presenters and the way you interface between them. The best way to do it is how Seb suggested:
YourApp.Data
YourApp.Web.Mvc
YourApp.Web.WebService
Something that might help you out is the MVC Storefront that Rob Conery put together. Go watch the video's here:
MVC Storefront Video Series
And if you want to look at the actual code in your browser to quickly see how he did it, go here:
MVC Storefront Codeplex Code Browser
I don't think separating the model into it's own assembly has any bearing on whether or not you're using MVC, you still have a model. Where it is is irrelevant surely?
I've had a go at doing this.
See my result at my blog
ps: I don't believe that this will break the MVC concept so long as you think that a web service is the model of a repository because all a web service does is returning a XML dump.
I have added web services to my application and it works well. I don't believe it violates MVC because it is an alternative interface to your model. MVC is not appropriate for web services because web services don't have a view.
Think of web services and databases as one in the same. Under this analogy, I think it makes sense to place your web service ingteractions where you place your database logic.

Resources