Does anyone have a suggestion for displaying xml as html formatted text. In
ASP this is
server.htmlencode(MyPacket)
and in cf it is htmleditformat ... I cant seem to find the equivalent for
JSP ..... is there a class
somewhere that does this I can download ?
_____________________________________
Paul Beer
Backsoft Corporation
[EMAIL PROTECTED]
http://www.backsoft.com
(888) 222-6047 Phone
'e-business solutions'
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Geert Van Damme
Sent: Monday, January 17, 2000 9:52 AM
To: [EMAIL PROTECTED]
Subject: Re: Ques : Result set paging in JSP
Well, I guess there has already been a post on this issue.
I gave several possibilities, but in most cases there's only 1 real
solution.
1) Keep the connection in the session and retrieve only the first 100
records, with a following call, the statement and connection are still open
and you can retrieve the following. The problem with this approach is that
you have a dedicated connection for every user (which might be OK for
intranet solutions). And the only way to close the connection is to use a
connection wrapper that listens to the session timeout event. Problem is
that you could have a lot of open connections that are not used anymore.
2) store the result in a temp table and retrieve from that one.
Might be better than the previous solution since you don't need to keep the
statement and resultset open, but you still have the same problem with the
connection.
3) retrieve the resultset and store it in a vector or so in a caching
mechanism. serve your pages from the items in this cache. This might work
very well, but it's really only an option on relatively small result sets.
If you have 18,457,145,147 pages satisfying you search on a search engine
e.g. I don't think they want to load these all in a structure in memory ;-).
4) This might sound very silly and a waste of resources at first, but I
think it's really the way to go. Just retrieve the rows you need and close
statement and connection (or return to the pool). At first this seems
strange because you did a lot of work to make the result set for the first
page, throw away the effort and do exactly the same thing 3 seconds later.
Some points to consider:
- Your db has a caching mechanism too, so the second retrieve will probably
be faster than the first time you do the select.
- Often, the probability that users will click the 'next results' link is
relatively low.
- If the query is really too heavy to do it multiple times, it will probably
be very slow at the first page as well, so you have to concentrate on that
problem. Once the first page comes quick enough, doing the select again is
not that much trouble ;-)
If somebody has other solutions, I'm really interested as well.
I use this 4th approach to do a fuzzy search on all words in a table of
about 30,000 records.
I created a separate index table with 1 word in each row (>500,000 rows).
I store the matching records for every search word in a temp table (+ a
weight value).
I have a view to sum this weight values and I do a query on this weight
descending and retrieve the first 50 records.
This looks like a lot of work, but on a search that matches, let's say,
15,000 records I get a response in 1-2 seconds on my local machine. So I
guess that's fast enough.
just my opinions ;-)
Geert 'Darling' Van Damme
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Neelesh
> Sent: maandag 17 januari 2000 14:32
> To: [EMAIL PROTECTED]
> Subject: Ques : Result set paging in JSP
>
>
> HI all,
> Does any one know how to do resultset paging in jsp.
> (i.e say retrieving 500 records from the database and
> displaying only 100 records at a time with links for
> the other records)
> I am using jdbc, jsp.091 and servlet2.0 for my
> development
> Neelesh
>
> =====
> My home page http://www.geocities.com/siliconvalley/grid/4444
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
>
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html