Web??ò????bookstore?????????
???????????? ???????[ 2016/6/14 11:27:32 ] ??????????????? WEB????
????1????д????????????????????????Action????в???????????????????????????????????
?????????????UserAction??????ж????????????????????????????
public String register() throws Exception{
if("" == user.getUsername()||""==user.getPassword()){
return "error";
}
else{
userService.saveUser(user);
return SUCCESS;
}
}
?????????UserAction????????????????
package org.easybooks.bookstore.action;
import org.easybooks.bookstore.service.IUserService;
import org.easybooks.bookstore.vo.User;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/*
* ???????????
* Actor???????
* */
public class UserActionTest {
@Test
public void testRegisterSuccess() throws Exception {
BeanFactory factory = new ClassPathXmlApplicationContext("applicationContext.xml");
User user=new User();
user.setUsername("WYH");
user.setPassword("123456");
user.setSex("?");
user.setAge(23);
UserAction userAction=new UserAction();
userAction.setUser(user);
userAction.setUserService((IUserService)factory.getBean( "userService" ));
String result=userAction.register();
System.out.println("???:"+user.getUsername()+"???"+result);
}
}
?????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11