Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

tel or mailto links Exception #256

Open
djmj opened this issue Dec 25, 2017 · 3 comments
Open

tel or mailto links Exception #256

djmj opened this issue Dec 25, 2017 · 3 comments

Comments

@djmj
Copy link

djmj commented Dec 25, 2017

I used a PrimeFaces p:link with a phone href value like tel: 0123 456789 and PrimeFaces calls context.getExternalContext().encodeResourceURL(url). So rewrite module is invoked and fails with following exception. Is it a primefaces problem, that they should not call this function in case of a simple href?

java.net.URISyntaxException: Illegal character in opaque part at index 8: 
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parse(URI.java:3058)
at java.net.URI.<init>(URI.java:588)
at org.ocpsoft.urlbuilder.AddressBuilder.create(AddressBuilder.java:79)
at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.encodeURL(HttpRewriteWrappedResponse.java:394)
@chkal
Copy link
Member

chkal commented Dec 26, 2017

Actually tel:0123 456789 isn't a valid URL/URI. The space character is not allowed. Unfortunately Rewrite currently fails for invalid URLs. You could have the latest snapshots a try. I recently committed some changes which will result in Rewrite handling invalid URLs more gracefully.

@djmj
Copy link
Author

djmj commented Dec 26, 2017

Thank you, i did not know that.I will test it later but removing the spaces made it work.

Is it possible to rewrite tel or mailto links at all?

@chkal
Copy link
Member

chkal commented Dec 26, 2017

Could work. Not sure. Never tried it. 😄

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants