urgent!!!---Re: does struts has the functionality?

2002-09-22 Thread Jenny

I have a question about using jspTags pager(http://jsptags.com/tags/navigation/pager/
). 

Anand, I am sorry to send this email to you directly. I know you are expert on using 
jspTags pager. I urgently need your help. I hope you can recieve my email, and help me!

If someone has used the jspTags pager before, please help me!! I am stunk here.

Senario:
There are lot of payments history records for a user. I will retrieve 500 records from 
DB at one time, and put them into session. When the next 500 records are retrieved, 
they will replace the first 500 records in the session. For example, if a user have 
1200 records totally, at first time, the first 500 records will be retrieve from DB. 
To display the records, I use jspTags pager 
(http://jsptags.com/tags/navigation/pager/). On one page, 50 records will be 
displayed. So the first 500 records will be displayed on 10 pages. When user click on 
the last page(10th page), I want the next 500(501-1000) records to be retrieved, 
replace the first 500 records in the session, and then to be displayed to user. To 
achieve this, in my action class, I need to keep track the page number that the user 
click on.When the action class find that the last page(10th page) is clicked, The next 
500 records will be retrieved, and be displayed to user.

My Jsp name: paymentHistory.jsp

My status and problem:
The first 500 records can be displayed on 10 pages correctly. When I click on the page 
index(for example, I click on page 2), the URL changed to 
http:///rootcontext/paymentHistory.jsp?pager.offset=50. BUT MY ACTION CLASS IS 
NEVER BE CALLED.I AM STUNK HERE!!!

My question:
1. How can I make the my action class to be called whenever user click on a page 
index?( I tried put html:form action=paymentHistory.do in my paymentHistory.jsp. 
but it shows same result. So I guess when user click on page index, it does not submit 
the form).
2. How can I pass pageNumber as a request parameter? (I tried put pg:param 
name=pageNumber / inside pg:pager. It doesn't show pageNumber on URL. I also 
tried to put ?number=%= pageNumber % in the line a href=%= pageUrl 
%?number=%= pageNumber %%= pageNumber %/a. It doesn't work.

The following is my paymentHistory.jsp:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
%@ page language=java  
 import=org.apache.struts.webapp.example.Payment %

%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

!-- for page navigation--
%@ taglib uri=http://jsptags.com/tags/navigation/pager; prefix=pg %

html:html locale=true

head
 titlehistory/title
 META name=GENERATOR content=IBM WebSphere Studio
/head
body
  table align=center cellspacing=0 cellpadding=0 border=0 width=480
  tr
td align=centerPayment History/td
  /tr   
   /table
  hr
  !--This following table is used to display account history-- 
  table align=center cellspacing=0 cellpadding=0 border=0 

  !-- payment history header --
  logic:present name=payments
  tr
td
  Amount
/td
td 
  Balance
/td
  /tr
html:form action=/paymentHistory.do
pg:pager maxPageItems=1

  logic:iterate id=aPayment name=payments scope=session 
  tr
  pg:item
  td
  bean:write name=aPayment property=amount/
  /td
td
 bean:write name=aPayment property=balance/
  /td
  /pg:item
  /tr
  /logic:iterate
   /table  
   !-- page navigation area --   
pg:index
   pg:prev
 a href=%= pageUrl %[ (%= pageNumber %)  Previous ]/a
   /pg:prev
  pg:pages
  a href=%= pageUrl %%= pageNumber %/a
  /pg:pages
  pg:next
  a href=%= pageUrl %[ Next  (%= pageNumber %) ]/a
  /pg:next
 /pg:index   
/pg:pager
/html:form
  /logic:present
 
/body
/html:html

Thanks for your help.










 
   -Original Message-
   From: Jenny [mailto:[EMAIL PROTECTED]]
   Sent: Saturday, September 14, 2002 12:14 PM
   To: Struts Users Mailing List
   Subject: Re: does struts has the functionality
  - Original Message -
   From: Anand Belaguly [EMAIL PROTECTED]
   To: Struts Users Mailing List [EMAIL PROTECTED]
   Sent: Saturday, September 14, 2002 1:58 PM
   Subject: RE: does struts has the functionality
  
  
Jenny,
   
Thanks for the link, it looks good.I will try it sometime.
We have used the jspTags pager for recordsets more
than 2500 records(one time query) and it gets displayed in less
than 2 seconds.Also it is very easy to use, you just
need to encapsulate ur presentation logic with these tags.
   
Anand
 
- Original Message -
From: Anand Belaguly [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, September 13, 2002 4:42 PM
Subject: RE: does struts has the functionality
   
   
 This works pretty good.

 http://jsptags.com/tags/navigation/pager/

 Anand

 -Original Message-
 From: jenny

Re: urgent!!!---Re: does struts has the functionality?

2002-09-22 Thread Jenny

I have figured out how to have my action class be called whenever user click
on a page index(solution is to have url=/rootcontext/paymentHistory.do).
So the first question I asked below is solved.

Now I encountered another problem. When user click on the 10th page(Please
see the following senario for detail), the first 500 records will be removed
from session, and the next 500 records will be retrieved from DB, and
displayed to user. From logic view of point, the second 500 records should
be displayed from page 11-20. But now, the page number still shows 1-10, and
only the last records on 10th page is from second 500 records(the last
record). The rest of the records dispalyed are still from the first 500
records. This is not correct.

My question: How can I have the page index to be displayed correctly, and
works correctly?

Thank you very much for your help.

Jenny


- Original Message -
From: Jenny [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, September 22, 2002 6:59 PM
Subject: urgent!!!---Re: does struts has the functionality?


I have a question about using jspTags
pager(http://jsptags.com/tags/navigation/pager/
).

Anand, I am sorry to send this email to you directly. I know you are expert
on using jspTags pager. I urgently need your help. I hope you can recieve my
email, and help me!

If someone has used the jspTags pager before, please help me!! I am stunk
here.

Senario:
There are lot of payments history records for a user. I will retrieve 500
records from DB at one time, and put them into session. When the next 500
records are retrieved, they will replace the first 500 records in the
session. For example, if a user have 1200 records totally, at first time,
the first 500 records will be retrieve from DB. To display the records, I
use jspTags pager (http://jsptags.com/tags/navigation/pager/). On one page,
50 records will be displayed. So the first 500 records will be displayed on
10 pages. When user click on the last page(10th page), I want the next
500(501-1000) records to be retrieved, replace the first 500 records in the
session, and then to be displayed to user. To achieve this, in my action
class, I need to keep track the page number that the user click on.When the
action class find that the last page(10th page) is clicked, The next 500
records will be retrieved, and be displayed to user.

My Jsp name: paymentHistory.jsp

My status and problem:
The first 500 records can be displayed on 10 pages correctly. When I click
on the page index(for example, I click on page 2), the URL changed to
http:///rootcontext/paymentHistory.jsp?pager.offset=50. BUT MY ACTION
CLASS IS NEVER BE CALLED.I AM STUNK HERE!!!

My question:
1. How can I make the my action class to be called whenever user click on a
page index?( I tried put html:form action=paymentHistory.do in my
paymentHistory.jsp. but it shows same result. So I guess when user click on
page index, it does not submit the form).
2. How can I pass pageNumber as a request parameter? (I tried put
pg:param name=pageNumber / inside pg:pager. It doesn't show pageNumber
on URL. I also tried to put ?number=%= pageNumber % in the line a
href=%= pageUrl %?number=%= pageNumber %%= pageNumber %/a. It
doesn't work.

The following is my paymentHistory.jsp:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
%@ page language=java
 import=org.apache.struts.webapp.example.Payment %

%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

!-- for page navigation--
%@ taglib uri=http://jsptags.com/tags/navigation/pager; prefix=pg %

html:html locale=true

head
 titlehistory/title
 META name=GENERATOR content=IBM WebSphere Studio
/head
body
  table align=center cellspacing=0 cellpadding=0 border=0
width=480
  tr
td align=centerPayment History/td
  /tr
   /table
  hr
  !--This following table is used to display account history--
  table align=center cellspacing=0 cellpadding=0 border=0 

  !-- payment history header --
  logic:present name=payments
  tr
td
  Amount
/td
td
  Balance
/td
  /tr
html:form action=/paymentHistory.do
pg:pager maxPageItems=1

  logic:iterate id=aPayment name=payments scope=session 
  tr
  pg:item
  td
  bean:write name=aPayment property=amount/
  /td
td
 bean:write name=aPayment property=balance/
  /td
  /pg:item
  /tr
  /logic:iterate
   /table
   !-- page navigation area --
pg:index
   pg:prev
 a href=%= pageUrl %[ (%= pageNumber %)  Previous ]/a
   /pg:prev
  pg:pages
  a href=%= pageUrl %%= pageNumber %/a
  /pg:pages
  pg:next
  a href=%= pageUrl %[ Next  (%= pageNumber %) ]/a
  /pg:next
 /pg:index
/pg:pager
/html:form
  /logic:present

/body
/html:html

Thanks for your help.











   -Original Message-
   From: Jenny [mailto:[EMAIL PROTECTED]]
   Sent: Saturday

Re: does struts has the functionality

2002-09-20 Thread Jenny

Hi, there:

The link http://jsptags.com/tags/navigation/pager/ that Anand provided is
very good for page navigation. However, I have two questions regarding to
using it.

First, in order to use it, we have to add the following in our web.xml.

taglib
  taglib-uri
http://jsptags.com/tags/navigation/pager
  /taglib-uri
  taglib-location
/WEB-INF/jsp/pager-taglib.tld
  /taglib-location
/taglib

 Because the taglib-uri refer to
http://jsptags.com/tags/navigation/pager. That means if the link doesn't
work, our program will not work. In that case, is it safe to use it?

Second question. I have 2000 records totally. I want to retrieve 1000
records from DB at one time and display it to user. When user navigate to
the last page of the first 1000 records, user should still be able to click
next to navigate to the second 1000 records. How can I have next in the
last page of the first 1000 records. From my understanding, the jspTags
pager will take the first 1000 records as the total search result,
therefore, at the last page of the first 1000 records, it will not display
next navigation ability. But in my senario,I still need the ability
because I still have another 1000 records to show. At the last page of the
second 1000 records, there should be no next navigation ability.In order to
achieve this, do I need to modify the taglib, or just modify my JSP file.

I tried to describe my senario as clear as possible. It may still not clear
to you. Please feel free to ask me to clarify if you have any doubt.

Thank you for your reply.

Jenny


  -Original Message-
  From: Jenny [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, September 14, 2002 12:14 PM
  To: Struts Users Mailing List
  Subject: Re: does struts has the functionality
 - Original Message -
  From: Anand Belaguly [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Saturday, September 14, 2002 1:58 PM
  Subject: RE: does struts has the functionality
 
 
   Jenny,
  
   Thanks for the link, it looks good.I will try it sometime.
   We have used the jspTags pager for recordsets more
   than 2500 records(one time query) and it gets displayed in less
   than 2 seconds.Also it is very easy to use, you just
   need to encapsulate ur presentation logic with these tags.
  
   Anand

   - Original Message -
   From: Anand Belaguly [EMAIL PROTECTED]
   To: Struts Users Mailing List [EMAIL PROTECTED]
   Sent: Friday, September 13, 2002 4:42 PM
   Subject: RE: does struts has the functionality
  
  
This works pretty good.
   
http://jsptags.com/tags/navigation/pager/
   
Anand
   
-Original Message-
From: jenny zhang [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 13, 2002 1:32 PM
To: Struts Users Mailing List
Subject: does struts has the functionality
   
   
Hi, there:
   
Does struts has the functionality of supporting page
navigation? I have over 100 search results, I would
like display them inseperate pages(10 records/page).
In each page, I would like have previous, next button.
I am not sure if struts has the functionality. If you
know this, could you please share the info? I
appreciate your info.
   
Thanks
   
   
   
   
   
__
Post your free ad now! http://personals.yahoo.ca
   
--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
   
   
   
   
--
To unsubscribe, e-mail:
   mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
   mailto:[EMAIL PROTECTED]
  
   __
   Post your ad for free now! http://personals.yahoo.ca
  
   --
   To unsubscribe, e-mail:
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
   mailto:[EMAIL PROTECTED]
  
  
  
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
  __
  Post your ad for free now! http://personals.yahoo.ca
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

 __
 Post your ad for free now! http://personals.yahoo.ca

 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

__ 
Post your ad for free now! http://personals.yahoo.ca

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




To Anand: Re: does struts has the functionality

2002-09-18 Thread Jenny

Anand:

Thank you.
I have one more question.in your previous email, you said We have used the
jspTags pager for recordsets more
 than 2500 records(one time query).My understanding is that you got all the
records one time from Database. Where did you keep those records? Is it in
session, or somewhere? The middle tier developer in our company wants to get
20 records(20 records/page)from Database at one time. For example, in order
to display the first page, the first 20 records will be retrieved from
database. When user click next,next 21-40 records will be retrieved and
displayed on the next page.The reason he wants to do it that way is he
doesn't want to keep many records in session. For me, I prefer to retrieve
all records once. I think I should convince him. But I am not sure I have
enough reasons. Could you please give me your suggestons, and your
solutions? I really appreicate your help.

Thank you very much.

Jenny



- Original Message -
From: Anand Belaguly [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Saturday, September 14, 2002 5:20 PM
Subject: RE: does struts has the functionality


 Jenny,

 I believe you can use the arrows instead of pages. You can even put
 images developed by your graphic designers.

 Here is the code snippet.
 %@ taglib uri=http://jsptags.com/tags/navigation/pager; prefix=pg %

 pg:pager
   pg:param name=keywords/

   ex:searchresults
 pg:item
   %= searchResult %
 /pg:item
   /ex:searchresults

   pg:index
 pg:prev
   a href=%= pageUrl %[-- Back]/a
 /pg:prev
 pg:next
   a href=%= pageUrl %[ Next -- ]/a
 /pg:next
   /pg:index
 /pg:pager

 Hope this helps.
 Anand


 -Original Message-
 From: Jenny [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, September 14, 2002 12:14 PM
 To: Struts Users Mailing List
 Subject: Re: does struts has the functionality


 Anand:

 Thanks for your valuable information. It is very helpful.I am going to use
 it. One more question(sorry to bother you again), the designer wants to
use
 - -(graphic staff) instead of using numbers for page navigation.
Since
 jspTags pager uses build-in variable pageNumber, it is not possible to
 achieve what the designer wants. Is my understanding right? I really
 appreciate your reply.
 Thank you in advance for your reply.

 Best regards,

 Jenny


- Original Message -
 From: Anand Belaguly [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Saturday, September 14, 2002 1:58 PM
 Subject: RE: does struts has the functionality


  Jenny,
 
  Thanks for the link, it looks good.I will try it sometime.
  We have used the jspTags pager for recordsets more
  than 2500 records(one time query) and it gets displayed in less
  than 2 seconds.Also it is very easy to use, you just
  need to encapsulate ur presentation logic with these tags.
 
  Anand
 
  -Original Message-
  From: Jenny [mailto:[EMAIL PROTECTED]]
  Sent: Friday, September 13, 2002 7:18 PM
  To: Struts Users Mailing List
  Subject: Re: does struts has the functionality
 
 
  Anand:
 
  Thanks for your reply. This is an excellent link. I also got another
link
  from Dave(in our group). The link URL is:
  http://edhill.its.uiowa.edu/display/. I am not sure if you knew that
link.
  Both the link you provided and the above link are excellent. Now, I am
not
  sure which one should I choose. I have large results sets. Does the
 solution
  you provided me has performance issue? I appreciate your opinions on
this.
 
  Thanks,
 
  Jenny
 
 
 
  - Original Message -
  From: Anand Belaguly [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, September 13, 2002 4:42 PM
  Subject: RE: does struts has the functionality
 
 
   This works pretty good.
  
   http://jsptags.com/tags/navigation/pager/
  
   Anand
  
   -Original Message-
   From: jenny zhang [mailto:[EMAIL PROTECTED]]
   Sent: Friday, September 13, 2002 1:32 PM
   To: Struts Users Mailing List
   Subject: does struts has the functionality
  
  
   Hi, there:
  
   Does struts has the functionality of supporting page
   navigation? I have over 100 search results, I would
   like display them inseperate pages(10 records/page).
   In each page, I would like have previous, next button.
   I am not sure if struts has the functionality. If you
   know this, could you please share the info? I
   appreciate your info.
  
   Thanks
  
  
  
  
   __
   Post your free ad now! http://personals.yahoo.ca
  
   --
   To unsubscribe, e-mail:
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
   mailto:[EMAIL PROTECTED]
  
  
  
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
  __
  Post your ad for free now! http://personals.yahoo.ca