Problem with ActionMessages and Frames


Web tier: servlets, JSP, Web frameworks: Problem with ActionMessages and Frames

  1. Problem with ActionMessages and Frames (2 messages)


    I am facing a problem in my web application.
    My web application uses frames as specified below :
    <frameset rows="93,*,395,*,37" framespacing="0" frameborder="NO" border="0" bordercolor="#CCCCCC">
    <frame name="topFrame" scrolling="NO" noresize src="" >
    <frame name="blank1Frame" src="" scrolling="NO">
    <frame name="mainFrame" src="" scrolling="NO" noresize>
    <frame name="blankFrame" src="" scrolling="NO">
    <frame name="bottomFrame" scrolling="NO" noresize src="">

    This is the login page and is displayed using the ForwardAction

    From my LoginAction I check if the user is authenticated or not and forward display the index page if not authenticated else the welcome page.
    The code in action reads :

    ActionMessage l_actionMessage = new ActionMessage("error.userdoesnotexist");
    ActionMessages l_actionMessages = new ActionMessages();
    l_actionMessages.add("userdoesnotexist", l_actionMessage);
    saveMessages(p_request, l_actionMessages);
    l_forward = "failure";
    where failure is a ActionForward which points to

    My problem is I want to display the authentication failure message in the mainframe i.e. 3rd frame in the frameset of which the page is composed.
    I tried printing the request contents on the login.jsp ( , it shows me


    But this is not available in the

    Would appreciate a quick help.
    Thanks in advance,

    Threaded Messages (2)

  2. Use Tiles Instead?[ Go to top ]

    If all you are doing is using frames to help with page region re-use then look at using tiles instead:
  3. Request and Session[ Go to top ]

    You're storing you ActionMessages in the request to the frame loading JSP and your frame loading JSP makes new requests to load its parts, causing the original request to be lost along with your ActionMessages.

    Try saving your ActionMessages in the session instead. I know you can do this with more recent Struts releases using the saveMessages(session, messages).

    But definitely take a look at tiles,'s better than frames.