基本上,我有您的 struts 应用程序的标准登录页面。
您输入密码和用户名并回传到服务器,同时进入主应用程序页面。
我在主页中有java代码,需要最后一页的登录数据来填充屏幕上的表格。我尝试过 ActionRedirect,但它不断带回 nullpointerexception:
ActionRedirect redirect =
new ActionRedirect(mapping.findForward(SUCCESS));
redirect.addParameter("userName",loginForm.getUserName());
return redirect;
这是struts的配置:
<action input="/login.jsp" name="LoginForm" path="/Login" scope="request" type="com.myapp.struts.LoginAction" validate="false">
<result name="success" type="redirect-action">
<param name="location">/timesheet.jsp</param>
<param name="parse">false</param>
</result>
<forward name="failure" path="/login.jsp" />
</action>
并且错误返回为:
WARNING: Unable to find 'timesheet.jsp' forward.
是的,我试图添加另一个与“成功”相关的转发,但它再次失败了。