am using a form containing only one input text and one submit button. I want to forward the text from the input text box to the controller on the backend. maybe if you look at the code snippet it will give a better picture of what I'm trying to do.
this is from the index.html page
@helper.form(action=routes.Application.index()){ <input type='text' name='myname' /> <input type='submit' name='mysubmit' value='Create Class' /> }
below is a snippet of code from the controller
public class Application extends Controller { public static Result index() { return ok(index.render(null)); } }
the code displays the form as expected, but I want to pass the string entered in the input text box to the controller method, and then print the text. As shown below.
System.out.println(variable);
where the variable is the test entered in the text box. Any suggestions would be welcome.
source share