www.webdeveloper.com
Results 1 to 7 of 7

Thread: jsp page update from database trigger

  1. #1
    Join Date
    Jun 2006
    Posts
    1

    jsp page update from database trigger

    is there anyway i can listen to a trigger on my database from a .jsp script and force my client page to be refreshed ? i am working with java.sql.Connection.

    - thanx.

  2. #2
    Join Date
    Apr 2005
    Location
    Perth, Australia
    Posts
    340
    Im not really sure, It sounds like a lot of work for a certain type of result.

    Is it a result set your refreshing? it sounds like you would be much better using something like AJAX, which im not really fond of but in this situation is probably good.

    Instead of triggering from the database you could periodically contact your server to check if what ever it is thats supposed to have happened has happened, and then just use client side script to refresh the page.

    Does it have to have a response time better than a minute or something like that? Checking every 10-20 minutes if the action has happened would be fairly easy to do with an ajax framework.

    I think your going to have trouble actually sending a response to the client if you already have sent a response... http is a stateless protocol, im not even sure of where to start on that. A problem like yours is probably where all this AJAX stuff started.

    Oh, and on a side note the Google Web Toolkit has a framework for running client side applications that do asychronous loading of pages, might be worth having a look at it.

    Waylander.
    Last edited by Waylander; 06-12-2006 at 08:16 PM.
    Perth Web Development
    Web Developer
    Perth, Western Australia

  3. #3
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,122
    good advice Waylander...:-)
    However IMHO..Using a hidden frame will do exactly that what "AJAX" will, difference being a "BUZZ" word will be missing.(I hope it wasnt obvious that I am not a fond of AJAX )
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  4. #4
    Join Date
    Apr 2005
    Location
    Perth, Australia
    Posts
    340
    Im not really fond of ajax either...

    Or letting client side script control page movement or database access at all in a standard web application. Ajax isnt a buzz word its a methodology.

    I think if your going to do something complex with javascript. Using a standardized method is better than not using one thats for sure... and a framework aswell... error handling in client side script is really quite terrible.

    And besides, some ajax systems actually do use a hidden frame. I was merely offering a suggestion, maybe you should actually know what something means before bagging it out.

    Waylander.
    Perth Web Development
    Web Developer
    Perth, Western Australia

  5. #5
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,122
    Quote Originally Posted by Waylander
    .... maybe you should actually know what something means before bagging it out.

    Waylander.
    huh? did I miss something here? I was merely making a light hearted comment . Bet its not easy to digest a healthy disagreement...

    Quote Originally Posted by Waylander
    ...
    And besides, some ajax systems actually do use a hidden frame. ...

    Waylander.
    Thats not AJAX then because ajax is when u use XMLHttpRequest object, if they are still using an HTML component then thats really pathetic to use same old html and give it a new name "AJAX"...
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  6. #6
    Join Date
    Apr 2005
    Location
    Perth, Australia
    Posts
    340
    I was merely making a light hearted comment
    Well thats not how it seemed to me or I wouldn't have replied in such a way.

    I dont really think that you have to use an XMLHttpRequest for something to be considered ajax... all you need to do is start another request with javascript to get data to use to modify the original response.

    Thats what I gather from it and most of what im reading on it now seems to say that. How you do it doesnt really matter.

    But really it doesnt matter anyway, I was merely offering a suggestion, not supporting or damning it. Your comment implied I meant more, I only replied because I didnt.

    Waylander
    Perth Web Development
    Web Developer
    Perth, Western Australia

  7. #7
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,122
    well I can only say that what you gathered from my post was completely uncalled for, but thats life some people do see darkside of things first...oh well...
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles