要跳到这个actiondepartment_show.action?department.id=1有个要求是必须客户端跳转,请问这个result应该怎么写呢?

解决方案 »

  1.   

    你还写啥result呢?直接forword(),把你上面这路径和参数写上,然后result Action.NONE
      

  2.   

    forward()写在哪儿啊?我不太懂,这是struts2呀!
      

  3.   

    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName()
    + ":" + request.getServerPort() + path + "/";
    StringBuffer sb = new StringBuffer();
    this.response.setCharacterEncoding("UTF-8");
    this.response.setContentType("text/html");
    sb.append("<script language='javascript' type='text/javascript'>");
    PrintWriter out = response.getWriter();
    sb.append(" window.location.href='" + basePath + "department_show.action?department.id=1';");
    sb.append("</script>");
    out.print(sb.toString());
    return null;这是在你的action中要跳转的action  这是在java代码中实现的,  配置文件:
    <result name="action中return">department_show.actiondepartment.id=1</result>
      

  4.   

    <result name="success" type="redirectAction">.........</result>
      

  5.   

    <result name="success" type="redirectAction">.........</result>楼主想要什么效果啊 !本人不是太理解
    一个action跳到另一个action 并且带参数?然后呢?