我改了下终于改好了,改到一个另外的一个类里面别放在@Controller类里,因为这里有直接扫描的代码,总之很矛盾
package com.wanju.project001.zonghe.common.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.wanju.project001.zonghe.common.interfaces.IUserOperation;
import com.wanju.project001.zonghe.common.model.Article;
import com.wanju.project001.zonghe.common.model.RequestScopeBeanTestBean;
@Controller
@RequestMapping("/article")
public class UserController {
@Autowired
IUserOperation userMapper;
// @Autowired
// RequestScopeTestBean requestScopeTestBean;
@RequestMapping("/list")
public ModelAndView listall(HttpServletRequest request,HttpServletResponse response){
List<Article> articles=userMapper.getUserArticles(1);
ModelAndView mav=new ModelAndView("list");
// System.out.println(requestScopeTestBean.getName());
RequestScopeBeanTestBean requestScopeBeanTestBean = new RequestScopeBeanTestBean();
requestScopeBeanTestBean.test();
mav.addObject("articles",articles);
return mav;
}
}
|
#1 得分:5
回复于: 2009-09-02 02:27:56
|
|
#2 得分:0
回复于: 2009-09-02 07:23:39
| |
|
|
#3 得分:5
回复于: 2009-09-02 07:35:18
|
#4 得分:0
回复于: 2009-09-02 15:33:10
| |
|
#5 得分:15
回复于: 2009-09-02 23:36:23
|
#6 得分:0
回复于: 2009-09-03 22:11:42
| |
#7 得分:5
回复于: 2009-09-03 22:16:47
| |
#8 得分:5
回复于: 2009-09-03 22:39:48
| |
|
#9 得分:10
回复于: 2009-09-03 22:43:04
|
|
#10 得分:0
回复于: 2009-09-03 23:10:25
|
|
#11 得分:5
回复于: 2009-09-03 23:17:41
|
#12 得分:0
回复于: 2009-09-06 16:46:54
|