title: Java example of inputRadioGroup in Play2
body: <p>I'm having trouble finding how to implement radio buttons for my form. I need to have 5 radionbuttons in that group representing a grade from 1 to 5.</p>
  
  <p>Form:</p>
  
  <pre><code>public static class MobileWriteReview {
  
      @Constraints.MinLength(1)
      @Constraints.MaxLength(32)
      @Constraints.Required
      public String firstName;
  
      @Constraints.MinLength(1)
      @Constraints.MaxLength(32)
      @Constraints.Required
      public String lastName;
  
      @Constraints.MinLength(5)
      @Constraints.Required
      public String password;
  
      @Constraints.MinLength(5)
      @Constraints.Required
      public String repeatPassword;
  
      @Constraints.Required
      public int grade;
  
      @Constraints.MinLength(30)
      @Constraints.Required
      public String text;
  
      /**
       * Required by play.
       */
      public MobileWriteReview() {
      }
  
      public MobileWriteReview(int grade) {
          this.grade = grade;
      }
  }
  </code></pre>
  
  <p>Controller method:</p>
  
  <pre><code>private static final Form&lt;MobileWriteReview&gt; MOBILE_WRITE_REVIEW_FORM = form(MobileWriteReview.class);
  
  public static Result review(){
          MobileWriteReview mobileWriteReview = new MobileWriteReview(3);
          MOBILE_WRITE_REVIEW_FORM.fill(mobileWriteReview);
          return ok(mobileInviteToReview.render(MOBILE_WRITE_REVIEW_FORM));
      }
  
  public static Result doReview(){
          final Form&lt;MobileWriteReview&gt; filledForm = MOBILE_WRITE_REVIEW_FORM.bindFromRequest();
          if (filledForm.hasErrors()) {
              // User did not fill everything properly
              return badRequest(mobileInviteToReview.render(filledForm));
          } else {
              // Everything was filled
              return ok();
          }
  }
  </code></pre>
  
  <p>view.scala.html</p>
  
  <pre><code>@(inviteForm: Form[_])
  @styles = {
  
  }
  @scripts = {
  
  }
  
  @import helper._
  
  @helper.form(routes.MobileInviteToReview.doReview) {
  
      @if(inviteForm.hasGlobalErrors) {
      &lt;p class="error"&gt;
          &lt;span class="label label-important"&gt;@inviteForm.globalError.message&lt;/span&gt;
      &lt;/p&gt;
      }
  
      @inputRadioGroup(
      // appropriate code here
      )
  </code></pre>
  
  <p>}</p>
  
  <p>So my question is how do I setup the form in my controller and then make use of it in the view?</p>