• Post Reply Bookmark Topic Watch Topic
  • New Topic

Replacing a space in each brand name  RSS feed

 
Dan Acuff
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to prepare the brand names to have an image associated with them.
In the example below done by another helpful consultant, I am using the encoding method to string the brand names together; getEncodedString(_brand)

That leaves me with image names like Bud+Light.jpg

<c:forEach items="#{customerSession.shopByBrand}" var="_brand"
varStatus="_cnt">
<li style="#{_cnt.last ? 'border-bottom: 1px solid #7f7777;':''}">

<a
href="/webstore/store/#{customerSession.store.shortName}/category/4_1_0_2_#{conversation.id}/#{customerSession.getEncodedString(_brand)}">
<h:graphicImage value="#{customerSession.imageServer}/images/#{customerSession.getEncodedString(_brand)}.jpg"/> #{_brand}</a>

</li>
</c:forEach>

My designer would rather have an underscore. I have tested all of the major browsers and a + symbol seems to be fine. But HOW WOULD I replace the space with and UNDERSORE instead?

Thank you very much.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!