You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eddie Lau TO <ta...@yahoo.com.hk> on 2008/06/11 12:55:33 UTC

How to debug Struts2 tag runtime problems ?

For example, 
using &lt;s:select list="" ...

if the value supplied into list attribute is wrong,
the translated page start from the position of &lt;s:select&gt; tag will be blank.

How to get more information of tag-related problem for troubleshooting ?

Thanks in advance!



Regards,
Eddie Lau



      Yahoo! Mail具備一流的網上安全保護功能,請前往 http://hk.antispam.yahoo.com/ 了解更多相關資訊!

Re: How to debug Struts2 tag runtime problems ?

Posted by Ralf Fischer <th...@googlemail.com>.
Hi,

On Wed, Jun 11, 2008 at 12:55 PM, Eddie Lau TO <ta...@yahoo.com.hk> wrote:
> For example,
> using <s:select list="" ...
>
> if the value supplied into list attribute is wrong,
> the translated page start from the position of <s:select> tag will be blank.
>
> How to get more information of tag-related problem for troubleshooting ?

Is the box "really" empty or did just the listKey/listValue
expressions on each item of the list fail?

When the select box is "really" empty and you (want) fill it with a
value from either your action or your model, most likely the OGNL
expression is wrong. Thus it would help to increase the log level of
OGNL, as it evaluates the expression handed as list and will then
report the error. IIRC this can be done by configuring some log4j
log4j appenders, but you'll have to look up the correct
categories/loggers which will do the trick.

If this gives no viable insights you always can get the
struts/xwork/ognl code involed, attatch it to your project and debug
the code directly in your container using the shared memory or remote
debugging interface of your JVM. Most likely it will suffice to break
in the struts component class which is invoked by the tag, then check
the list expression which was set into it and try to find the object
yourself by hand by inspecting the ValueStack object in the struts
component. The errorrous part of the expression should become obvious
then.

My 2 cents, hope they help.

Bye,
-Ralf

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