You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Matthias Wessendorf <ma...@apache.org> on 2006/04/18 17:04:27 UTC

Re: JSF and Portlets commandbutton path to my pic

have you tried something like

#{facesContext.externalContext.requestContextPath}

another thing might be using "binding" attribute. With that you'll get
"java based access" to the component inside of your managed bean

Regards,
Matthias

On 4/18/06, Benjamin Bratkus <br...@oio.de> wrote:
> Hello all,
>
> i want to display a pic above my commandButton but i cant find a
> resolution because
> org.apache.jasper.JasperException: /index.jsp(18,0) According to TLD or
> attribute directive in tag file, attribute image does not accept any
> expressions
>
> <h:commandButton value="&gt;"
> image="<%=renderResponse.encodeURL(renderRequest.getContextPath() +
> "/path/to/pic.gif")%>" action="#{Overview.createEmpty}" />
>
>
> any suggestions ? hints?
>
> best regards,
>
> ben
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com

Re: JSF and Portlets commandbutton path to my pic

Posted by Benjamin Bratkus <br...@oio.de>.
hello all,

thanks for your detailed explanation, Matthias, now it works, i've used the

image="#{facesContext.externalContext.requestContextPath}/path/to/pic.gif"

best regards,

ben

Matthias Wessendorf schrieb:
> hey,
>
>   
>> commandButton look like :
>>
>> <h:commandButton value="&gt;"
>> image="#{facesContext.externalContext.requestContextPath} +
>> "/path/to/pic.gif"" action="#{Overview.createEmpty}" />
>>     
>
> please try
>
> image="#{facesContext.externalContext.requestContextPath}/path/to/pic.gif"
>
> if this isn't good for you, bind the component to a backing bean by using
>
> binding="#{mybean.button}"
>
> The property "button" must be type of "HtmlCommandButton"
> there you can use something like
>
> button.setImage("foo.gif");
>
>
> HTH,
> Matthias
>
>   
>> ?
>>
>> best regards,
>>
>> ben
>>
>>
>> Matthias Wessendorf schrieb:
>>     
>>> btw. there is also an *interesting* util clazz inside of MyFaces
>>> ([1])
>>>
>>> [1] http://myfaces.apache.org/impl/apidocs/org/apache/myfaces/portlet/PortletUtil.html
>>>
>>>       
>> thanks for this hint
>>     
>>> On 4/18/06, Matthias Wessendorf <ma...@apache.org> wrote:
>>>
>>>       
>>>> have you tried something like
>>>>
>>>> #{facesContext.externalContext.requestContextPath}
>>>>
>>>> another thing might be using "binding" attribute. With that you'll get
>>>> "java based access" to the component inside of your managed bean
>>>>
>>>>         
>> certainly i could try this one but i want to avoid it
>>
>>     
>>>> Regards,
>>>> Matthias
>>>>
>>>> On 4/18/06, Benjamin Bratkus <br...@oio.de> wrote:
>>>>
>>>>         
>>>>> Hello all,
>>>>>
>>>>> i want to display a pic above my commandButton but i cant find a
>>>>> resolution because
>>>>> org.apache.jasper.JasperException: /index.jsp(18,0) According to TLD or
>>>>> attribute directive in tag file, attribute image does not accept any
>>>>> expressions
>>>>>
>>>>> <h:commandButton value="&gt;"
>>>>> image="<%=renderResponse.encodeURL(renderRequest.getContextPath() +
>>>>> "/path/to/pic.gif")%>" action="#{Overview.createEmpty}" />
>>>>>
>>>>>
>>>>> any suggestions ? hints?
>>>>>
>>>>> best regards,
>>>>>
>>>>> ben
>>>>>
>>>>>
>>>>>           
>>>> --
>>>> Matthias Wessendorf
>>>> Aechterhoek 18
>>>> 48282 Emsdetten
>>>> http://jroller.com/page/mwessendorf
>>>> mwessendorf-at-gmail-dot-com
>>>>
>>>>
>>>>         
>>> --
>>> Matthias Wessendorf
>>> Aechterhoek 18
>>> 48282 Emsdetten
>>> http://jroller.com/page/mwessendorf
>>> mwessendorf-at-gmail-dot-com
>>>
>>>
>>>
>>>       
>>     
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>
>
>   


Re: JSF and Portlets commandbutton path to my pic

Posted by Matthias Wessendorf <ma...@apache.org>.
hey,

> commandButton look like :
>
> <h:commandButton value="&gt;"
> image="#{facesContext.externalContext.requestContextPath} +
> "/path/to/pic.gif"" action="#{Overview.createEmpty}" />

please try

image="#{facesContext.externalContext.requestContextPath}/path/to/pic.gif"

if this isn't good for you, bind the component to a backing bean by using

binding="#{mybean.button}"

The property "button" must be type of "HtmlCommandButton"
there you can use something like

button.setImage("foo.gif");


HTH,
Matthias

>
> ?
>
> best regards,
>
> ben
>
>
> Matthias Wessendorf schrieb:
> > btw. there is also an *interesting* util clazz inside of MyFaces
> > ([1])
> >
> > [1] http://myfaces.apache.org/impl/apidocs/org/apache/myfaces/portlet/PortletUtil.html
> >
> thanks for this hint
> > On 4/18/06, Matthias Wessendorf <ma...@apache.org> wrote:
> >
> >> have you tried something like
> >>
> >> #{facesContext.externalContext.requestContextPath}
> >>
> >> another thing might be using "binding" attribute. With that you'll get
> >> "java based access" to the component inside of your managed bean
> >>
> certainly i could try this one but i want to avoid it
>
> >> Regards,
> >> Matthias
> >>
> >> On 4/18/06, Benjamin Bratkus <br...@oio.de> wrote:
> >>
> >>> Hello all,
> >>>
> >>> i want to display a pic above my commandButton but i cant find a
> >>> resolution because
> >>> org.apache.jasper.JasperException: /index.jsp(18,0) According to TLD or
> >>> attribute directive in tag file, attribute image does not accept any
> >>> expressions
> >>>
> >>> <h:commandButton value="&gt;"
> >>> image="<%=renderResponse.encodeURL(renderRequest.getContextPath() +
> >>> "/path/to/pic.gif")%>" action="#{Overview.createEmpty}" />
> >>>
> >>>
> >>> any suggestions ? hints?
> >>>
> >>> best regards,
> >>>
> >>> ben
> >>>
> >>>
> >> --
> >> Matthias Wessendorf
> >> Aechterhoek 18
> >> 48282 Emsdetten
> >> http://jroller.com/page/mwessendorf
> >> mwessendorf-at-gmail-dot-com
> >>
> >>
> >
> >
> > --
> > Matthias Wessendorf
> > Aechterhoek 18
> > 48282 Emsdetten
> > http://jroller.com/page/mwessendorf
> > mwessendorf-at-gmail-dot-com
> >
> >
> >
>
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com

Re: JSF and Portlets commandbutton path to my pic

Posted by Benjamin Bratkus <br...@oio.de>.
hello matthias,

thanks for your fast reply,

could you give me more details for this sollution ? should my 
commandButton look like :

<h:commandButton value="&gt;"
image="#{facesContext.externalContext.requestContextPath} +
"/path/to/pic.gif"" action="#{Overview.createEmpty}" />  


?

best regards,

ben


Matthias Wessendorf schrieb:
> btw. there is also an *interesting* util clazz inside of MyFaces
> ([1])
>
> [1] http://myfaces.apache.org/impl/apidocs/org/apache/myfaces/portlet/PortletUtil.html
>   
thanks for this hint
> On 4/18/06, Matthias Wessendorf <ma...@apache.org> wrote:
>   
>> have you tried something like
>>
>> #{facesContext.externalContext.requestContextPath}
>>     
>> another thing might be using "binding" attribute. With that you'll get
>> "java based access" to the component inside of your managed bean
>>     
certainly i could try this one but i want to avoid it

>> Regards,
>> Matthias
>>
>> On 4/18/06, Benjamin Bratkus <br...@oio.de> wrote:
>>     
>>> Hello all,
>>>
>>> i want to display a pic above my commandButton but i cant find a
>>> resolution because
>>> org.apache.jasper.JasperException: /index.jsp(18,0) According to TLD or
>>> attribute directive in tag file, attribute image does not accept any
>>> expressions
>>>
>>> <h:commandButton value="&gt;"
>>> image="<%=renderResponse.encodeURL(renderRequest.getContextPath() +
>>> "/path/to/pic.gif")%>" action="#{Overview.createEmpty}" />
>>>
>>>
>>> any suggestions ? hints?
>>>
>>> best regards,
>>>
>>> ben
>>>
>>>       
>> --
>> Matthias Wessendorf
>> Aechterhoek 18
>> 48282 Emsdetten
>> http://jroller.com/page/mwessendorf
>> mwessendorf-at-gmail-dot-com
>>
>>     
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>
>
>   


Re: JSF and Portlets commandbutton path to my pic

Posted by Matthias Wessendorf <ma...@apache.org>.
btw. there is also an *interesting* util clazz inside of MyFaces
([1])

[1] http://myfaces.apache.org/impl/apidocs/org/apache/myfaces/portlet/PortletUtil.html

On 4/18/06, Matthias Wessendorf <ma...@apache.org> wrote:
> have you tried something like
>
> #{facesContext.externalContext.requestContextPath}
>
> another thing might be using "binding" attribute. With that you'll get
> "java based access" to the component inside of your managed bean
>
> Regards,
> Matthias
>
> On 4/18/06, Benjamin Bratkus <br...@oio.de> wrote:
> > Hello all,
> >
> > i want to display a pic above my commandButton but i cant find a
> > resolution because
> > org.apache.jasper.JasperException: /index.jsp(18,0) According to TLD or
> > attribute directive in tag file, attribute image does not accept any
> > expressions
> >
> > <h:commandButton value="&gt;"
> > image="<%=renderResponse.encodeURL(renderRequest.getContextPath() +
> > "/path/to/pic.gif")%>" action="#{Overview.createEmpty}" />
> >
> >
> > any suggestions ? hints?
> >
> > best regards,
> >
> > ben
> >
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com