jakartaee / jakartaee/faces

Standardize how to retrieve ui:param from Backing Bean / FaceletContext

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

Description

Mojarra supports the following:

```
FaceletContext faceletContext = (FaceletContext)FacesContext.getCurrentInstance().getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
Object p1 = faceletContext.getAttribute("someParam");
String param = (String)p1;
```

However, the code above does not always work in MyFaces. One workaround is to use c:set instead, but it would nice to have something spec defined.

Additional Information:

- See BalcusC's post here: https://stackoverflow.com/a/14463426/11402059
- Mastering JavaServer Faces 2.2 by Anghel Leonard also uses the code above in the `Passing bean properties and action methods via ` section
- https://issues.apache.org/jira/browse/MYFACES-4438
- https://jakarta.ee/specifications/faces/4.0/vdldoc/ui/param.html
- https://jakarta.ee/specifications/faces/4.0/apidocs/jakarta/faces/view/facelets/faceletcontext

Contributor guide

Open the contributing guide

Research direction

Start with the Jakarta Faces 4.0 ui:param VDL documentation and FaceletContext API linked in the issue, then compare the behavior described with MYFACES-4438. Done requires a clearly specified, portable way to retrieve ui:param values from a backing bean or FaceletContext.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.