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 4609166
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:56:54+00:00 2026-05-22T00:56:54+00:00

I am new to grails and i got stuck with another issue. I have

  • 0

I am new to grails and i got stuck with another issue.

I have two form’s in my single GSP search.gsp and have two actions in my controller serach and results.

Now when i click on search button in one of my GSP file it takes me to search action which renders me search.gsp.At this time it should display me only first form in it. when i click results button in that form it will take me to results action.which has code line.

redirect(action:”search”,params:[merchants:merchant,address:address])

this will take me back to search action but now i want to display 2nd form in search.gsp..

My problem is

  • how can i make search action once to run with out parameter’s and once with parameter’s?
  • how to determine in GSP from which action its been called?

with Advance thanks.

  • 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-22T00:56:55+00:00Added an answer on May 22, 2026 at 12:56 am

    Depending on how different your forms are, you may want to consider having two separate GSP files (e.g., search.gsp and results.gsp). Use render(view:'action', model:[...]) to render a different view in the controller. This is often clearer that a single file with lots of conditionals.

    Otherwise, you can find out the action using ${params.action}, so for example:

    <g:if test="${params.action == 'search'}">
       Text to show if the action is search
    </g:if><g:else>
       Text to show if the action is results
    </g:else>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I am new to grails and GSP I have a code like <g:each
I'm new to grails, but have previous experience using .net with c# and linq
In Grails, one can 'bindData' in controller: Book b = new Book() bindData(b, params)
I have a project which uses groovy 1.7.5 and grails 1.3.4. but my new
when i check out a new grails project from svn, i got some error:
i m new to Grails and using some Shiro security. I have made a
I have created a new grails project and run it, but I can't see
I am new to Grails. I have noticed that most tutorials show queries being
I am new to grails and I have an app with this simple classes:
I'm coming from a Spring MVC background on a new Grails app. I have

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.