jsp's comments may affect the page loading speed so that the code can be thrown to continue execution

  • 2021-07-03 00:44:10
  • OfStack

On the jsp page, use the " < !-- -- > ", the java code in the comment will still be executed, and you can look at the page source code to see the finished content, which will make the code you don't want to execute execute and affect the loading speed. For example, the following code:


Gender :<select name="qureyItemGroup.sex" class="selinp" style="width:75px;">
<option value=""> All </option>
<s:iterator value="listDictSex">
<option <s:property value="@com.hljw.util.UtilAPI@getHtmlSelected(dict_value,qureyItemGroup.sex)"/> value="<s:property value="dict_value"/>"><s:property value="dict_name"/></option>
</s:iterator>
</select>

On the jsp page, it is recommended to use " < %-- --% > "Such comments, and such comments are not visible when viewing the source code on the page.


Related articles: