Jsp,ognl a method that invokes a background action

Source: Internet
Author: User

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

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.