Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

JSP Problems

Thread view: 
KieranM - 14 Feb 2006 10:16 GMT
Hi All

I am currently developing an app using jsp,tomcat and mysql.

I am stuck!

One of the specs of the project is that four users insert into the
database concurrently.
Once all four have entered their info their pages refresh and display
the new information.

I know it is possible to complete this using a time based method
e.g requerying & refreshing every 30 secs but

My question is are there any other methods of invoking a requery &
refresh
e.g. if all four enter their information after 5 secs is there any
other way of prompting a requery & refresh

Thanks in advance
impaler - 14 Feb 2006 12:18 GMT
> Hi All
>
[quoted text clipped - 16 lines]
>
> Thanks in advance

Not in JSP (or any other web technology).
You can do it in an elegant manner by using the XMLHttpRequest object
in your jsp and send a more frequent but small request that checks for
any update and if it sees one, you can do a refresh or use DOM, but
that does not belong here anymore.
Look for AJAX or ActiveX if you use only IE.
Or you could do a meta based refresh using a hidden IFRAME too
timjowers@gmail.com - 14 Feb 2006 14:21 GMT
Here's another lame way... all four post their updates and are streamed
back responses... but the responses never complete until all four have
posted (think about some static singleton or app context object). The
last bit of the response is some javascript forcing a refresh. Now that
would be hoaky. This html streaming technique was common for task
status a decade ago: stream back the task status as the task is run and
eventually send the </html>.

TimJowers
P.S> A client-server app in HTML? Oh my! Operational systems require
fast response. Web technologies are notoriously slow. Just load up your
system's RAM and try to reload your page. IE becomes slower than
crawling.
David Segall - 14 Feb 2006 14:51 GMT
>Hi All
>
[quoted text clipped - 16 lines]
>
>Thanks in advance
Before an update you should lock the record and check if it has
changed since you showed it to the user. You can do that via a "last
changed" time-stamp or a field-by-field comparison. If it has changed
you should probably inform the user but you may not need to do so
unless they are changing a column that has already been changed.
tom fredriksen - 15 Feb 2006 12:10 GMT
> Hi All
>
> One of the specs of the project is that four users insert into the
> database concurrently.
> Once all four have entered their info their pages refresh and display
> the new information.

What you are really talking about here is that there is a four stage
process which mus be completed before any of the clients get the
information updated. This is not concurrency.

> I know it is possible to complete this using a time based method
> e.g requerying & refreshing every 30 secs but
[quoted text clipped - 3 lines]
> e.g. if all four enter their information after 5 secs is there any
> other way of prompting a requery & refresh

There are generally two ways to solve this, 1) the server controls the
information flow or 2) the client controls the information flow. You are
asking about option 1, and that depends on the server type. To be able
to answer you need to provide a bit more information. What is the server
type, a web server, ejb/servlet app server, general app server
framework, what methods are of interrest or of no interrest to solve the
problem, javascript, soap, http etc.

For a webserver you could use perhaps use multipart replies, long
timeouts etc for an app server you could perhaps open up a sidechannel
which the client could listen to for replies etc...

FYI, reading "how to ask questions the smart way" might help you
http://www.catb.org/~esr/faqs/smart-questions.html#id266016

/tom
KieranM - 15 Feb 2006 16:15 GMT
I am using Tomcat 5.0 as my webserver with so far jsp pages but open to
branching into servlets and javascript if possible.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.