@Controller
public class ResultAction {
private Result result;
public Result getResult() {
return result;
}
public void setResult(Result result) {
this.result = result;
}
@RequestMapping("/index.do")
public String queryAllGoods(){
System.out.println(result.getUser()+"===============");
}
}
jsp页面:
<input type="text" name="result.id"/>
<input type="text" name="result.user"/>
<input type="text" name="result.comment"/>
最后始终报空指针,在result的set方法上加@Resource和@Autowired也不行,怎么才能让jsp提交的那些属性注入到ResultAction中呢??
不行的