calling Application.method(String s) method from index.scala.html

时间:2015-06-15 14:59:12

标签: java scala

I'm struggling to link different parts of scala/java application together

in my controllers.Application I have :

public static Result getInfo(String id) {
...
}

in routes I have :

GET     /Info/:id   controllers.Application.getInfo(id: String)

now what I want to do is to use such structure as part of my webpage

for example in `index.scala.html I want to say -->

<div myid="info">
@helper.form(controllers.Application.getInfo(@id))
</div>

this gives me the following error :

illegal start of simple expression
@helper.form(controllers.Application.getInfo(@id))  //error highlights the @ sign before id

I'm not quite sure what I should put into index.scala.html could someone explain what I am doing wrong please

1 个答案:

答案 0 :(得分:0)

That's not a very useful error message...

I noticed one thing right off the bat, though: in your routes file you have getPersonalInfo but in your Application class you have getInfo for the method name.