Thursday, 15 January 2015

spring mvc - New implementation/method of existing request mapping in controller -


I am trying to find a way to extend an administrator, such as I can use existing request mapping But with a different implementation / method tied to it.

For example, suppose a piece of code under the AdminBasicEntityController in BLC where viewAddEntityForm Method / add request Linked to mapping Now I have to be my own logic to show the Unit Forum (Say Product Unit) using the / add request mapping. ? Is it possible to

  @Controller ( "blAdminBasicEntityController") @RequestMapping ( "/ {sectionKey .: +}") public class AdminBasicEntityController extends AdminAbstractController {@RequestMapping (value = "" method = RequestMethod.GET) public string scene Antitailist (Actiteepiarwlet request, Actiteepisrvet response feedback, model, Path Wheriabl map, string, string & gt; Pthwars, @RequestParam Maltivalumap & lt; string, string & gt; Anurodparm) exception {// Default action Implementation] // string entityType) throws Exception { "/ add" method = RequestMethod.GET) public String viewAddEntityForm (pathVars, @RequestParam (DefaultValue = "" HttpServletRequest request, HttpServletResponse response, models, @PathVariable Map & lt; String , string & gt) default implementation}}  

Also I AdminBasicEntityController , so I mean that I can control the specific unit. If so, How?

{@link #BroadleafAdminAbstractEntityController} default implementation It assigns to the Super each call and a custom-Silsijh does not provide functionality is responsible for providing the administrator of each unit which is not clearly customized by your administrator

@RequestMapping ( "/ {sectionKey :. +}") , the generic path variable < Code> sectionKey uses the controller to make any requests that are not clearly maped Is. For example,

  / product / product / add / category / category / add / store / store / add  

all can kill this controller If these URLs have not explicitly mapped their own controllers

To handle a specific URL yourself, you can.

  @Controller @RequestMapping ( "/ product") public class ProductAdminController {@RequestMapping ( "/ add") public String viewAddEntityForm (...) {...}}  

now, URL / Products / will be routed to the custom controller, while will continue to root for all other normal controller.


No comments:

Post a Comment