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

  • Home
  • SEARCH
  • 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 235027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:13:58+00:00 2026-05-11T20:13:58+00:00

EDIT : based on feedback, erased original Q. completely and reposting in better language

  • 0

EDIT: based on feedback, erased original Q. completely and reposting in better language

I wish to access a request or params variable and pass it between the controller and the gsp. i understand that the params object contains everything that a querystring has.

All the examples I see are all Model driven.
I have looked up docs online and I have two books – beginning-grails and definitive guide to grails, both have database driven examples on params. I want to understand how params can be set and accessed. All I read everywhere is that it is a map of request variables.

My scenario is as follows:
I have a controller which sends a list (not from a database) to the GSP. I thought of passing a “params” variable between GSP and the controller.

To reiterate, the scenario I have is not a Model driven one. I am looking to iterate thru a list of items (with no database count known) and is driven by user click. I thought of implementing something like what twitter has “the-more-button-on-the-bottom”. have a simple remotelink at the bottom of the page with a new page counter, which i access in the controller and pass to my service class for the new part of list.

controller code:

//access params from request
int pageInt =params["pagecount"] // *i always get null here*

callMyList(pagecount) //calls my service method to get next set of list for next page

GSP (not actual) code

 <%= params.get("pagecount") %>
 <%= nxtPage = pagecount++ %>
  ...
 <%params["myId"] = nxtPage%>


<g:remoteLink action="list" id="${nxtPage}">More</g:remoteLink>
  • 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-05-11T20:13:58+00:00Added an answer on May 11, 2026 at 8:13 pm

    The params object is only useful for getting values from the query string of the current request. Setting a value in params in a GSP won’t do anything. Params is a request scope object, with each new request it is an entirely new object. To pass a value from your GSP to your List controller, that value must be in the query string of the new request to the controller. In your case, it looks like you want to put it in your “More” link. The way your remoteLink tag is written, the value of nxtPage should be in params.id in your List controller, so you could access it that way. If you want to be in params.pagecount you would have to put it in the params attribute of you remoteLink tag. Something like this:

    <g:remoteLink action="list" params="[pagecount: nxtPage]">More</g:remoteLink>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[EDIT] Based on feedback yes, VS2010 seems to support SL4 Library TDD despite a
Edit: Below is my working code based on the feedback/answers I recieved. This question
I would like to display certain meta data fields in the edit form based
EDIT: This question is more about language engineering than C++ itself. I used C++
Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: From another question I provided an answer that has links to a lot
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
EDIT What small things which are too easy to overlook do I need to

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.