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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:25:37+00:00 2026-06-18T06:25:37+00:00

I am using Play 1.2.5 I have a User model as below: @Entity public

  • 0

I am using Play 1.2.5

I have a User model as below:

@Entity
public class User extends Model {
public String name;
public String city;
public String country;
public Integer zip;
}

The registration.html file is like this:

#{extends 'main.html' /}
#{set title:'Home' /}

<form action="@{Application.registerUser()}" method="get">
Name: <input type="text" name="txtName"><br>
City: <input type="text" name="txtCity"><br>
Country: <input type="text" name="txtCountry"><br>
Zip: <input type="text" name="txtZip"><br>
<input type="submit" value="Submit">
</form>

Below is the registerUser method in Application Controller:

public static void registerUser(String txtName,String txtCity,String txtCountry,Integer txtZip){
    //some business logic
    render();
}

The above signature works fine but I have to add a lot of parameters in the method which I dont want.

In a form, I have more than 15 fields, in such a case 15 parameters are too much!!!

Hence I need to know how to bind the user input values to a model (e.g. user model shown above) and pass it to the controller as an user object parameter to the method or as a map with key and value pairs (which ever is easier)?

Please let me know about this.

Regards,

  • 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-18T06:25:39+00:00Added an answer on June 18, 2026 at 6:25 am

    Rename your input fields to user.name, user.city, etc., and change the controller method to

    public static void registerUser(User user)
    

    This is described in the documentation.

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

Sidebar

Related Questions

I am using Play framework with Ebean. I have two models, below are the
I have been using play 1.2.5rc4 for development of one app and I have
We are using play 1.2.x DB evolutions feature. I want to have the scripts
I am using Play Framework 2.0 with Scala. So I have an action that
I have a .wav music file. When I tried to play using SoundEffect.Play(); mus1.Play();
I just have an XP machine, and i want to play around using CC.NET.
iam using AVFoundation Framework to play mp3 file ,everything works great ، i have
I'm using CoreAudio on iOS 5 to play MIDI files. I have everything setup,
I am using the AVAudioPlayer framework, and I have several sounds that play one
I am using a model in Play like this: package models; import java.util.*; import

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.