-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Values suddenly returned html encoded in template? #1419
Comments
@Axxoul but why is this a problem? Yes, it's normal to encode all texts before rendering them in html. |
@Axxoul can you provide some more code showing how you're using ${obj.minTemp} in the template? |
PS: I just upgraded from 1.5 (where everything was OK) to 1.71. I am guessing this is to do with the data being mistakenly treated as a string from the mysql DB ? @asolntsev This is a problem since it is breaking our Javascript.
this renders to:
which breaks the JS |
Ok just checked and avgTemp() returns a String. So I guess this is working as intended, but Play 1.5 was just returning the string "as is" (i.e. |
@Axxoul Is this |
Play Version (1.5.x / etc)
1.7.1
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
Windows 11
JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)
jdk-11.0.15.1
Library Dependencies
db.driver=com.mysql.cj.jdbc.Driver
jpa.dialect=org.hibernate.dialect.MySQL8Dialect
hibernate.temp.use_jdbc_metadata_defaults=false
Expected Behavior
My template fetches temperatures in the database using :
${obj.minTemp}
All values are stored in mysql database as DOUBLES
With play 1.5, for negative temperatures, I would get
-15
--> ExpectedActual Behavior
Since upgrading to Play 1.7.1, ${obj.minTemp} returns
−15
When calling .raw() I get
−15
which is causing the JS to fail since the returned−
is not being parsed as-
The text was updated successfully, but these errors were encountered: