Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    54
    Rep Power
    0

    Default Java Paging Problem

    Hi,
    I am in web application Java programmer. I am working on paging in catalog page.

    my requirement is:

    if our current page 5 and total page 9 than paging:

    example: 1....4 5 6 ......9

    there some point to doing logic:
    1. Always First page and last page is seen. no repeatation.
    2. there is no previous button and next button.
    3. If there is current page is going on ,than it's previous page number and next page number must be come.
    4. If there second last page number is seen than it will be come with last page number.

    like : if current page is 7 and total page is 9 :
    than 1...6789
    5. If there second page number is seen than it will be come with first number.

    like: if current page = 2 than
    123....9
    if current page is 3 than
    1234....9

    So give me logic and solution.

    Manish

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    List, read about Java Collections. Possibly may be Set, probably is List datatype.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    like: if current page = 2 than
    123....9
    if current page is 3 than
    1234....9
    What does this mean? If current page is 2 then ....
    Do you want to print out: 123....9?
    if(currPage == 2)
    System.out.println("123....9")
    else if (currPage ==3)
    System.out.println("1234....9")

    What is your program supposed to do?
    Is this a string creation/manipulation problem? Given digits start, end and current, create a string with the start and end and current digits plus the digits on both sides of current with ... for gaps.

    Write a loop to generate the output string with the above logic to test when to add a digit and when to add ...
    Last edited by Norm; 09-29-2008 at 03:22 PM.

Similar Threads

  1. Struts 2 paging problem using display tag...?
    By prabhurangan in forum Web Frameworks
    Replies: 1
    Last Post: 01-15-2014, 09:00 AM
  2. [SOLVED] Display tag paging help..............?
    By prabhurangan in forum Web Frameworks
    Replies: 12
    Last Post: 06-24-2008, 12:30 PM
  3. Problem in java
    By saytri in forum New To Java
    Replies: 4
    Last Post: 01-16-2008, 10:09 PM
  4. Problem in java
    By saytri in forum New To Java
    Replies: 6
    Last Post: 01-09-2008, 04:13 PM
  5. JAVA if problem
    By toby in forum New To Java
    Replies: 2
    Last Post: 07-25-2007, 07:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •