Click here to get back home

Embedded HTML in frameset - is it possible?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Embedded HTML in frameset - is it possible? Alex Molochnikov 01-21-2005
Get Chitika Premium
Posted by Alex Molochnikov on January 21, 2005, 6:22 pm
Please log in for more thread options
Is there any way to embed the HTML code inside FRAMESET? Something like
this:

<frameset cols="50%,*">
<frame src=" ... HTML code for the frame ... ">
<frame src="Frame2.html" name="main">
</frameset><noframes></noframes>

I tried using a Javascript function that returns the HTML text, as in the
following code:

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head> <title>Frame 1</title>
<script type="text/javascript">
function myFunction()
{
return ("<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Frame 1</title>
</head>
<body>
<H2>Frame 1</H2>
</body>
</html>
")
}
</script>
</head>
<frameset cols="50%,*">
<frame src=myFunction() name="toc">
<frame src="Frame2.html" name="main">
</frameset><noframes></noframes>
</html>

but the browser shows the "The page cannot be displayed" for the first
frame.

I am trying to find a way to generate a page from the Java servlet that
would contain a hidden (0-width) frame and a fully visible frame with some
dynamic content.

I will appreciate any clues.

Alex Molochnikov




Posted by Harlan Messinger on January 21, 2005, 2:00 pm
Please log in for more thread options
Alex Molochnikov wrote:
> Is there any way to embed the HTML code inside FRAMESET?

No.

[snip]

> I am trying to find a way to generate a page from the Java servlet that
> would contain a hidden (0-width) frame and a fully visible frame with some
> dynamic content.

The purpose of frames (which is generally vastly outweighed by their
flaws and disadvantages) is to display content from multiple documents.
If you don't want to do that, why are you using frames at all? What is
meant to go in this "hidden" frame?


Posted by Alex Molochnikov on January 21, 2005, 8:07 pm
Please log in for more thread options
> The purpose of frames (which is generally vastly outweighed by their
> flaws and disadvantages) is to display content from multiple documents.
> If you don't want to do that, why are you using frames at all? What is
> meant to go in this "hidden" frame?

This is an attempt to implement a browser callback to the servlet, mostly
inspired by the Pushlets framework, as described in
http://www.javaworld.com/jw-03-2000/jw-03-pushlet.html. The hidden frame
would contain nothing, it would make a call on the servlet, and receive a
Javascript code from it. The code, in its turn, can make requests on the
servlet.

This whole thing is needed to implement a Web-based frontend for interactive
reports. The clear-view frame would initiate a request on the servlet to
generate a report. Before the request is completed (i.e. before the doPost()
or doGet() method returns), the servlet may have to get some additional info
from the user (such as the customer number for the invoice). This cannot be
done in the same frame without returning from the servlet's doGet/doPost
methods. This is where the hidden frame comes in - it will receive the
request from the servlet (a callback) to open another window with the
necessary controls (text fields, buttons etc. depending on the nature of the
additional info).

The page that issues the report request is itself dynamically generated by
the servlet. So I was trying to find a way to format it as a frameset with
the frame content coming from the servlet, in a single requset-responce
cycle (one-trip solution, if you wish). I know that the frame content in the
frameset can be set to come from the servlet, instead of an html file, but
this would require another trip to the servlet. So, I tried using the
Javascript function; the function itself would be formatted by the servlet,
with the necessary frame content.

AM




Posted by Harlan Messinger on January 22, 2005, 7:22 pm
Please log in for more thread options
Alex Molochnikov wrote:
This is an attempt to implement a browser callback to the servlet, mostly
> inspired by the Pushlets framework, as described in
> http://www.javaworld.com/jw-03-2000/jw-03-pushlet.html. The hidden frame
> would contain nothing, it would make a call on the servlet, and receive a
> Javascript code from it. The code, in its turn, can make requests on the
> servlet.
>
> This whole thing is needed to implement a Web-based frontend for interactive
> reports. The clear-view frame would initiate a request on the servlet to
> generate a report. Before the request is completed (i.e. before the doPost()
> or doGet() method returns), the servlet may have to get some additional info
> from the user (such as the customer number for the invoice). This cannot be
> done in the same frame without returning from the servlet's doGet/doPost
> methods.

Right. You're *supposed* to return from the doGet or dPost method. You
call the method whose purpose is to send the appropriate form to the
user to get request the needed data--and then you return from doGet or
doPost. When the user submits the form, it's submitted to a servlet (it
may be the same servlet as the first one), calling the doPost method
from scratch. It's not a continuation of the previous call. The method
looks up the previous information from the transaction (in either
session variables or session-related tables), incorporates the new data,
and proceeds from there.

What you're doing is an attempt to treat a web application as though it
were a traditional application running on the client machine, consisting
of a single routine that runs from beginning to end, successively
displaying instructions and forms to the user to enter data, and
continuing after the user finishes with each screen. This is an
inefficient, problem-prone way to build web-based applications.

> This is where the hidden frame comes in - it will receive the
> request from the servlet (a callback) to open another window with the
> necessary controls (text fields, buttons etc. depending on the nature of the
> additional info).
>
> The page that issues the report request is itself dynamically generated by
> the servlet.

Naturally. That's what servlets do: generate pages dynamically. You say
this as though it were a distinctive feature of your application.

Surely you've seen plenty of e-commerce sites. None of them work the way
you're trying to set up your application.

[snip]


Posted by Alex Molochnikov on January 23, 2005, 3:56 am
Please log in for more thread options
> What you're doing is an attempt to treat a web application as though it
> were a traditional application running on the client machine, consisting
> of a single routine that runs from beginning to end, successively
> displaying instructions and forms to the user to enter data, and
> continuing after the user finishes with each screen. This is an
> inefficient, problem-prone way to build web-based applications.

This would be so, if the application in question _were_ a Web application.
In reality it is not. This is a report generator that is a traditional
3-tier client-server application that runs as a Swing-based client, and as a
headless server (not servlet) process, and displays the reports in a
Java-generated window (JFrame). And, depending on the design of a particular
report, it _may_ communicate with the user via the server-side callbacks.

Publishing the generated report over the Web is a small appendix to the
entire design, an add-on option. And it must fit into the existing design
structure, which can start the report process in one thread, and then,
before the report finishes, get back to the user in a different thread, get
some additional input, and carry on until the report is done, or until
another callback comes, with more info requests. It is this interactive part
of the functionality that is currently missing from the Web-published
reports, and I am trying to find a way to implement it through a combination
of Javascript, servlet-side callbacks, frames, possibly pop-ups and whatever
else I can think of. The availability of Javascripts, the need to enable
cookies, and any other requirement is not a concern.

> Naturally. That's what servlets do: generate pages dynamically. You say
> this as though it were a distinctive feature of your application.

The reason I mention it is the need to incorporate the Javascript into that
dynamically generated content, and the difficulties I had (still have)
getting this Javascript code called upon loading the frame, and connecting
back to the servlet.

> Surely you've seen plenty of e-commerce sites. None of them work the way
> you're trying to set up your application.

They are all based on the complete request-return cycle, with no servlet
callbacks cutting in-between. As explained above, the application in
question does not work this way. In short, it is not a Web application in
the customary sense. I really do not want to come across as trying to turn
this post into a commercial, promoting our product, but if you a curious,
you can have a look at www.reportgenerator.org to see how this thing is
organized.

Regards,

Alex.




Similar ThreadsPosted
Frameset -> Page -> IFrame -> Frameset ...issue with scroll bars (Two issues) April 4, 2008, 6:45 pm
CERT Advisory CA-2000-02 Malicious HTML Tags Embedded in Client Web Requests September 4, 2005, 12:20 am
HTML 4.01 Transitional versus Frameset September 3, 2006, 11:22 pm
Strange IE7 behaviour (with embedded Flash) July 29, 2008, 9:51 am
Dimensions of embedded video in Internet Explorer? January 31, 2006, 2:56 pm
embedded php snippet won't parse/validate in XHTML January 1, 2007, 9:57 am
Instant startup of embedded quicktime content, is it possible? Caching is no help. February 20, 2007, 2:53 pm
is it possible to have an rtl frameset? February 21, 2007, 5:20 am
Alternatives for frameset ? August 3, 2004, 3:48 pm
help validate FRAMESET March 4, 2006, 3:12 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap