Q:

How do I apply CSS to part of the c:out value

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.

A:

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>

