开发者

How to display Java command-line error messages that are formatted as HTML?

开发者 https://www.devze.com 2023-03-09 22:20 出处:网络
I have an external library that is formatting notification messages in the form of HTML tables even though my program is displaying this information on the command line:

I have an external library that is formatting notification messages in the form of HTML tables even though my program is displaying this information on the command line:

<table><tr><td>Some message</td></tr></table>

That's fine for short messages but with longer messages that contain a large quantity of markup, I can't understand the markup on the command line.

I could (a) pass the error message开发者_如何学运维s to JSTL and try to display them as HTML but when I do the HTML is escaped by JSTL and not displayed in its HTML tabular format.

Or (b) is there some way of printing it to the command line without this markup (I have the source - do I need to go in and change how everything is outputted by the library?)


One option is to copy it to a new *.html file and open with a browser.


If it was just a hack I think I'd pass the HTML to Lynx to render.


Assuming that the format is restricted a little light regexp search and replace to replace <td> with tab, <tr> with carriage return and all other tags with nothing might do the trick.

0

精彩评论

暂无评论...
验证码 换一张
取 消