Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7888925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:57:48+00:00 2026-06-03T05:57:48+00:00

I got a page with comments. I want the user to be able to

  • 0

I got a page with comments. I want the user to be able to sort those comments by oldest or newest by clicking on a link that show up in the comment section.

I am already preprocessing views via the url. So when the user browses to book?id=20 it shows the book with the id of 20 from the database.

Going directly to book?id=20&sort=oldest already works. How do I get my JSP to append to the URL upon clicking?

The problem im having is that I can’t hardcode them in: for example, if I just coded in <a href="book?id=${param.id}&show=newest">Newest</a> it will disrupt other query strings. What if the user is already at the URL book?id=20&stars=5 (shows comments with the rating of 5 stars).

I’d like the JSP to just append onto the URL so that it includes any current queries, so for example: user is at currently at book?id=20&stars=5, user then clicks sort by oldest, then the JSP appends &sort=oldest making it book?id=20&stars=5&sort=oldest.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:57:49+00:00Added an answer on June 3, 2026 at 5:57 am

    You can do it with something like that:

    <a href="book?id=${param.id}&show=newest" onclick="this.href=this.href+'&sort=oldest'">Newest</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a comment form on my page (commentlist) and want validate this. The
i got a page users downloading files from there.And when a user click download
I've got a page that retrieves a bunch of locations and some data about
So I've got a page that shows an image with some absolutely positioned text
editing this page for those who want to read this in the future :P
Say, for example, I've got a blog post with some user comments. What I
Suppose that I have a comments form, and I want to prevent bad users
i got a page where the admin can edit some photos i pull from
i got one page from curl which contain <?xml version=1.0 encoding=UTF-8?> <ipinfo xmlns=http://data.quova.com/1 xmlns:xs=http://www.w3.org/2001/XMLSchema-instance>
I got a page with an editor. When i type letters in, the caret

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.