• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display JSP Page elements sequentially?

 
Khosrow Moossavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm developing a typical MVC web site, which has MainServlet as the main controller of every request. It maps the corresponding Bussines Logic class. The Bussiness Class connect to database, fetch the required data, and fill the neccesary Beans. Whenever everything is filled, it calls getRequestDispatcher.forward() to show desired View JSP File.

The Content of JSP File is like this:


The thing is NONE of the *response.flushBuffer*s won't work. I mean the page being shown whenever everything above is done, and the Page is just shown completly at once.

Is it anything wrong with the Code or structure?
How should I get this done working?

Many thanks.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Khosrow Moossavi:
The thing is NONE of the *response.flushBuffer*s won't work. I mean the page being shown whenever everything above is done, and the Page is just shown completly at once.

This also depends on the webbrowser used at the client. For example IE and Safari only shows the page when the last bit come in. For example FF and Opera immediately shows the page and you see it being built in real time.

That said, copypasting those nasty scriptlets thoroughout your clean JSP code breaks the MVC idea.
 
Khosrow Moossavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This also depends on the webbrowser used at the client.

I've tested the situation in IE, FF, Opera, NN. They are all the same. Nothing, untill everything is done!




That said, copypasting those nasty scriptlets thoroughout your clean JSP code breaks the MVC idea.

Well, I've just omitted many parts of the JSP page. The ONLY scriptlets I've used were :
1) <%@ taglib prefix="somePrefix" uri="<PrefixURI>"%>
2) <%@ include file="/some/file/to/be/included"%>
3) <% response.flushBuffer(); %>

I don't think these scriptlets are unnatural for MVC. are they?!
[ December 19, 2008: Message edited by: Khosrow Moossavi ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65519
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is it you are really trying to accomplish. The type of control you are attempting is not possible on the server.
 
Khosrow Moossavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is it you are really trying to accomplish.


I'm trying to show the content of the JSP Page steps by steps whenever they are capable of showing (Flushing the Buffer to Client's Browser).
Following Sequence:
1) Showing the Header
2) Showing the Location bar
3) Showing the Menu
4) Showing the Content of the Page (While it mighe be a Large list of items)
5) Showing the Footer (This is the end of the Page, so i don't think this could be a problem!)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65519
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But why? If you want to effect a gradual display of the various sections, that'd be best controlled by JavaScript on the client. If you are trying to speed up the rendering, I think you're going to be frustrated.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!