what tag should we use for struts 1 < bean:size tag in struts 2

1.1k Views Asked by At

In my code, I have used bean tag lib from sturts. Now I want to migrate from 1 to struts 2. So for the below code what tag should I use. < bean:size id="beansize" name="BeanSizeForm" property="list"/>

1

There are 1 best solutions below

0
Dave Newton On

In OGNL you simply access via normal method calls (or getters if there's a JavaBean-standard getter), e.g.,

<s:property value="%{someList.size()}" />

Or use OGNL's list enhancements:

<s:property value="%{someList.size}" />

You may be able to do this via normal JSP EL as well (haven't tried lately):

${someList.size}

You'll probably want to read up on what OGNL provides; it's a little slow, but quite powerful.