Results 1 to 4 of 4
  1. #1
    deepal_205 is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default setting the view to a jsp page from a self refeshing page

    Hi All,

    I am facing a small problem while setting the view to a jsp page from a self refeshing page

    We have a jsp page say first.jsp. On a click of a button it calls a class (say complex.class) that does some processing. After the processing is complete the complex class sets a Flag to true. and sets the view to second.jsp.

    The processing is very complex and takes a lot of time to complete, so we need to show a progress page say progress.jsp to the user.
    The progress.jsp is a self refreshing page, It calls its command class and checks a flag.
    If the flag is false the view is set back to the progress.jsp.

    The problem we face is that since there are two threads (1. to progress.jsp and 2. complex.class ) running simultaneously, and the view is set by both the threads, the required view is not set and the code breaks.

    Please let me know a way to set the view.
    Thanks
    Deepal

  2. #2
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    That kind of implementation is still ok if your web server is on your local machine, if it is already deployed on the site, i think that is a bad idea.(for me)

    Since JSP returns a static html page( dynamically change on the server-side)
    Instead of refreshing the page and show the progress, you may use AJAX for that........

    You may create a JSP page that returns a static html that represents progress in every instance of time.... call that JSP page via XMLHttpRequest object....... and show the returned static html into the place where it should be placed......
    freedom exists in the world of ideas

  3. #3
    deepal_205 is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default

    Hi,

    We can not use AJAX since we do not want the complex code to handle any progress related data.

    Hence the progress related data is in a different class and the complex processing is in a different class

    The progress information does not mention the exact amount of work completed. it just says "work in progress please wait"
    so i think the use of static html and ajax is not needed.

    Can you please suggest another way to work around with this?
    Thanks
    Deepal

  4. #4
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    The processing is very complex and takes a lot of time to complete, so we need to show a progress page say progress.jsp to the user.
    The progress.jsp is a self refreshing page, It calls its command class and checks a flag.
    If the flag is false the view is set back to the progress.jsp.
    I think the quote above is the last option, (hope not).....
    Be sure the self-refreshing page is small(not more than 3KB)
    I think that is the standard allowable page if you are concern with those users that only uses dial-up connections.......

    good luck.
    freedom exists in the world of ideas

Similar Threads

  1. Go back to previous page using session in JSP page
    By gopikarikati009 in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 06-23-2011, 10:30 AM
  2. Replies: 21
    Last Post: 08-01-2008, 11:13 AM
  3. warning that page has expired and i need to refresh the page again
    By 82rathi.angara in forum JavaServer Pages (JSP) and JSTL
    Replies: 5
    Last Post: 07-15-2008, 01:48 PM
  4. Applet - enter URL and view the page
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-10-2008, 02:38 PM
  5. How to view applet from html page.
    By jwzumwalt in forum Java Applets
    Replies: 2
    Last Post: 11-24-2007, 04:21 AM

Posting Permissions

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