I read some articles about using HTML: link. Most of them only talk about the use of paramid in combination with paramname and paramproperty. The following describes the effects of name, paramid, paramname, and paramproperty.
The first is to explain the simple application paramid, paramname and paramproperty.
<HTML: link action = "/atctionname" paramid = "paramvalue" paramname = "beanname" paramproperty = "beanproperty"> click the link
Suppose there is a bean named beanname in the scope, and the beanproperty value of beanname is value, then after you click the link, there will be the following link effect:
Http: // localhost: 8080/projectname/atcionname? Paramvalue = Value
The paramid attribute tells the JSP compilation engine which parameter you want to transmit.
The paramname attribute uses the bean, and the paramproperty attribute uses the bean attribute. The combination of the two is to let you tell the JSP compilation engine that you want to transmit the attribute values in the bean using parameters.
Only one parameter can be transferred, but it is often not enough in the application. The name attribute is used to transmit multiple parameters.
The name attribute must be a map-type variable.
Assume that you define the following map:
Map mapname = new hashmap ();
Mapname. Put ("paramvalue1", "value1 ");
Mapname. Put ("paramvalue2", "value2 ");
Request. setattribute ("mapname", mapname );
The following link is available on the JSP page:
<HTML: link action = "/atctionname" name = "mapname"> click the link.
Effect after clicking the link:
Http: // localhost: 8080/projectname/atcionname? Paramvalue1 = value1 & paramvalue2 = value2
In my practice, I thought that when parsing tags, I should parse all the attributes used. So I did the following test,
The following is an example of using four attributes:
<HTML: link action = "/atctionname" name = "mapname" paramid = "paramvalue" paramname = "beanname" paramproperty = "beanproperty"> click the link
The result is:
Http: // localhost: 8080/projectname/atcionname? Paramvalue1 = value1 & paramvalue2 = value2 & paramvalue = Value
All attribute values are parsed.
This effect can be applied to the link effect that you want to deduce at the first level. That is to say, after you submit, you can
The value of paramvalue is put into the map of mapname and then returned. It is used in the name attribute. When you want to return the above level, you can
Remove. Or when your parameters are stored in the cascading keys of multiple tables in the database, you can directly obtain the master key to query the upper-level tables, you do not need to go back to the database at the first level to provide primary keys.