Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Add a get parameter to all routes without pattern
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Greg  
View profile  
 More options Oct 5 2012, 11:16 am
From: Greg <gregloic...@gmail.com>
Date: Fri, 5 Oct 2012 08:16:30 -0700 (PDT)
Local: Fri, Oct 5 2012 11:16 am
Subject: Add a get parameter to all routes without pattern

Hello,

I have a Play 2.0 framework that is working well and I want to be able to
add a specific get parameter (known only by be) to all routes. That
parameters should be ignore by routes.

I explain.
Suppose I have routes like :

GET     /add/:id              controllers.MyController.add(id : Int)

> GET     /remove/:id           controllers.MyController.remove(id : Int)

What I want is, for example, that http://mydomain.com/add/77*
?mySecretParam=ok* still goes to controllers.MyController.add(id : Int) and
then I could get mySecretParam in request object. And the same for all my
routes.

Do you have any idea how can I do ?

Thanks.
Greg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Roper  
View profile  
 More options Oct 7 2012, 8:58 pm
From: James Roper <jrop...@gmail.com>
Date: Sun, 7 Oct 2012 17:58:46 -0700 (PDT)
Local: Sun, Oct 7 2012 8:58 pm
Subject: Re: Add a get parameter to all routes without pattern

RequestHeader.queryString returns a Map of query parameter names to lists
of values.  You can access all parameters there.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg  
View profile  
 More options Oct 8 2012, 3:21 am
From: Greg <gregloic...@gmail.com>
Date: Mon, 8 Oct 2012 00:21:00 -0700 (PDT)
Subject: Re: Add a get parameter to all routes without pattern

Hello,

Thanks for your answer. I know I can to that. But if I do not add *
mySecretParam *to all my routes in route file, Play won't be happy. And I
want to avoid adding that parameter to all my routes.

Le lundi 8 octobre 2012 02:58:46 UTC+2, James Roper a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vincent Buzzano  
View profile  
 More options Oct 8 2012, 5:03 pm
From: Vincent Buzzano <vincent.buzz...@gmail.com>
Date: Mon, 8 Oct 2012 23:02:53 +0200
Local: Mon, Oct 8 2012 5:02 pm
Subject: Re: [play-framework] Re: Add a get parameter to all routes without pattern

you should be able to use parameters in query string without add them to
route

eg :
http://mydomain.com/add/77? mySecretParam=ok

it will call this route
GET /add/:id controllers.MyController.add( id : Int)
Le 8 oct. 2012 15:44, "Greg" <gregloic...@gmail.com> a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »