cannot find bean in scope


EJB programming & troubleshooting: cannot find bean in scope

  1. cannot find bean in scope (3 messages)

    . my LoginAction public class LoginAction extends Action { /* * Generated Methods */ /** * Method execute * @param mapping * @param form * @param request * @param response * @return ActionForward */ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { LoginForm loginForm = (LoginForm) form;// TODO Auto-generated method stub if (loginForm.getUsername().equals("a")) { request.setAttribute("userName", loginForm.getUsername()); return mapping.findForward("success"); } return null; } } . . my loginsuccess.jsp to display the value. . , you successfully logged in! This a struts page.
    when i try to run this page. i am getting following error. javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean userName in scope request org.apache.jasper.runtime.PageContextImpl.doHandlePageException( org.apache.jasper.runtime.PageContextImpl.handlePageException( org.apache.jsp.loginsuccess_jsp._jspService( org.apache.jasper.runtime.HttpJspBase.service( javax.servlet.http.HttpServlet.service( org.apache.jasper.servlet.JspServletWrapper.service( org.apache.jasper.servlet.JspServlet.serviceJspFile( org.apache.jasper.servlet.JspServlet.service( javax.servlet.http.HttpServlet.service(
  2. Check the page with the input form. It should be like this: But not like this:
  3. Thanks, i found where the error is , it is in struts-config.xml mine was it should be
  4. Able to read the values from bean by changing redirect to false in struts-config.xml :*) I don't remember struts guide's have said this any where. Could you please explain, why it is working now?