Patrick,
One solution that comes to mind is to create a small frame that blends into
the rest of your pages (no resize or no border, etc.). Each page you're
presenting would have an "onLoad" script sending the appropriate data in a
call to a JavaScript in that blank frame. The frame would then submit itself
to a special "AccessLog" servlet and your server would get the data.
As this solution barely involves servlets (in fact you could use the web
server access log and avoid the need for the AccessLog servlet completely),
you may want to post a similar question to a JavaScript mailing list,
newsgroup, or forum or something more general. (Search on Google as
necessary.)
Also, based on this and your other recent question (subj: "Form processing -
frameset") you might want to find some JavaScript tutorials and pick up a
book or two on both JavaScript and HTML to learn their non-Java
capabilities. You're right that you seem to be wanting some "right tool for
the job" knowledge that you're is sometimes difficult to get from a fairly
tool-specific forum like this without being considered off-topic.
~Mike
----- Original Message -----
From: "Patrick Fong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 13, 2001 11:30 PM
Subject: Question of which is more elegant - form submission before or after
a page is loaded
> Hi all
>
> I have a question, I am working on a project which requires a log of
access
> of a static page. I have two choices. The first being to submit the form
> before the page is loaded, using embedded javascripting in the "onClick"
> attribute of the "a href" tag. The other, which I am using now, uses
cookie
> to register the document details, and sends it after the page is rendered.
> I feel that the latter option is somewhat crude. The user experiences a
> page refresh, which he/she had no idea what happened (esp. when he/she is
> not technically inclined). However my reason for selecting this is because
> I want to make sure that a page will load before I record the access. In
> cases where an individual's internet connection may cut off while the
> static page is being transmitted would make the first option improper(?).
>
> So I am open to any comments/suggestions? (I guess this is more a question
> of web-design rather than programming)
>
> Pat
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html