1

我正在尝试将控件从应用程序 A 中的另一个操作类转发到应用程序 B 中的操作类。两个应用程序都在同一个 servlet 容器中运行。这是我写的代码:

    RequestDispatcher rd = ServletActionContext.getServletContext().getContext("/App2").getRequestDispatcher("/newApp.action");
    HttpServletRequest request = ServletActionContext.getRequest();
    request.getSession().setAttribute("commonQuestions", answers);
    HttpServletResponse response = ServletActionContext.getResponse();
    rd.forward(request, response);
    return null;

它返回“404-找不到资源”错误。当然,相同的代码稍加修改即可访问同一应用程序 1 中的操作也可以正常工作。这里做错了什么?提前致谢!。

4

0 回答 0