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.
Asked
Active
Viewed 2,571 times
-1
-
Please explain your code and requirement clearly. – Ankur Lathi Jul 30 '13 at 12:54
1 Answers
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