Use%{} to take action from the Valuestack and call its method directly.
%{testa (' key ')} to invoke the Testa (String s) method of the action
But these all need to be combined with struts2 tags. such as: <s:property value= "%{testa (' key ')}"/>
key is a parameter that needs to be passed, the return value of the Testa method in the background is of type string, the key is the value,
For example <s:property value= "%{testa (#u. Tbpricegreade.pricegreade)}"/>
after I experiment, the return value can also be a list collection, this time is generally used when traversing <select>
<s:iterator id= "Ids1" value= "%{getlisttblsuperpprice (#li. ProductId)}" status= "Stat4" > Getlisttblsuperpprice Returns a list collection
if a single fixed value is used for ' key ', the fixed value is rare because it doesn't make any sense .
There is another way:
<s:property value= "@[email protected" (#session. Tblordermyself.categoryid). Machineroomname "/>Let's see it.
Jsp,ognl a method that invokes a background action