Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Outputting dynamic HTML frames from a servlet  RSS feed

 
Gill Clover
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
Not sure if this is the right place to post this question but...
I have a servlet which outputs a frameset, composed of two frames, each of which has to be generated dynamically depending on previous user input.
Now, I don't know much about frames which is what my question is about. My servlet currently creates the dynamic content for each frame, writes it to two HTML files which I use as the frames, and then makes a frameset which refers to these two files.
I've been told that writing out to these HTML files in order to result in dynamic HTML being output from my servlet "feels a bit weird", something to do with security, I guess.
However, I couldn't see any other way of making a frameset without it having to reference two actual HTML files. Does anyone know if there's a way I could e.g. give the frameset two strings containing the HTML instead?
Any suggestions would be greatly received,
Gillian Klee
For reference, my frameset HTML is along these lines:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="115,*" cols="*" framespacing="0" frameborder="yes" border="0">
<frame src="topFrame.html" name="topFrame" scrolling="NO" noresize >
<frame src="mainFrame.html" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>
 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gillian
An alternative way would be to set the src of the frames in your framest to reference URL's that are servlets rather than physical files. These servlets would then dynicamically generate the content.
HTH
Andy
 
Gill Clover
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andy,
Thanks for you help, I didn't know you could do that. I'll give it a go.
Gillian
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!