Announcement Announcement Module
Collapse
No announcement yet.
Cannot find bean in any scope Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot find bean in any scope

    Hi all,
    I am using annotation but not sure how to handle bean class.

    In Controller ....
    @RequestMapping(value = "/login")
    public String loginChk(ModelMap mm){
    Vector v=new Vector();
    for(int i=0;i<2;i++)
    {
    LoginForm loginForm = new LoginForm();
    loginForm.setUserName("dcs"+i+10);
    v.add(loginForm);}
    mm.addAttribute("mm_val",v);
    mm.addAttribute("mm_test","This is test");
    return "forward_ed";
    }

    In forward_ed.jsp
    <h1>Hello World!</h1>
    <c:out value="${mm_test}"/> // This line is working properly
    <logic:iterate id="rec" name="${mm_val}">
    <c:out value="${rec.userName}"/>
    </logic:iterate>

    This is giving JSP Exception : Cannot find bean in any scope.
    Could any one please suggest where I went wrong.

  • #2
    Use [ code][/code ] tags when posting code ....

    Why are you using the struts tag library when you are using spring mvc. Simply use the jstl standard library. (use a forEach tag).

    Comment

    Working...
    X