Annotations used in SPRING

Annotations used in SPRING :

@Controller

@Component

@Autowired

@RequestMapping : annotation maps portlet requests to appropriate handlers and handler methods.

@RenderMapping :  is a method level annotation which is used to map render requests to render methods of handler class.

Ex: @RenderMapping(params = "render=viewSuccessPrint")

@ResourceMapping : @ResourceMapping(value = "getAutoCompleteListValues")

@ActionMapping  : Used to define separete actions in Controller class.
           (Save, Submit, FileUpload etc.)

@RenderRequest

@ResourceRequest

While ActionRequest and RenderRequest are distinct classes/objects, they all relate to the same request handling cycle. The main difference is that ActionRequest allows you to change state, RenderRequest does not any more.


import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.BindingResult;
import org.springframework.validation.DataBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.portlet.ModelAndView;
import org.springframework.web.portlet.bind.annotation.ActionMapping;
import org.springframework.web.portlet.bind.annotation.RenderMapping;
import org.springframework.web.portlet.bind.annotation.ResourceMapping;

Comments

Popular posts from this blog

Codity Test and results

TTD - Test Driven Development for Java Programmers