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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:43:38+00:00 2026-06-02T20:43:38+00:00

I´m having a problem redirecting from a play! form. I think the problem lies

  • 0

I´m having a problem redirecting from a play! form. I think the problem lies in how I´m handling the routes. The idea is that a user should be able to go to dashboard.html either by going first through index.hmtl using login from with a secruity key, or by typing directly in a valid path containing an access_token (using a qr-code redirection)

What I´m trying to do is as follows:

1) login using a form on index.html (route: Application.index)

Here is my form (located in index.html):

<form action="@{Dashboard.authenticate()}" method="POST" name="login">
    <input name="key" type="password" maxlength="128" value="${flash.key}">
    <input class="button" id="btnLogin" type="submit" value="Login">
</form>

2) authenticate and redirect to dashboard.html (route: Dashboard.dashboard)

public static void dashboard(String access_token) {
   /*
      ...some code
   */

    render(username);
}


public static void authenticate(String key) {
   /*
      ...some code
   */
     dashboard(access_token);
}

Here is my route file:

# Home page 
GET     /                   Application.index
POST    /dashboard      Dashboard.authenticate
GET     /dashboard      Dashboard.dashboard

The dashboard route works fine if I call directly upon dashboard(String access_token) through an URL like: http://localhost:9000/dashboard?access_token=0000
But if i try to login using the login form that calls upon authenticate(String key) I get this URL http://localhost:9000/dashboard?access_token&key=1234 where key is the var being sent to the auth()function. Clearly my fault lies with the routes, but I have tried and tested the logic and I am 100% certain it is sound.
I´m using Play 1.2.4
I have spent two days on this problem and would be most grateful for any suggestions.

  • 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-02T20:43:41+00:00Added an answer on June 2, 2026 at 8:43 pm

    Problem Solved!

    What I forgot to mention…oops was that I am also using jQuery Mobile and the problem had to do with Play! routing being overriden my jQuery Mobile page routing.

    I disabled the routing by adding the following script:

    $(document).bind("mobileinit", function(){
        $.mobile.ajaxEnabled = false;
        $.mobile.linkBindingEnabled = false;
        $.mobile.hashListeningEnabled = false;
        $.mobile.pushStateEnabled = false;
        $.mobile.changePage.defaults.changeHash = false;
    
    })
    

    Using instructions on the jQuery website: http://jquerymobile.com/test/docs/api/globalconfig.html I implemented the above but the script needs to referenced in the .hmtml header in the following order:

    <script src="jquery.js"></script>
    <script src="custom-scripting.js"></script>
    <script src="jquery-mobile.js"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having problem that when i am trying to submit the form by
I am having a problem with redirecting a page from example.com (to) www.example.com The
I am having difficulty redirecting the output from a console application to a Windows
I'm having problems redirecting stdio of another program using subprocess module. Just reading from
I'm having a problem where my script is redirecting to a location using header()
I'm having problem in redirecting at JS. Here's the situation: the current directory of
I'm having issues with redirecting to the website I want from the facebook canvas.
I'm having a problem with ASP.net redirection. The Copy() method below is called from
Having problem with the middle Div not expanding to the width http://acs.graphicsmayhem.com/images/middiv.jpg Ok, how
I'm having problem when running my Windows Forms program. In the program, 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.