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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:15:58+00:00 2026-06-13T14:15:58+00:00

I have some route define as: Post /login controllers.MyController.someMethod() and inside someMethod I use

  • 0

I have some route define as:

Post /login  controllers.MyController.someMethod()

and inside someMethod I use DynamicForm to extract parameters from the post request.

works fine from browser or any client using Post method.

But if I need to call this url inside some action method (lets say someAnotherMethod) and want to pass some parameters also, how can I achieve this? What I mean is:

public static Result someAnotherMethod() {
// want to put some data in post request body and
return redirect(routes.MyController.someMethod().url());
  • 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-13T14:15:59+00:00Added an answer on June 13, 2026 at 2:15 pm

    1. With argument (it’s not a redirect!)

    You can return Result from other method without redirecting:

    public static Result someMethod(){
        DynamicForm dynamicForm = form().bindFromRequest();
        return otherMethod(dynamicForm);
    }
    
    public static Result otherMethod(DynamicForm dataFromPrevRequest) {
        String someField = dataFromPrevRequest.get("some_field");
        Logger.info("field from request is: " + someField);
        return ok("Other method's Result");
    }
    

    2. With cache (probably best replacement of POST data in these solutions)

    Also you can store data from incoming request to the database or even ‘cheaper’ to the Cache and then fetch it in other method.:

    public static Result someMethod(){
        DynamicForm dynamicForm = form().bindFromRequest();
    
        Cache.set("df.from.original.request", dynamicForm, 60);
        return redirect(routes.Application.otherMethod());
    }
    
    public static Result otherMethod() {
        DynamicForm previousData = (DynamicForm) Cache.get("df.from.original.request");
    
        if (previousData == null) {
            return badRequest("No data received from previous request...");
        }
    
        // Use the data somehow...
        String someData = previousData.get("someField");
    
        // Clear cache entry, by setting null for 0 seconds
        Cache.set("df.from.original.request", null, 0);
    
        return ok("Previous field value was " + someData);
    }
    

    3. As common GET

    Finally you can just create method with required args only and pass them in the first method (receiving request).

    public static Result someMethod(){
        DynamicForm df = form().bindFromRequest();
    
        return redirect(routes.Application.otherMethod(df.get("action"), df.get("id")));
    }
    
    public static Result otherMethod(String action, Long id) {
        return ok("The ID for " + action +" action was" + id);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to define a route that have 2 optional parameters in the middle
In express, I have defined some routes app.post(/api/v1/client, Client.create); app.get(/api/v1/client, Client.get); ... I have
I have a Base Router where i define some functions that need to be
I define my routes object (jq bbq) and in some cases i have to
I have a javascript functions that fetches some JSON from a PHP. When I
I have a function inside a toolbar, let's call it: Ext.define('MyArchive.Toolbar', { search: function()
I have an asp.net MVC project where i need to define some custom routes.
I have a route defined as follows: (r'^edit/(\d+)/$', 'app.path.edit') I want to use the
In routes.rb, I have: [some routes] match '/me' => scores#all_athlete_scores, :constraints => LoggedInChecker devise_scope
I have some data loaded as a np.ndarray and need to convert it 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.