• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Submit button affects meta-refresh!

 
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a frame where, when hitting the Submit button, the meta-refreshes increase in frequency.
There are three pages in the frame. Two of them have meta refreshes of 3 and 5 seconds respectively.
However, upon each Submit from the frame with no refresh, the audible number of refreshes increases. After about 20 submits, there are TONS of refreshes happening all the time.
This is a JSP page so I'm not sure if I need to do some kind of Javascript browser "document" refresh or if that will even work.
I'm really concerned what might be happening.
Also, each time I click the submit button, the bottom frame scrolls down a pixel or two.
Any ideas would be welcome!
Thanks.
-- Mike
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The reason for al of the refreshing is you are getting the meta tags stuck in a loop which can be a little tiny bug
if you want to manually refresh the page with JavaScript, all you need to do is just this
document.location.href=document.location.href;
it will cause the age to reload and it will act like the refresh has been hit.
Not sure if this answers your question, but it was a shot.

Eric
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I put code like this in the body section of my JSP, it won't load. I get a blank page.
<script type= "text/javascript">
<!--
document.location.href=document.location.href;
-->
Any ideas why? It seems to be the script tag.
Thanks much in advance.
-- Mike
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure you only get a blank page? You are probably continually re-loading the page with that statement block. Try putting it in a function that gets called by your submit button.

Greg
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I took the code out that does the refresh.
I just left in the script expression with the same result.
Thanks.
-- Mike
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the timeout of the meta refresh on your two JSP pages dynamically determined ?

What exactly does your meta refresh tag look like the very first time you hit the frame page? How about after a single submit?

As for the bottom frame scrolling down, it's a JSP page.. are there any <br /> or spacing tags being used that might be dynamically determined? If you are incrementing a variable, thinking it is per request, but you have it scoped incorrectly, then perhaps it's doing some strange things. Is the actual source of the HTML different each time? Track down where in your source the extra HTML whitespace is coming from, and look there in your JSP.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Something else from your other post:

The name of the frame with the Submit button, in the lower third that scrolls down on each forward, is "ChatEntry.jsp". However, since it's contained in teh "mainframe" frame, I need to forward to the mainframe.jsp page.

I admit I've never done any heavy-duty frame programming, but I don't see the 'need' for this at all.

If your ChatEntry.jsp submits a form to a servlet, you stick the text into a database... why not just forward to ChatEntry.jsp again? The submitting frame will then re-appear, and you don't have to reload the ENTIRE frameset, rather, just the one frame.
reply
    Bookmark Topic Watch Topic
  • New Topic