Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help !! Problem with Model -2 Framework  RSS feed

Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. I have a class that is implemented as a ResultSet metadata
and am trying to display thousands of records from an address
search with first line of the address(add1) on a JSP view.
2.the user is then expected to select one address out the whole lot and submit back to the controller servlet and via bean
populate the add1,add2,add3,add4 fields on the same JSP view
from which the search was made
Please , what are the ways of implementing this ,since
my controller has a doPost(),that discourages using href on the
address displayed.
Besides , how do i display such large volume of addresses and
populate the respected textboxes with the selected record.
Please , i need your ideas thanks.
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thousands of rows are unreasonable for any GUI. Break it up into seperate pages of say 10, 20, or 100 items a page. Allow navigation from page to page. JSP Tags has a pager tag-lib that does this for you with an excellant example.
Next, I would recommend using javascript to do the post

Notice this will also simplify the servlet or jsp that recieves the posted data.

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
[This message has been edited by Carl Trusiak (edited October 26, 2001).]
Gabriel Fox
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much CARL for your prompt response. I think its
worth the while to give you a break down of my implementation.
1.At the moment,each of my JSP views has an hidden field whose
value attribute is populated by a JavaScript function on each
page .So,if a user presses a button the Javascript function
populate the value of the hidden field with the URL the button
forwards to.
2. the controller servlet now checks all the JSPs since the
hidden field has same name on all the screens(JSP),using:
request.getParameter("nameOfHiddenField")//in controller
//forwards to value of Hidden field
3.At the moment am running a query through SQLClass in my JSP
and my logic in the JSP moves the pointer in the results returned by the address search.
So for next say 100 addresses display i have to re-run the same query but moving the pointer till i get to the end of the result all this logic are in the address displaying JSP.
I am sure this is not okay for performance.
4.I appreciate the suitability of TagLib , but the project
deadline may not warrant researching into TagLib, i want to get
the entire logic in place using pure JSP before going for
a. How do i avoid re-running a query for each batch of display.
b. How do i incorporate the script you gave to populate the
address textfields 1-4 with the selected address.
Thanks pals, Source codes are very welcomed .Cheers.
Your mother was a hamster and your father was a tiny ad:
ScroogeXHTML 7.2 - RTF to HTML5 / XHTML converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!