求高手解决,关于web请求的一个问题
现在在ie上产生一个请求,通过struts2的action进入后台代码,执行一半后,我现在想在action中通过httpclient又去请求另一个地址(只要是一个http请求都可以),但是 这个httpclient的请求确发送失败,求解决。怎样在一个用struts2的框架中再去发生一个http请求,去请求别的地址。
[解决办法]
- Java code
@RequestMapping(value = "changeDocumentBookState", method = RequestMethod.POST) public String changeDocumentBookState(@RequestParam("operator") int operator, @RequestParam("documentBookId") long documentBookId, HttpServletRequest request) { HttpSession session = request.getSession(); CPUser user = (CPUser)session.getAttribute(Constants.LOGIN_USER); long cpId = user.getEntityID(); String usercodes =request.getParameter("usercodes"); MallInterfaceJson json =new MallInterfaceJson(); json.setCpid(cpId+""); json.setMagid(documentBookId+""); json.setItname(OperatorState.operatorStatus(operator).getName()); taskService.changeDocumentBookState(json); }