jakartaee / jakartaee/faces

Character Escape Bug With Programmatic Views

Open
#1,796 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
127
Forks
59
Avg merge
23h
Merged PRs (30d)
7

Description

This this a problem sprung from #1581 and seen in MyFaces.

The special characters, such as less-than, greater-than (< >), are escaped in MyFaces, but not in Mojarra.

If they are escaped, then the `` tag will be visible on the rendered page. By default MyFaces escapes these characters, and the RenderKit Documentation specifics that **escape should be enabled by default (i.e. true)** for component family jakarta.faces.Output and renderer jakarta.faces.Text. These are what UIOutput is registered with. (Maybe this issue could be a bug in Mojarra?)

See `escape` attribute -
https://jakarta.ee/specifications/faces/4.0/renderkitdoc/HTML_BASIC/jakarta.faces.Outputjakarta.faces.Text.html

For a concrete example, the [hello facelet](https://github.com/jakartaee/faces/blob/07843e24dd2a6a2520433d9b8376d93942bdf113/tck/faces40/javaPage/src/main/java/ee/jakarta/tck/faces/test/faces40/javapages/Hello.java#L21) from the TCK would render this output in MyFaces:

```
<html xmlns="http://www.w3.org/1999/xhtml">

</html>
```

image

Contributor guide

Open the contributing guide

Research direction

Read the RenderKit documentation linked in the issue and inspect the TCK example in tck/faces40/javaPage/.../Hello.java. Reproduce the hello facelet output with Mojarra and compare it with the shown MyFaces output. Done means programmatic UIOutput rendering escapes the special characters by default as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.