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

Jsp tags not working together with EL expressions #56

Closed
naftolib opened this issue Mar 22, 2022 · 4 comments
Closed

Jsp tags not working together with EL expressions #56

naftolib opened this issue Mar 22, 2022 · 4 comments

Comments

@naftolib
Copy link

naftolib commented Mar 22, 2022

Hi. I would like to report an issue that when using the encoder with jsp tags it works perfectly only when using static content like this:
<e:forHtml value="</script>" but not when using EL like this: <e:forHtml value="${param.id}"\>. When using EL, the expression isn't being evaluated but rather gets printed as is on the screen. There might be something wrong with my web.xml and would need additional configs to make it work, or there might be something with the tags that they do not support EL. Please look into it.

Thanks a lot

@naftolib naftolib changed the title Jsp tagger not working together with EL expressions Jsp tags not working together with EL expressions Mar 22, 2022
@jmanico
Copy link
Member

jmanico commented Mar 22, 2022

cc @jeremylong cc @kwwall help?

@jeremylong
Copy link
Member

@naftolib We would need a little more information about your project to help - as you appear to be using the exact same syntax that was tested and is documented: https://github.com/OWASP/owasp-java-encoder/blob/main/jsp/src/site/markdown/index.md#jsp-usage

If you are using EL - I would avoid using the tags and just use: ${e:forHtml(param.value)}

@naftolib
Copy link
Author

I have tried this syntax as well ${e:forHtml(param.value)} but had the same issue. I managed to create my own tag around as a wrapper to the owasp-tag and using apache ExpressionUtil was able to get the expressions evaluated. If indeed EL was tested and works for you that it's most probably our project setup which is causing the issue. Unfortunately I can not share any project specific details publicly. Thanks for your research

@jeremylong
Copy link
Member

I have again verified that the tags are working as expected. I've even attempted to add a selenium test in PR #75 that will test to ensure things are working as expected. While I've manually tested this, I still have issues with the selenium test containers. However, see:

https://github.com/OWASP/owasp-java-encoder/pull/75/files#diff-c7319af1105097e9fa7147b6cd62af0e0661cfad91b977e7924e4e3263d188e6R22-R23

As such, I'm closing this issue.

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

4 participants
@jmanico @jeremylong @naftolib and others