JSP custom tag rtexprvalue attribute usage instance analysis, rtexprvalue
This document describes the rtexprvalue attribute of the JSP custom tag. Share it with you for your reference. The details are as follows:
In fact, I have also written custom tags before, but I have not noticed the usage of <rtexprvalue>. I have used custom tags in recent days, I suddenly found that the usage of <rtexprvalue> is exquisite.
The full name of rtexprvalue is Run-time Expression Value, which indicates whether JSP expressions can be used.
When <rtexprvalue> true </rtexprvalue> is specified in the <attribute> label, the value of an attribute of the custom label can be specified directly or dynamically calculated,
Example:
<SQL: query var = "result"> select * from mytable order by nameid </SQL: query> <% request. setAttribute ("nameid", "2"); %> <myTag: cupSize = "1" cupSizes = "$ {result}"> </myTag: cupSize> <myTag: cupSize = "$ {nameid}" cupSizes = "$ {result}"> </myTag: cupSize>
When <rtexprvalue> false </rtexprvalue> is specified in the <attribute> label, the value of an attribute of the custom label can only be specified directly. example as follow:
Copy codeThe Code is as follows: <myTag: cupSize = "1" cupSizes = "$ {result}"> </myTag: cupSize>
I hope this article will help you with JSP program design.