0 votes
78 views
asked in JAVA by (8.2k points)
Hi

   I am very new java can one give sample code for @Controller and Why we need @Controller in java webservice?

1 Answer

0 votes
answered by (8.2k points)

Hi

  • @Controller is used to mark classes as Spring MVC Controller.
@Controller
public class restClassName{

  @RequestMapping(value={"/URL"})
  @ResponseBody
  public ObjectResponse restFunctionName(){
      return instance
   }
}

Categories

...