Kind Note: I've tried my best to present this question as clear as possible. In case, if you want more details or if the question is not clear kindly let me know rather downvoting the question, I'll edit for you.
I've a list
of strings
in this format CatalogSwitcherInterrupter-active__..false
and I want to present this on jsp in the attached screenshot.
Below is the html snippet for the above html table.
<table border="1"> <tr> <th>Component</th> <th>Properties</th> <th>J01</th> <th>J02</th> <th>W01</th> <th>W02</th> </tr> </table>
Component td data will be replaced by CatalogSwitcherInterrupter , Properties td data will be replaced by active and J01 ,J02,W01,W02 td data will be replaced by true or false based on the string. I'll use jstl
tags to render this data dynamically.
Have used StringTokenizer
with -__..
as a delimiter, it didn't give the desired result and making code more dirty by increasing the code inside scriplet tags.
Now, I would like to request smart people here, Is there a better way to split this string CatalogSwitcherInterrupter-active__..false
using StringTokenizer
or split
method and present on jsp using jstl tags or minimal scriplets?
I'm relatively a beginner in java web programming. Any kind of inputs is of great help.
Thanks in advance.
Are you using an MVC framework? Even if you aren't, the MVC approach is better for such tasks. I'd do the following:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.