Hi,
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="TopLogin.do" >
<frame name="blank1Frame" src="Blank.do" scrolling="NO">
<frame name="mainFrame" src="MainLogin.do" scrolling="NO" noresize>
<frame name="blankFrame" src="Blank.do" scrolling="NO">
<frame name="bottomFrame" scrolling="NO" noresize src="Footer.do">
</frameset>
===========================
This is the login page and is displayed using the ForwardAction Index.do.
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 :
=================
if(!authenticated){
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 Index.do.
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 (Index.do) , it shows me
org.apache.struts.action.ACTION_MESSAGE:{userdoesnotexist=[error.userdoesnotexist[]]}
But this is not available in the MainLogin.do.
Would appreciate a quick help.
Thanks in advance,
Regards,
Amol
-
Problem with ActionMessages and Frames (2 messages)
- Posted by: Amol Joshi
- Posted on: July 09 2005 04:21 EDT
Threaded Messages (2)
- Use Tiles Instead? by Duncan Mills on July 11 2005 08:41 EDT
- Request and Session by Joe Wolf on July 14 2005 17:09 EDT
-
Use Tiles Instead?[ Go to top ]
- Posted by: Duncan Mills
- Posted on: July 11 2005 08:41 EDT
- in response to Amol Joshi
If all you are doing is using frames to help with page region re-use then look at using tiles instead:
http://struts.apache.org/userGuide/building_view.html#Tiles -
Request and Session[ Go to top ]
- Posted by: Joe Wolf
- Posted on: July 14 2005 17:09 EDT
- in response to Amol Joshi
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, too...it's better than frames.