playframework / playframework/play1

Values suddenly returned html encoded in template?

Open
#1,419 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.6k
Forks
671
Avg merge
12d 15h
Merged PRs (30d)
1

Description

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 --> Expected

Actual 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 -

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the ${obj.minTemp} interpolation with a negative DOUBLE value on Play 1.7.1, comparing normal and .raw() output. The fix is done when negative temperatures render with an ASCII - suitable for JavaScript without breaking the intended template escaping behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.