response.sendRedirect("http://www.dxqf.net/softweb/login.asp?username=10000035& password =135a");
response没有返回值,但是我又要得到返回值该怎么写?或者是换一种方式也可以。

解决方案 »

  1.   

    window.location="http://www.dxqf.net/softweb/login.asp?username="+10000035+"& password ="+135a试试这个?
      

  2.   

    我要在JAVA代码中用返回值的!!
      

  3.   

    这样可以了吧
    PrintWriter out= response.getWriter();
       out.print("<script language='javascript'>alert(' 删除成功!');window.location.href='/system/eticket/list_single.jsp';</script>");
      

  4.   

    request.setAttribute("list",list);
    前面是名称,后面是要set进去的值request.getAttribute("list");
    得到list的值了
      

  5.   

    public ActionForward dxye(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
    // MessForm mf = (MessForm) form;
    // request.setAttribute("message", mf);
    // 帐户余额地址
    String zhye = "http://www.dxqf.net/softweb/login.asp?username=10000035& password =135a";
    // 电信
    // StringBuilder stbu = new StringBuilder();
    // stbu.append(urldx);
    // stbu.append("/");
    // stbu.append(zhye);
    // stbu.append("?");
    // stbu.append("username=");
    // stbu.append(mf.getUsername());
    // stbu.append("& password =");
    // stbu.append(mf.getPassword());
     response
     .sendRedirect("http://www.dxqf.net/softweb/login.asp?username=10000035& password =135a");
      

  6.   

    response
    .sendRedirect("http://www.dxqf.net/softweb/login.asp?username=10000035& password =135a");
    就这个,帮我换个方式发送URL。
      

  7.   

    PrintWriter out= response.getWriter();
      out.print("<script language='javascript'>alert(' 删除成功!');window.location.href='http://www.dxqf.net/softweb/login.asp?username=10000035&password =135a';</script>");这种方式有问题?
      

  8.   

    return new ActionForward("http://www.dxqf.net/softweb/login.asp?username=10000035& password =135a");
      

  9.   

    你的返回值肯定是在login.asp中抓取的哇,你要怎么取到返回值?
      

  10.   

    request.getRequestDispatcher("地址").forward(request, response);
      

  11.   

    这种场景需要用HttpClient,好好理解下sendRedirect的含义吧
      

  12.   

    HttpClient HttpClient httpClient = new HttpClient();
     String URL2 ="http://www.dxqf.net/softweb/login.asp";
       method = new PostMethod(URL); 
     method.addParameter("username", "10000035");
     method.addParameter("password ", "135a");  
    int statusCode = httpClient.executeMethod(method);
    if(statusCode == HttpStatus.SC_OK){
    String isok = method.getResponseBodyAsString();
                                     System.out.println(isok );
    }  
      

  13.   

    sendRedirect("http://www.dxqf.net/softweb/login.asp?username=10000035& password =135a")密码明码发?
    什么公司,坑爹阿°
      

  14.   

    ...
    ...
    HttpResponse response=httpClient.execute(method);
    if(response.getStatusLine().getStatusCode() == 200){ //if response succeeds
        //Handle entity
         HttpEntitiy entity=response.getEntity();
         if(entity!=null){
            InputStream in= entity.getContent();
            byte[] contentReceiver=new byte[2048];
            int l;
            while( (l=in.read(contentReceiver))!=-1 ){}
         }
    }