scala - Error while accessing List[String] in play framework -


i trying access list[string] in controller write code: view is

@(path:list[string])    ...     <button type=submit id=imgbutton><a href="@routes.application.confirmdelete(path)">delete</a></button> 

my routes is

       /confirmdelete/:path      controllers.application.confirmdelete(path:list[string]) 

my controller is:

def confirmdelete(path:list[string])=action{      ok("deleted "+path);      } 

but gives me error as

   no url path binder found type list[string]. try implement implicit pathbindable type. 

the error here absolute clear. play not have idea how serialize list[string] , uri. can implement implicit pathbindable conversion list[string] or submit list coma separated string , build list[string] on controllers side string parameter.

documentation pathbindable - http://www.playframework.com/documentation/api/2.1.x/scala/index.html#play.api.mvc.pathbindable

also may check here second solution - play framework 2: use array[string] in route


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -