3

First of all, I am using playframework 2 with Java.

I have a Bootstrap-lookahead input field in a view and I want to use a json array as source for it, as described here. I can generate json at server-side with:

Json.toJson(users)

or on client with:

@{Json.toJson(users)}

However it generates strings with " and when I try to create the bootstrap-lookahead field with this data, it gives me

Uncaught SyntaxError: Unexpected token &

Could someone help me with that?

Thank you


WAMP apache httpd.config and hosts - how to alias localhost to port 8080?

Ok so I configured my apache installation on Windows 7 such that it listens on port 8080 by changing the respective entry in httpd.config.

I was too stupid to realize that now I have to access localhost with :8080 at the end.

Question: is there a way to have my box automagically resolve localhost to 127.0.0.1:8080 ? I don't like haviog to type :8080, and NO I CANNOT change the port to 80, I need that one for firewall.

Thanks

4

1 回答 1

4

您可以通过@Html(Json.toJson(users))在模板中使用来防止转义。

文档,最后一段

于 2012-09-12T20:49:59.193 回答