external resources in attributes (i.e. image in commandButton): doubleslash not
working as expected, URL requires protocol
--------------------------------------------------------------------------------------------------------------------------
Key: MYFACES-1583
URL: https://issues.apache.org/jira/browse/MYFACES-1583
Project: MyFaces Core
Issue Type: Bug
Affects Versions: 1.1.4
Environment: MyFaces 1.1.4 and facelets on Websphere on Linux, AIX and
in RSA/RAD.
Reporter: John Elm
Consider for a moment the following image input. Let's say I have a
myfaces app, with a context root of "my/context/root", with a domain
name of "www.mycompany.com".
<input
type="image"
src="//www.mycompany.com/images/blah.gif"
name="blah"
value="Blah" />
Notice that the src attribute starts with a doubleslash. When
authoring non-JSF tags (i.e. in non-JSF apps), this has been an effective way
to include
resources that are external to our app (typically hosted at a central
location somewhere in our enterprise).
Our web standards actually do
not allow us to include the protocol in the URL, but when we author
the attribute this way, the browser prepends the protocol (i.e. https://)
that was used to retrieve the page. This browser behavior seems the same with
all external resources, i.e. javascripts, css, etc.
Now, consider the JSF example for the same input:
<h:commandButton
action="#{backingBean.someAction}"
image="//www.mycompany.com/images/blah.gif" />
MyFaces renders this:
<input
type="image"
src="my/context/root//www.mycompany.com/images/blah.gif"
...
Of course, if I include the https: protocol in the URL, MyFaces
correctly interprets and renders it as a complete external URL.
When we supply an external resource, as when using the image attribute in a
commandButton, shouldn't MyFaces behave in the same way as when we point to an
external resource while composing non-JSF tags? In particular, when we begin
the URL with a doubleslash, shouldn't it interpret the URL as an external
resource and prepend the protocol that was used to retrieve the page? If
MyFaces merely rendered these attributes unmodified, I think the browser would
handle it correctly.
As it is, in order to avoid including the protocol in these URLs, I must
maintain local copies of these image resources in our web app, which is also
discouraged by our web standards.
I found this, it sounds like this may have been when the behavior was
introduced.
http://issues.apache.org/jira/browse/MYFACES-476
Perhaps also relevant:
http://issues.apache.org/jira/browse/MYFACES-52
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.