Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Framesets and Struts

 
Aash Patel
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to design a help page for my web application. I considered using framesets and frames to design the page. When I try to open the frameset (help.htm) in my application, it doesn't load the frames. I'm assuming this is because the <frame src="..."> required a relative path. Correct?

How can I work around this? I even tried this <html:frame page="..."> but to no avail.

Any other suggestions most welcome too.

Thanks.
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
frame src doesn't require relative path, it requires a CORRECT path. you can used fixed fully qualified URL, as long as the spellings to the URL is correct. you can use relative URL as long as the relative path is properly defined.

generally, i prefer to refer to files and resources by '/' + 'application context root' + URI. if you have a 'help/frame1.do' defined in your struts config, your reference should be '/myapp/help/frame1.do'.
 
Aash Patel
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply alan. While I was researching other ways to implement my help pages, I came across the use of tiles. So I implemented one page using tiles in Struts. Is there any advantage of using one over the other? Especially when designing help pages?
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tiles and frames are independent of each other. tiles is used for laying out the page and cannot be used like frame or iframe, that is you cannot have 1 part of the page refreshing another part of the page like frames; instead, you must go back to the server and recontruct the tiles. you can certainly place tiles inside frames, but not the other way around.

tiles is very nice if you are using struts. they are best used via tiles definition (tiles-def.xml) so they can be easily called by the actions via the forward mappings. there are quite a few tutorials out there on this subject.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic