| 24349 |
amit.gupta |
1 |
package com.spice.profitmandi.web.config;
|
|
|
2 |
|
| 32170 |
jai.hind |
3 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
|
|
4 |
import com.spice.profitmandi.web.controller.AuthUserController;
|
|
|
5 |
import org.apache.logging.log4j.LogManager;
|
|
|
6 |
import org.apache.logging.log4j.Logger;
|
| 24349 |
amit.gupta |
7 |
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
|
| 32170 |
jai.hind |
8 |
import org.springframework.stereotype.Controller;
|
| 24349 |
amit.gupta |
9 |
import org.springframework.web.bind.WebDataBinder;
|
|
|
10 |
import org.springframework.web.bind.annotation.ControllerAdvice;
|
|
|
11 |
import org.springframework.web.bind.annotation.InitBinder;
|
|
|
12 |
|
| 32170 |
jai.hind |
13 |
@ControllerAdvice(basePackages="com.spice.profitmandi.*")
|
|
|
14 |
//@ControllerAdvice(basePackageClasses = AuthUser.class)
|
|
|
15 |
//@ControllerAdvice("com.spice.profitmandi.*")
|
|
|
16 |
//@Controller
|
|
|
17 |
//@ControllerAdvice(value = "com.spice.profitmandi.*")
|
|
|
18 |
//@ControllerAdvice(basePackages = {"com.spice.profitmandi.web.controller","com.spice.profitmandi.web.config","com.spice.profitmandi.*"})
|
|
|
19 |
//@ControllerAdvice(basePackages = {"com.spice.profitmandi.web.controller"})
|
| 24349 |
amit.gupta |
20 |
public class ControllerSetup
|
|
|
21 |
{
|
| 32170 |
jai.hind |
22 |
|
|
|
23 |
//private static final Logger LOGGER = LogManager.getLogger(ControllerSetup.class);
|
| 24349 |
amit.gupta |
24 |
@InitBinder
|
| 32170 |
jai.hind |
25 |
public void initBinder (WebDataBinder binder )
|
| 24349 |
amit.gupta |
26 |
{
|
| 32170 |
jai.hind |
27 |
// LOGGER.info("trimming successfully");
|
| 24349 |
amit.gupta |
28 |
StringTrimmerEditor stringtrimmer = new StringTrimmerEditor(true);
|
|
|
29 |
binder.registerCustomEditor(String.class, stringtrimmer);
|
| 32170 |
jai.hind |
30 |
|
|
|
31 |
// StringTrimmerEditor stringtrimmer = new StringTrimmerEditor(false);
|
|
|
32 |
// binder.registerCustomEditor(String.class,"last_name", stringtrimmer);
|
|
|
33 |
|
| 24349 |
amit.gupta |
34 |
}
|
|
|
35 |
}
|