jakartaee / expression-language

Jakarta Expression Language
https://eclipse.org/ee4j/el
Other
67 stars 49 forks source link

Possible inconsistent expression escaping between UEL and JSP #42

Closed glassfishrobot closed 4 years ago

glassfishrobot commented 9 years ago

The JSP specification states that '\$' is an escape for '$' (and references its use for escaping what would otherwise be treated as EL). The EL specification states that '\${' is an escape for '${'.

Given that EL can be used within JSP there is a potential conflict here. Which escape definition is correct? The EL one or the JSP one?

It is possible to take the view that both are correct. When using EL in standard alone mode '\$' would be treated as a literal '\$' and '\${' would be treated as a literal '${'. When using EL in a JSP '\$' would be treated as a literal '$' and '\${' would be treated as a literal '$' followed by a literal '{' or '${'. i.e. the treatment of '\$' would depend on whether it was parsed as EL in standalone or as EL in a JSP.

The different treatment of '\$' and '\${' is confusing. It would be better to have a single, consistent approach across JSP and EL.

My personal preference is for '\${' to be an escape for a literal '${'.

If the view is taken that both specs are correct and the different behaviour between standalone EL and EL in a JSP is desirable then it would help enormously if some clarification (with examples) was added to the specs.

The above all applies equally to '#'.

glassfishrobot commented 6 years ago
glassfishrobot commented 9 years ago

@glassfishrobot Commented Reported by markt_asf

glassfishrobot commented 8 years ago

@glassfishrobot Commented markt_asf said: As I have been working through this on the Tomcat side I have reached the conclusion that both specs are correct but that some clarification would be extremely beneficial.

My understanding of the way the specs interact is as follows.

In standalone EL:

In JSP:

Again, all of the above also applies to #

{...}

expressions.

glassfishrobot commented 9 years ago

@glassfishrobot Commented Was assigned to super_glassfish

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA UEL-42