Hey,
so I tried to use the s:if test= tag in one of my jsps and couldnt
get neither working:
s:if test=!empty certificate.statusisTrue/s:if
s:if test=certificate.status == 1isTrue/s:if
s:if test=%{certificate.status == 1}isTrue/s:if
s:if test=%{#certificate.status == 1}isTrue/s:if
but
Hi Fabian,
Can you give as the code of the Action that is in the Value Stack?
Antonios
On 27 June 2013 09:16, Fabian Richter frich...@mtg.de wrote:
Hey,
so I tried to use the s:if test= tag in one of my jsps and couldnt get
neither working:
s:if test=!empty
Hi Antonios,
you mean the java source Code or something I can extract from the jsp?
The source code is confidential.
I checked the get/set methods and getId on certificate returns a Long if
thats what you wanted to know...
Best
Fabian
Am 27.06.2013 10:24, schrieb Antonios Gkogkakis:
Hi
Stupid me, getStatus was what I was reading and that one returns an int.
Am 27.06.2013 10:33, schrieb Fabian Richter:
Hi Antonios,
you mean the java source Code or something I can extract from the jsp?
The source code is confidential.
I checked the get/set methods and getId on certificate
Long would be fine as well,
I tested option 2 and 3 and it works, the important thing is to have
gettersfor certificate and status. and an object that has a
certificate field in
your value stack,
Your last option is probably not valid unless you have used s:set to push a
bean in the value stack
All objects have getters/setters set, this is the except of the jsp code
with the problem (trying to write a text that depends on the value of
certificate.status into a table cell):
td class=cell valign=top
s:if test=%{certificate.status==1}
fmt:message key=certificate.status.valid /
/s:if
I would temporarily remove ${certificate.status} from the else and I would
check if the getStatus is called for the conditionals
Antonios
On 27 June 2013 09:56, Fabian Richter frich...@mtg.de wrote:
All objects have getters/setters set, this is the except of the jsp code
with the problem
Am 27.06.2013 11:20, schrieb Antonios Gkogkakis:
I would temporarily remove ${certificate.status} from the else and I would
check if the getStatus is called for the conditionals
Yes, it is called.
I was hoping it wasn't :( What now?
smime.p7s
Description: S/MIME Kryptografische
if it's called then there is something wrong with the comparison, are you
sure that you don't have a String getStatus somewhere?
What I would do is instead of checking the == 1 in the jsp create a method
on the certificate boolean isValid() { return status==1} and so on.
I know it doesn't answer
I have an update: I enabled the ${certificate.status} in the else branch
again and checked the tomcat logs:
getStatus called: 0
getStatus called: 0
getStatus called: 0
getStatus called: 0
getStatus called: 1
That would mean that for each if/elseif he doesnt actually call
getStatus on the
I assume you are on Struts2.
I'm not familiar with the ${} expression, but you are right, there is an
OGNL null handler that will instantiate objects for you if they are null,
so the behaviour we see makes sense, which means that you don't have a
certificate in the value stack.
How do you access
Am 27.06.2013 12:43, schrieb Antonios Gkogkakis:
I assume you are on Struts2.
Yes, I am, more precisely I am migrating an application from Webwork to
Struts2.
I'm not familiar with the ${} expression, but you are right, there is an
OGNL null handler that will instantiate objects for you if
But how would the framework know with what to populate it?
You either do it manually in the body of the action that you execute to
reach the view ,e.g.,
certificate = //logic to get the certificate
or you can implement the ModelDriven interface which has a method (prepare
I think) that gets
Am 27.06.2013 12:59, schrieb Antonios Gkogkakis:
But how would the framework know with what to populate it?
You either do it manually in the body of the action that you execute to
reach the view ,e.g.,
certificate = //logic to get the certificate
or you can implement the ModelDriven interface
Date: Thu, 27 Jun 2013 13:21:35 +0200
From: frich...@mtg.de
To: user@struts.apache.org
Subject: Re: if/elseif tag syntax
Am 27.06.2013 12:59, schrieb Antonios Gkogkakis:
But how would the framework know with what to populate it?
You either do it manually in the body of the action
15 matches
Mail list logo