playframework 2.0 - Trouble with Display images -


i have trouble display images when using play + java

first, upload it, when click upload. image show in browser.

the trouble appeared in here.

if follow code :

<img src="@routes.assets.at("upload/abc.png")" width="304" height="228"> 

this worked fine. if fix :

@(filename:string) <img src="@routes.assets.at("upload/@filename")" width="304" height="228"> //ofcourse filename=="abc.png" 

the images not shown.

is @filename not working or wrong in somewhere ? gramma ? logic ?

and ideal case ?

it's literally looking file named upload/@filename. first @ started expression, after need use variable name without @ , append string.

@(filename:string) <img src="@routes.assets.at("upload/" + filename)" width="304" height="228"> 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -