[Migrated text] bizarre questions about unparsed JSP code

Source: Internet
Author: User
Tags rowcount

Today I encountered a very strange problem.

The Red Section in the following code defines a button.

 

<Logic: notempty name = "labexamineform" property = "examineresultlist">
<% Int rowcount = 0; %>
<Logic: iterate id = "result" name = "labexamineform" property = "examineresultlist">
<Tr bgcolor = "# f3fbff" id = "result_table <% = rowcount %>">
<TD>
<Div align = 'center'> & nbsp; <Bean: write name = "result" property = "name"/> </div>
</TD>
<TD>
<Div align = 'center'> & nbsp; <Bean: write name = "result" property = "item"/> </div>
</TD>
<TD>
<Div align = 'center'> & nbsp; <Bean: write name = "result" property = "result"/> </div>
</TD>
<TD>
<Div align = 'center'> & nbsp; <HTML: button property = "delbutton" value = "delete" onclick = "delrow ('result _ TABLE <% = rowcount %> ')"/> </div>
</TD>
</Tr>
<% Rowcount ++; %>
</Logic: iterate>
</Logic: notempty>


 

There is a JSP value statement (orange part)

However, this <% = rowcount %> is not parsed every time you access this page, so that the red HTML code in the page source file is like this (<% = rowcount %> ') "directly appears in the source file)

<Input type = "button" name = "delbutton" value = "delete" onclick = "delrow ('result _ TABLE <% = rowcount %> ')"/>

When I tried a variety of methods, I suddenly thought that the struts tag <HTML: button is to be re-translated by the server. Will this cause a problem?

Change the red part to <input type = "button"

Finally, it works properly. The red part of the page source file is correctly parsed

<Input type = "button" name = "delbutton" value = "delete" onclick = "delrow ('result _ table0')"/>

I have never encountered this problem before and do not know whether it is a bug.

The preceding figure shows that struts labels are not needed when JSP code is added.

 

 

<Input type = "button" name = "delbutton" value = "delete" onclick = "delrow ('result _ TABLE <% = rowcount %> ')"/>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.