Struts2 value Stack

Source: Internet
Author: User

In my previous work, when I encountered a JSP value in struts2, I was not quite clear about the usage of # % (although I learned it before when I learned struts2 ).

I met you again today and sorted it out.

Shows the struts2 context. The content in the value stack is usually used for the attribute values of the current action. You can use the S: Debug label to view the logs.

For values in the value stack in JSP:<S: Property Value="Artist. Bio" />

The values in the value stack can be "upgraded", and the Set tag is used. The scope can be used to specify the range to be upgraded:<S: Set Name="Artistname" Value="Artist. Name" Scope="Session" />

Value at this time:<S: Property Value="# Session ['artidname']" />

We can see that the value of # is added to the non-value stack (context). This is the ognl syntax.

Note the iterator label of struts2: <s: iterator value = "deptvo" Var = "Dept">

The variables defined by VAR are not in the value stack. I guess they are in ATTR (not sure. Please give me some advice ...). Therefore, the value must also be added with #: <s: property value = "# Dept. Manager. Gender"/>

 

Struts2 value Stack

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.