我在JSP页面里写了这样一句话:
         <logic:match name="<%=Constants.POPESET_KEY%>"  scope="session" value=",3101,">
            <tr><td height="1" bgcolor="A7D7EB"></td></tr>
            <tr><td class="menuNormal"><a target="centerFrame"       HREF="/oa/aurthentication/register/ListRegisterAction.do?type_att=item3&dataRecordSign=apply" class="menuitem">领事认证</a></td></tr>
            </logic:match>
然后我在STRUTS中写了一句:
                   <action name="registerForm"
path="/authentication/register/ListRegisterAction"
type="com.oa.aurhentication.struts.action.register.ListRegisterAction"
validate="false">
<forward name="success"
path="/office/consul authentication/registerAdmin.jsp" redirect="true" />
</action>
这样是不是如果正确就应该点击领事认证就应该转到registerAdmin.jsp页面吧?或者不正确就应该报错对不对啊?
可是我这里点击领事认证以后却出现了一个毫不相关的页面这是为什么啊????
希望各位大虾能给与指点~~在下感激不尽!!!!!!!!!!!!!!!!!!!!!!!!!!!

解决方案 »

  1.   

    应该是一个空白页面吧,
    当点击领事认证的时候,请求<a target="centerFrame"      HREF="/oa/aurthentication/register/ListRegisterAction.do?type_att=item3&dataRecordSign=apply" class="menuitem">
    在struts配置文件中,直接找到ListRegisterAction去执行excute方法。你可能方法中,没有return success,才导致没有跳转。
    你看看是不是?
      

  2.   

    如果上一个页面的值影响这下一个页面就不应该加
    redirect="true"
      

  3.   

    是不是这个com.oa.aurhentication.struts.action.register.ListRegisterAction类直接拷贝那个修改密码的那个类的方法,然后跳转那里设置成了跳转到修改密码的页面了。
      

  4.   

    还有一个可能是 你的success是一个全局的页面跳转字符,然后页面是指向那个修改密码的那个页面
      

  5.   

    ListRegisterAction的代码是什么样的?
      

  6.   

    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception {
    DataSource dataSource = null;
    Connection conn = null;
    // 声明错误信息对象
    ActionMessages errors = new ActionMessages();
    // 获得seesion
    HttpSession session = request.getSession();
    Staff staff = (Staff) session.getAttribute(Constants.USER_KEY);
    if (staff == null)
    return mapping.findForward(Constants.FORWARD_NOSESSION);
    List vector = new ArrayList();
    ValueObject[] template;
    String action = (String) request.getParameter(Constants.ACTION_KEY);
    if (action == null || action.equals("null") || action.equals("")) {
    try {
    dataSource = this.getDataSource(request);
    conn = dataSource.getConnection();
    DataRecordDAO dataRecordDao = new DataRecordDAO(conn);
    // 得到参数
    String sign = request
    .getParameter(Constants.REGISTERSING_KEY);
    if (sign == null)
    sign = (String) session
    .getAttribute(Constants.REGISTERSING_KEY);
    else
    session.setAttribute(Constants.REGISTERSING_KEY, sign);
    // 获得类型属性
    String typeAtt = request
    .getParameter(com.oa.desktop.struts.Constants.TYPE_ATT_KEY);
    if (typeAtt == null)
    typeAtt = (String) session
    .getAttribute(com.oa.desktop.struts.Constants.TYPE_ATT_KEY);
    else
    session.setAttribute(
    com.oa.desktop.struts.Constants.TYPE_ATT_KEY,
    typeAtt);
    String sql = "";
    if (sign.equals("apply")) {
    sql = " where oper_type='" + typeAtt + "' and staff_id="
    + staff.getStaffId();
    vector = dataRecordDao.search(sql
    + " order by oper_time desc,record_id desc");
    } else if (sign.equals("manager")) {
    sql = " where oper_type='" + typeAtt;
    vector = dataRecordDao.search(sql
    + "' order by oper_time desc,record_id desc");
    StepDAO stepDao = new StepDAO(conn);
    StaffDAO staffDao = new StaffDAO(conn);
    for (int i = 0; i < vector.size(); i++) {
    DataRecord temp = (DataRecord) vector.get(i);
    Step step = (Step) stepDao.findByPrimaryKey(temp
    .getItemId());
    Staff sf = (Staff) staffDao.findByPrimaryKey(step
    .getStaffId());
    if ("A".equals(temp.getCondition())
    || "R".equals(temp.getCondition())) {
    temp.setCondition("流转中 / " + sf.getStaffRealName());
    } else if ("B".equals(temp.getCondition())) {
    temp.setCondition("<font color=red>退 回</font>");
    } else if ("F".equals(temp.getCondition())) {
    temp.setCondition("<font color=blue>已归还</font>");
    } else if ("O".equals(temp.getCondition())) {
    temp.setCondition("<font color=green>通 过</font>");
    }
    }
    } else if (sign.equals("taster")) {
    // 列出待办步骤。
    StepDAO stepDao = new StepDAO(conn);
    List stepFrVec = stepDao
    .searchForNeed("and act_step.staff_id="
    + staff.getStaffId()
    + " and (step_state='READY' or step_state='RUNNING') and entity_type='"
    + typeAtt + "' order by send_time desc");
    // 循环取出待办事务
    for (int i = 0; i < stepFrVec.size(); i++) {
    Step step = (Step) stepFrVec.get(i);
    DataRecord fr = (DataRecord) dataRecordDao
    .findByPrimaryKey(new Long(step.getEntityId()));
    // 删除错误的步骤
    if ("".equals(fr.getOperTime())
    || fr.getOperTime() == null) {
    List delStep = stepDao
    .searchForNeed(" and entity_type='"
    + typeAtt + "' and entity_id="
    + step.getEntityId());
    for (int j = 0; j < delStep.size(); j++) {
    Step temp = (Step) delStep.get(j);
    stepDao.delete(temp);
    }
    continue;
    }
    if (step.getSendTime() != null
    && step.getSendTime().length() >= 10)
    fr.setOperTime(step.getSendTime().substring(0, 10));
    vector.add(fr);
    }
    } else {
    sql = " where oper_condition='O'";
    // 获得表单
    SearchForm addForm = (SearchForm) form;
    if (addForm.getKeyword() != null
    && addForm.getKeyword().length() > 0) {
    addForm.setKeyword(addForm.getKeyword().replaceAll("'",
    "‘"));
    sql += " and oper_personal='" + addForm.getKeyword()
    + "'";
    }
    if (addForm.getStTime() != null
    && addForm.getStTime().length() > 0) {
    addForm.setStTime(addForm.getStTime().replaceAll("'",
    "‘"));
    sql += " and oper_time>='" + addForm.getStTime()
    + " 00:00:00'";
    }
    if (addForm.getEnTime() != null
    && addForm.getEnTime().length() > 0) {
    addForm.setEnTime(addForm.getEnTime().replaceAll("'",
    "‘"));
    sql += " and oper_time<='" + addForm.getEnTime()
    + " 23:59:59'";
    }
    vector = dataRecordDao.search(sql
    + " order by oper_time desc,record_id desc");
    }
    if ("in".equals(sign) || "out".equals(sign))
    session.setAttribute(Constants.DATARECORDSIGN_KEY,
    "manager");
    } catch (Exception e) {
    log.error(e.getMessage());
    e.printStackTrace();
    errors.add("database", new ActionMessage(e.getMessage()));
    } finally {
    try {
    if (conn != null) {
    conn.close();
    conn = null;
    }
    } catch (SQLException sqle) {
    log.error(sqle.getMessage());
    errors.add("database", new ActionMessage(
    "error.database.connect"));
    }
    if (!errors.isEmpty()) {
    saveErrors(request, errors);
    return mapping.findForward(Constants.FORWARD_FALSE);
    }
    // 删除过时的FormBean
    if (mapping.getAttribute() != null) {
    if ("request".equalsIgnoreCase(mapping.getScope()))
    request.removeAttribute(mapping.getAttribute());
    else
    session.removeAttribute(mapping.getAttribute());
    }
    if (!errors.isEmpty()) {
    saveErrors(request, errors);
    return new ActionForward(mapping.getInput());
    }
    }
    pb = new PageBean(vector);
    template = pb.getValueObjects();
    session.setAttribute(Constants.REGISTERSET_KEY, vector);
    session.setAttribute(Constants.PAGEBEAN_KEY, pb);
    } else if (action.equals(Constants.NEXT_PAGE_KEY)) {
    pb = (PageBean) session.getAttribute(Constants.PAGEBEAN_KEY);
    template = pb.getNextPage();
    session.setAttribute(Constants.REGISTERSET_KEY, template);
    session.setAttribute(Constants.PAGEBEAN_KEY, pb);
    } else if (action.equals(Constants.PRE_PAGE_KEY)) {
    pb = (PageBean) session.getAttribute(Constants.PAGEBEAN_KEY);
    template = pb.getPreviousPage();
    session.setAttribute(Constants.REGISTERSET_KEY, template);
    session.setAttribute(Constants.PAGEBEAN_KEY, pb);
    } else {
    // 从session中获取分页对象
    pb = (PageBean) session.getAttribute(Constants.PAGEBEAN_KEY);
    int pageNum = 1;
    try {
    pageNum = Integer.parseInt(action);
    } catch (Exception ex) {
    }
    template = pb.getAppointPage(pageNum);
    session.setAttribute(Constants.REGISTERSET_KEY, template);
    session.setAttribute(Constants.PAGEBEAN_KEY, pb);
    }
    return mapping.findForward(Constants.FORWARD_SUCCESS);
    }
    }
      

  7.   

    搂主的execute方法做的事挺多的哦~~
      

  8.   

    你这个只能调试了,程式中有很多出口,你的Active 里面只定义了一个成功出口。所以你要跟踪数据到底从哪里出去了。