This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes refresh problem using Frames in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "refresh problem using Frames in struts" Watch "refresh problem using Frames in struts" New topic
Author

refresh problem using Frames in struts

s. anitha
Greenhorn

Joined: Jan 18, 2005
Posts: 18
i m using frames for my application..my problem is these.

using action forwards, but the url in the browser never changes. Everything works happily, so the only thing i want is for the browser to change and display the new URL (mainly for the refresh button).

Refresh repeats the last request.and does not refreshing current page. what shall i do please help me......


Thanks in advance........

S.Anitha :
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
"sanitha",

As I've mentione to you before, your name is not in compliance with our JavaRanch naming policy. Once again we must request that you change your display name in order to comply. Failure to do so may result in the closing of your account. Might I suggest "S. Anitha", or heavens forbid, your full first and last name? Thanks in advance.
[ March 18, 2005: Message edited by: Jason Menard ]
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

I suppose I'll hold my reply until you comply with the policy.

In the meantime, there's something I haven't had the chance to say around here in a while....

FRAMES ARE EVIL!!!


A good workman is known by his tools.
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi anitha

Thats the way the frames behave because each frame will be a window and that url will get updated whenever u click a link ..but if u press refresh on the frame that works perfectly fine .thats the way frames are .adn if u want the url to come in main window then u need to refresh entire page which looses the advantage of frames ............

Yah as per marc i do agree that frames are not that advisabel but still there might be many scenarios where frames are useful and get some things done easily for u
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Yep, that's just the way frames work. Let me add my vioce to the FRAMES ARE EVIL call though. The way frames are often used is to simply provide "global" content on the page. For example, it's not uncommon to see a menu in a frame that controls a content frame. The menu frame is generally the same for each frame of content. This made it so that the developer only had to maintain the applications menu in one place without having to modify every page of the app if the menu were to change.

The times they are a changing though. Today we can use applications such as DreamWeaver to build our web pages. In a tool such as DreamWeaver, you can store your repeatable elements (such as menus) as library items which DreamWeaver will include in each page and update as necessary. Applications such as DreamWeaver aside, we can do the same thing in JSP via includes. Even better than straight JSP includes, there are various libraries available for templating in Java Web apps. For example, Struts includes the Tiles templating library which allows us to do most anything that we might have done in frames in the past, particularly as it applies to repeatable elements.

Frames are pretty nasty for application designers to have to use since they make it hard to maintain appl;cation flow control. If you have the option, and since you are using Struts anyway, it might not be a bad idea to look at Tiles as an alternative.
s. anitha
Greenhorn

Joined: Jan 18, 2005
Posts: 18
Thanks for ur reply..

i m in situation of using frames..if i use include tags it will reloaded at each page. i want to keep my top frame constant. pls help me. is there any solution to clear the refresh problem...

Thanks in Advance.

S.Anitha
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
hi anita

see u cant change thr url of the main window with out refreshing the whole page .....ie if u use frames u cant acheive this .how can some one expect this if they are using frames as the behaviour of frames is like tht

if u want to have that u should not use frames rather use server side includes or tiles which is part of strust which will refresh the entire page on each click


so decide about it
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: refresh problem using Frames in struts