File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts and Frames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts and Frames" Watch "Struts and Frames" New topic

Struts and Frames

Jag Bains
Ranch Hand

Joined: Nov 19, 2002
Posts: 39
I have a problem with accessing beans from within jsp pages when they are in frames.
For example, I have a login.jsp which allows a user to login. If sucessfull, it returns a list of menu items. If the resulting page from the login.jsp is a simple page i.e. maintenanceMenu.jsp, then all works fine.
However, if the resulting page is a frame i.e maintenanceFrame.jsp and one of the frames is maintenanceMenu.jsp, then I get the following error.

maintenanceFrame.jsp is

maintenanceMenu.jsp is

Has anyone got any ideas what I am doing wrong?
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
For all intents you can think of each frame as a separate browser instance. That is, each frame requires its own request-response cycle to interact with the server. Because you are storing your bean in request scope, it will only be available to the targetted frame. If you have something that must be rad by multiple frames, you will want to use session scope.
IMHO though, the best strategy is to avoid frames when possible. Templating strategies make it simple enough to include common elements (such as menus) on multiple pages without using frames, making it rare when they are actually needed.
Jag Bains
Ranch Hand

Joined: Nov 19, 2002
Posts: 39
Templates work a treat.
I agree. Here's the link:
subject: Struts and Frames
It's not a secret anymore!