Content with tags, display problems in HTML, JSTL

For example:


 
 
if you use ${ news.title }  

1. When the title is displayed, it does not display: <a><a/>

2. News headlines: a pair of hyperlink tags The headlines become hyperlinked

 

Both problems can be solved by using < c:out value=" ${ news.title}" defualt="None"/>

 

< c:out value="value" default="default" escapeXml="true|false"/>
value="value"----the expression that needs to be output and displayed

default="default"-----The value displayed by the default output,

Note the difference between NULL and empty string

Only NULL can be replaced, "" can't be replaced

escapeXml="true|false"--whether to escape the output content

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326626445&siteId=291194637