View RSS Feed

HTTP

HTTP and Spring

  1. How to Handle Input with Spring MVC

    by , 11-29-2011 at 02:57 AM
    Spring MVC is structured to handle state management, workflow and validation. It is an application of the Model-View-Controller pattern. As with all things Spring, it follows the principles of loose coupling and flexibility. When a request is made, it reaches the DispatcherServlet whose role is to forward the request to the relevant Spring MVC controller, it is the controller that processes the request. In this article we will look in depth in what a Spring Controller does when it processes input. ...
  2. RESTful POST Method in Spring

    by , 11-28-2011 at 01: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 01:41 PM by Spring Framework

    Categories
    REST , HTTP
  3. RESTful DELETE Method in Spring

    by , 11-28-2011 at 12: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 01:40 PM by Spring Framework

    Categories
    HTTP , REST
  4. RESTful PUT Method in Spring

    by , 11-28-2011 at 12: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 01:39 PM by Spring Framework

    Categories
    REST , HTTP
  5. Key REST Verbs

    by , 11-28-2011 at 12: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 01:39 PM by Spring Framework

    Tags: rest, spring, verbs Add / Edit Tags
    Categories
    REST , HTTP
  6. Request Interception with Spring Security

    by , 11-27-2011 at 10:54 PM
    This is the last of a series of tips on Spring Security. From my previous tips, you should be able to configure Spring Security as well as setup login and logout. In the last tip, I will show you how to intercept requests. The <intercept-url> element is the key in the request-level security. Its pattern attribute is provide with a URL pattern that will be matched against incoming requests. If any requests match the pattern, then the <intercept-url>ís security rules will be applied. So ...