| Constructor and Description |
|---|
HomeController(UserDao dao,
UserInfo userInfo,
Result result,
Validator validator)
You can receive any dependency on constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
login()
We should not provide direct access to jsps, so we need to have an empty method
for redirecting to jsp.
|
void |
login(String login,
String password)
Since we are using the convention, the URI for this method is
/home/login
The method parameters are set with request parameters named
login and password.
|
void |
logout()
Using the convention, the URI for this method is
/home/logout
|
public HomeController(UserDao dao, UserInfo userInfo, Result result, Validator validator)
Result and Validator
- all of your classes annotated with @Component, e.g DefaultUserDao
- all of the classes that have a ComponentFactory, e.g Session or SessionFactory@Post public void login(String login, String password)
public void logout()
@Get public void login()
Copyright © 2014 Caelum. All Rights Reserved.