yasonisme
2009-03-18 12:23
浏览 209
已采纳

DWR与struts spring 整合问题

请问怎么设置DWR 才能够访问getSummaryResult()这个方法 我配置的取值一直为空 或错误..
郁闷啊
@Scope("prototype")
@Service("summaryAction")
public class SummaryCallAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private static final Log logger = LogFactory.getLog(SummaryCallAction.class);

private SummaryTEntity summaryEntity;
private List<SummaryTEntity> summList = new LinkedList<SummaryTEntity>();

    private int    pageSize = 10 ;       //页明细数
private String sortCol ;          //动态排序
private String sortType;          //desc asc
private String queryCol ;         //动态查询 列名
private String queryValue;        //查询值
private List<DicContentEntity> msgTypeList ; 
private PageSplitUtil pageSplitUtil=new PageSplitUtil() ;

private String summNo = null ;
private List<DicContentEntity> callTypeList = null;
private List<DicContentEntity> custTypeList = null;
private List<DicContentEntity> channelTypeList = null;
private List<DicContentEntity> mainResultList = null;
private List<DicContentEntity> subResultList = null;
private List<DicContentEntity> summaryTypeList = null;
....
         set get方法
           ...

@Autowired(required = false)
private IBaseService baseService = null ;
public void setBaseService(IBaseService baseService) {
this.baseService = baseService;
}

@Autowired(required = false)
private IMsgService msgService = null ;

@Autowired(required = false)
private FlexDicHelper flexDicHelper = null ;
public void setFlexDicHelper(FlexDicHelper flexDicHelper) {
this.flexDicHelper = flexDicHelper;
}

//获取当前用户信息
@Autowired(required = false)   
    private UserDetailsSessionService  userDetailsSessionService;
public void setUserDetailsSessionService(
UserDetailsSessionService userDetailsSessionService) {
this.userDetailsSessionService = userDetailsSessionService;
}

public Map getSummaryResult(){
                  setDisplayDiv();

Map map = new HashMap(); 

for(int i=0;i<summaryTypeList.size();i++){ 

   map.put(summaryTypeList.get(i),(summaryTypeList.get(i)).getIdValue()); 
}
return map;
}
/**
* 新建加载
* @return
*/
@SuppressWarnings("unchecked")
public String preSave(){
summaryEntity = new SummaryTEntity();
  summNo = "";
    summaryEntity.setSummaryNo(flexDicHelper.getBussinessNo("summaryCall", "", ""));
  summNo = summaryEntity.getSummaryNo() ;
  summaryEntity.setAgentId(userDetailsSessionService.getUserId());
  summaryEntity.setSummaryTime(new Date());
   setDisplayDiv();
return SUCCESS ;
}



@SuppressWarnings("unchecked")
private void setDisplayDiv(){
                 //访问数据库获取值
callTypeList = SysDicHelper.getInstance().getDicByDicType("callType");
custTypeList = SysDicHelper.getInstance().getDicByDicType("custType");
channelTypeList = SysDicHelper.getInstance().getDicByDicType("channelType");
mainResultList = SysDicHelper.getInstance().getDicByDicType("mainResult");
subResultList = SysDicHelper.getInstance().getDicByDicType("subResult");
summaryTypeList= SysDicHelper.getInstance().getDicByDicType("summaryType");

}
  








}

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • playfish05 2009-03-18 12:32
    已采纳

    [quote]dwr和action中的这些业务方法交互时,dwr是新建一个action类
    那么struts初始化时,spring注入的service就为空!这样供dwr调用的方法中就没法操作service! [/quote]

    [url]http://jiangcccc.iteye.com/blog/89494[/url]

    希望下面的回复可以解决你的问题

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题