Problem with GraphicImageRenderer

UI Components for JSF
Post Reply
ingemar
Posts: 7
Joined: 26 Aug 2010, 12:25

28 Sep 2010, 16:20

The <p:graphicImage> Component does not work together with Apache Orchestra because it fails handling actionURLs containing parameters.

It renders corrupt src URLS like this one:

<img ... src="/MyApp/myPage.jsf?conversationContext=1?primefacesDynamicContent=myPage.icon" ...

The following change should fix it. It will be great, if you could commit this fix.

Thank you!

Original:

Code: Select all

protected String getImageSrc(FacesContext facesContext, GraphicImage image) {                  
    ...
    StringBuilder builder = new StringBuilder(getActionURL(facesContext));
    builder.append("?").append(DynamicContentStreamer.DYNAMIC_CONTENT_PARAM).append("=").append(expressionParamValue);
    ...
 }  

Replacement:

Code: Select all

protected String getImageSrc(FacesContext facesContext, GraphicImage image) {                  
    ...
    String actionURL = getActionURL(facesContext);
    StringBuilder builder = new StringBuilder(actionURL);
    if(actionURL.contains("?")){
        builder.append("&");
    }else{
        builder.append("?");
    }
    builder.append(DynamicContentStreamer.DYNAMIC_CONTENT_PARAM).append("=").append(expressionParamValue);
    ...
 }  


cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Sep 2010, 18:20

You can create an issue ticket and attach a patch for this. Thanks for your feedback.

ingemar
Posts: 7
Joined: 26 Aug 2010, 12:25

29 Sep 2010, 09:54

I created an issue, but i've not added a patch because i've not tested the fix.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Sep 2010, 10:55

No problem, thanks for your feedback.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests