Package ball.spring.jig
Class BeanRestController
- java.lang.Object
-
- ball.spring.jig.BeanRestController
-
- All Implemented Interfaces:
Aware
,ApplicationContextAware
@RestController @RequestMapping("/jig/bean/") @ResponseBody public class BeanRestController extends Object implements ApplicationContextAware
BeanRestController
implementation.Injected Field Summary
Annotation(s) Field - Author:
- Allen D. Ball
-
-
Constructor Summary
Constructors Constructor Description BeanRestController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleNOT_FOUND()
Object
json(String name)
void
setApplicationContext(ApplicationContext context)
Object
xml(String name)
-
-
-
Constructor Detail
-
BeanRestController
public BeanRestController()
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(ApplicationContext context)
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
-
json
@RequestMapping(method=GET, value="{name}.json", produces="application/json") public Object json(@PathVariable String name) throws Exception
- Throws:
Exception
-
xml
@RequestMapping(method=GET, value="{name}.xml", produces="application/xml") public Object xml(@PathVariable String name) throws Exception
- Throws:
Exception
-
handleNOT_FOUND
@ExceptionHandler({org.springframework.beans.factory.NoSuchBeanDefinitionException.class,java.util.NoSuchElementException.class}) @ResponseStatus(value=NOT_FOUND, reason="Resource not found") public void handleNOT_FOUND()
-
-