struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Bond" <mar...@marcusbond.me.uk>
Subject RE: fetching a static variable's value from within a JSP page
Date Wed, 20 Jun 2012 17:01:34 GMT
Is it possible that in your example code there are lines referencing
property instanceCount where they should reference helloCount?

-----Original Message-----
From: Sam Cyrus [mailto:hamintouri@yahoo.com] 
Sent: 20 June 2012 17:24
To: Struts send question
Subject: fetching a static variable's value from within a JSP page

Hi,

I am trying to follow the tutorial Hello World for Struts2. In the part
"Using Struts 2 Tags" it uses s:property to fetch the value for the
helloCount variable inside a paragraph tag but doing as the example shows,
doesn't get any value and the place is empty in HelloWorld.jsp. The lines
below from this jsp shows my different trials and when it works. I would
like to know the reason:

<body>
    <h2><s:property value="messageStore.message" /></h2>

    <p>It is possible to fetch the static helloCount outside paragraph tags:
</p> <s:property value="helloCount" />

    <p>Inside paragraph tags the static helloCount preceded by @-prefix
returns  <s:property value="@helloCount" />  empty times!</p>

    <p>Inside paragraph tags the static helloCount without @-prefix returns
<s:property value="instanceCount" />  empty times!</p>

    <p>By assigning the static value to an instance variable inside the
execute method <s:property value="instanceCount" /> works well inside
p-tags</p>

    <p> Still strange! The DAY-OF-WEEK is static but possible to fetch
inside p-tags: <s:property value="@java.util.Calendar@DAY_OF_WEEK"/> as
expected</p> </body>

Best regards
/// Sam Cyrus

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message