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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:15:33+00:00 2026-06-01T07:15:33+00:00

I am trying to figure out how to do a redirect within a controller

  • 0

I am trying to figure out how to do a redirect within a controller action in Play (2.0) using Scala.

The redirect using

Redirect(routes.Application.index)

works just fine.

What I cannot figure out from the docs, API, or Google is how to add parameters to the call.

I am coming from Grails where this could be done easily as follows:

redirect action: “index”, params: [“key”: “value”]
.

The only way I have found is to call Redirect using a string url and a query string, which seems awkward.

Basically I would like to make use of Redirect(Call) somehow, but I do not how to create the Call object using reverse routing.

Am I missing something/not getting the concept in Play/Scala?

Thanks in Advance!

  • 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-01T07:15:35+00:00Added an answer on June 1, 2026 at 7:15 am

    Ellou’

    A route is just a function, so you can pass arguments as usual:

    // Redirect to /hello/Bob
    def helloBob = Action {
        Redirect(routes.Application.hello("Bob"))    
    }
    

    This snippet comes from http://www.playframework.org/documentation/2.0/ScalaRouting (at the bottom)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out how to redirect to a new page (different application,
I'm trying to figure out how to redirect istream to wxwidgets. I was able
Trying to figure out how to programmatically access the web pages in the application.
Trying to figure out how to adequately test my accounts controller. I am having
I am trying to figure out how to get a Dashcode web application to
I'm trying to figure out how to redirect all requests to: http://www.i2systems.com To include
Im trying to figure out how to setup a 301 permanent redirect for the
I have been trying to figure out how all this validation works, but I
I'm trying to figure out how to redirect output from some FORTRAN code for
I am trying to figure out how to do a 301 redirect in my

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.