Skip to content
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

"javax.faces.WEBAPP_RESOURCES_DIRECTORY" behavior is not correct. #5118

Closed
fukumotyo opened this issue Jun 18, 2022 · 3 comments
Closed

"javax.faces.WEBAPP_RESOURCES_DIRECTORY" behavior is not correct. #5118

fukumotyo opened this issue Jun 18, 2022 · 3 comments

Comments

@fukumotyo
Copy link

Describe the bug

The API document below states that it must not start with a "/", but if it does not start with a "/", it will not work.

ResourceHandler#WEBAPP_RESOURCES_DIRECTORY_PARAM_NAME

To Reproduce

Steps to reproduce the behavior:

  1. Set the following in web.xml
  <context-param>
    <param-name>javax.faces.WEBAPP_RESOURCES_DIRECTORY</param-name>
    <param-value>WEB-INF/resources</param-value>
  </context-param>
  1. Describe the resource to be loaded in the JSF file.
  <h:outputScript library="myjs" name="myapp.js" />
  <h:outputStylesheet library="mycss" name="mystyle.css" />
  1. Create the following resource files
  WEB-INF/resources/myjs/myapp.js
  WEB-INF/resources/mycss/mystyle.css

Expected behavior

Resource files described in the JSF file must be loaded.

@BalusC
Copy link
Contributor

BalusC commented Jun 25, 2022

Wow, that's an awkward oversight there.

The original spec issue is this: jakartaee/faces#996
There's even a comment pointing out this deviation: jakartaee/faces#996 (comment)
I guess the deviation was caused by mix-up of two initial proposals as commented here: jakartaee/faces#996 (comment)

For now the Mojarra impl should silently prepend the / when absent and we'll need a new spec ticket to adjust or drop this requirement.

@fukumotyo
Copy link
Author

I should have added at the beginning that WEBAPP_CONTRACTS_DIRECTORY has the same problem.

The operation was closed by mistake and will be reopened.

@fukumotyo fukumotyo reopened this Jun 25, 2022
@BalusC
Copy link
Contributor

BalusC commented Jun 26, 2022

Confirmed. I'll adjust that one as well.

BalusC added a commit that referenced this issue Jun 26, 2022
BalusC added a commit that referenced this issue Jun 26, 2022
#5118: ensure that leading slash is present on result of context params WEBAPP_RESOURCES_DIRECTORY and WEBAPP_CONTRACTS_DIRECTORY
@BalusC BalusC closed this as completed in 82fd271 Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants