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

Request Dispatcher Scrolls HTML Frame!

 
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I have code below that runs in a Servlet each time a user clicks a Submit button in an HTML Frame. The button is in a JSP page (with the Submit button) in the lower third of the frame.
String address = "mainframe.jsp";
dispatcher = request.getRequestDispatcher(address);
dispatcher.forward(request, response);
(This code runs after the text in the HTML Form is saved to a database.)
What's happening is that each time this code runs and forwards the response back to the frame, the lower third area of the frame scrolls down a few pixels until it's out of sight and can't be used any longer.
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. This appears to be where the scrolling problem is. For some reason, the ChatEntry.jsp part of the frame is scrolling a bit each time.
I think I need a way to clean up what was on the screen before before forwarding to the mainframe.jsp page from the Servlet again. Not sure.
I've removed all the code from the JSP so it's just the servlet and the forward code.
Any ideas would be greatly appreciated!!!
Thanks in advance.
-- Mike
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I forgot to post the HTML Frame that has the scrolling problem when the Servlet forwards to it:
<frameset rows="*,80" cols="*" framespacing="3" frameborder="NO" border="3" bordercolor="#0000FF">
<frameset rows="*" cols="315,*" framespacing="2" frameborder="yes" border="2" bordercolor="#0000FF">
<frame src="UserList.jsp" name="leftFrame" scrolling="NO" >
<frame src="Chatoutput.jsp" name="mainFrame" frameborder="yes" >
</frameset>
<frame src="ChatEntry.jsp" name="bottomFrame" scrolling="NO" noresize >
</frameset>
<noframes><body>
</body></noframes>
</html>
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This behaviour belongs to the HTML and not he servlet, I'll move this to the HTML forum for you.
Dave
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
talk about this here:
https://coderanch.com/t/114259/HTML-JavaScript/Submit-button-affects-meta-refresh
 
    Bookmark Topic Watch Topic
  • New Topic