Hi all,

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, 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 (https://)
that was used to retrieve the page.

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.

Do any of you know a way that I can indicate an external resource in
the image attribute of a commandButton, without indicating the
protocol?  Since the commandButton image attribute behaves differently
than the image input's src attribute, should this be reported as a
bug?

Reply via email to