This repository was archived by the owner on Dec 12, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
spring-boot/00-the-basics/src/main/java/com/stormpath/tutorial/controller
spring/00-the-basics/src/main/java/com/stormpath/tutorial/controller Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11package com .stormpath .tutorial .controller ;
22
33import com .stormpath .sdk .application .Application ;
4- import com . stormpath . sdk . servlet . application . ApplicationResolver ;
4+ import org . springframework . beans . factory . annotation . Autowired ;
55import org .springframework .web .bind .annotation .RequestMapping ;
66import org .springframework .web .bind .annotation .RestController ;
77
1010@ RestController
1111public class HelloController {
1212
13+ @ Autowired
14+ Application app ;
15+
1316 @ RequestMapping ("/" )
1417 public String hello (HttpServletRequest req ) {
15- Application app = ApplicationResolver .INSTANCE .getApplication (req );
1618 return "Hello, " + app .getName ();
1719 }
1820}
Original file line number Diff line number Diff line change 1616package com .stormpath .tutorial .controller ;
1717
1818import com .stormpath .sdk .application .Application ;
19- import com . stormpath . sdk . servlet . application . ApplicationResolver ;
19+ import org . springframework . beans . factory . annotation . Autowired ;
2020import org .springframework .web .bind .annotation .RequestMapping ;
2121import org .springframework .web .bind .annotation .RestController ;
2222
2828@ RestController
2929public class HelloController {
3030
31+ @ Autowired
32+ Application app ;
33+
3134 @ RequestMapping ("/" )
32- public String hello (HttpServletRequest req ) {
33- Application app = ApplicationResolver .INSTANCE .getApplication (req );
35+ public String hello () {
3436 return "Hello, " + app .getName ();
3537 }
3638}
You can’t perform that action at this time.
0 commit comments