View RSS Feed

Spring Framework

SpringSource Spring Framework tutorials and examples. Focusing on Spring 3 and above.

  1. Finding the Appropriate View in Spring

    by , 11-28-2011 at 02:19 AM
    In my previous tips we have gone through calling the appropriate RESTful methods, returning the results, and the initial parts of the determining the view involving determining the appropriate media type and looked at factors that could influence that decision. In the last tip on RESTful services I will show how the appropriate view is selected.

    Given that our previous post focused on the ContentNegotiatingViewResolver, one would expect that this view resolver directly resolves the ...

    Updated 11-30-2011 at 02:52 PM by Spring Framework

    Categories
    View Helper , MVC , REST , Resource
  2. Factors Influencing Media Type Selection in Spring

    by , 11-28-2011 at 02:17 AM
    In my previous tips, we looked at the components Spring uses to determine the appropriate media type for the results returned. We know that the ContentNegotiatingViewResolver is used to determine what the appropriate media type is for the results. I will discuss the second part of the strategy used for making this determination. This involves factors that influence the requested media type(s).

    After the ContentNegotiatingViewResolver has determined the requested media type, there ...

    Updated 11-30-2011 at 02:51 PM by Spring Framework

    Categories
    Spring 3 , Resource , MVC , REST
  3. RESTful POST Method in Spring

    by , 11-28-2011 at 02:02 AM
    In my previous tips, I have shown you how to write RESTful methods for GET, PUT and DELETE. In this tip, I will tackle the method which is probably the most used (and abused), the POST method.

    The POST method is the one method that you need to be most mindful of. First it is not safe and second it is not idempotent. Therefore you must take extra care in how you design your URL as well as your method . In this case, I will add another method to the CarController that creates a new ...

    Updated 11-30-2011 at 02:41 PM by Spring Framework

    Categories
    REST , HTTP
  4. RESTful DELETE Method in Spring

    by , 11-28-2011 at 01:59 AM
    Continuing on my previous tip, of showing how to write RESTful methods, in this tip, I will show you how to write RESTful methods using the verb HTTP Verb, PUT.

    There are times when we might want to get rid of a resource in its entirety. In the case we would use the HTTP DELETE method in order to accomplish this. In this case, I will add another method to the CarController that handles the DELETE requests to remove a Car resource:

    Java Code:
    @RequestMapping(value="/{id}",
    ...

    Updated 11-30-2011 at 02:40 PM by Spring Framework

    Categories
    REST , HTTP
  5. RESTful PUT Method in Spring

    by , 11-28-2011 at 01:56 AM
    In my previous tip, I looked at the verbs available for RESTful services. In this tip, I will show you how to write RESTful methods using the verb HTTP Verb, PUT.

    The purpose of the PUT methodís is exactly as it states. Is serves to transfer the resourceís state from the client to the server. For an example of this, please see the following method that Iíve created for putCar() that is annotated to receive a Car object from a PUT request:

    Java Code:
    @RequestMapping(value="/{id}",
    ...

    Updated 11-30-2011 at 02:39 PM by Spring Framework

    Categories
    REST , HTTP
  6. Key REST Verbs

    by , 11-28-2011 at 01:54 AM
    In my previous tip, I looked at setting up RESTful Controllers. Now in the post we will look at the verbs available for RESTful services. . Although this is nice for writing RESTless controllers, it is not ideal for writing RESTful controllers. The reason is that controllers made in this way are action oriented and not resource oriented. This can be easily surmised by the names used for the different requests which are focused on the particular use cases but not on the resources.

    ...

    Updated 11-30-2011 at 02:39 PM by Spring Framework

    Tags: rest, spring, verbs Add / Edit Tags
    Categories
    REST , HTTP
  7. RESTful Controllers in Spring

    by , 11-28-2011 at 01:47 AM
    In my previous tip, I presented to you an overview of how to handle RESTful URLs. In this tip, I will followup will look at RESTful Controllers. From my previous posts, I believe you have surmised that Spring MVCís model is a very flexible framework for for writing controller classes. Almost any method with almost any signature can be annotated to handle a web request. Although this is nice for writing RESTless controllers, it is not ideal for writing RESTful controllers. The reason is that controllers ...
    Categories
    Spring 3 , MVC , Controller , REST
  8. RESTful URLs in Spring

    by , 11-28-2011 at 01:31 AM
    In my previous tip, I presented to you an overview of Spring support of REST. In this tip, I will followup with a tip for look at RESTful URLs.

    If you want to create a RESTful controller, you will need to handle URLs in a RESTful way. Thatís because everything thatís done in REST is done through a URL. The URLís RESTful nature is even implied by itís name, uniform resource locator. Given that name, it seems that a URL is intended to locate a resource. Above and beyond this, URLs ...

    Updated 11-30-2011 at 02:37 PM by Spring Framework

    Categories
    Web , Web Service , REST
  9. REST Services in Spring

    by , 11-28-2011 at 01:28 AM
    In Spring 3.0, the Spring team added support for Representational State Transfer (REST). It has emerged as a popular information-centric alternative to traditional SOAP-based web services. Spring developers have taken advantage of the REST architectural model to pack the Spring MVC with first-class support for working with REST. In this tip, we will look at the fundamentals of REST.

    In order to understand what REST is all about, it helps to break down the acronym into its constituent ...
    Categories
    Web Service , REST , Spring 3