-1

I am trying to use c:out value=myClass.myMethod to output a value. in the java code of myMethod I am trying to add css class stlying to cause part of the outputted string to be modified by the a stringPart1 stringPart2 Therefore, I build the string in the java code and call the method in my jsp. My output on my web page is StringPart1 : StringPart2. Therefore, how would one accomplish this? The data string comes from the backend java call and must have the css class applied to stringPart1 and not stringPart2.

Jimbo
  • 4,352
  • 3
  • 27
  • 44
user2631746
  • 11
  • 1
  • 1

1 Answers1

4
public class StringParts {
    private String part1;
    private String part2;

    // constructor, getters
}

...

<span class="part1"><c:out value="${stringParts.part1}"/></span>
:
<span class="part2"><c:out value="${stringParts.part2}"/></span>
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255