cannot find bean in scope

Discussions

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(PageContextImpl.java:855) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784) org.apache.jsp.loginsuccess_jsp._jspService(loginsuccess_jsp.java:81) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  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?