Hey all,

Using WW 1.4 Bean JSP Tag.

I have a class:
public abstract class LedgerEntry extends Persistent
{
    private Date date = new Date();
    private Currency amount = Currency.ZERO;

    public Date getDate()  { return date; }
    public void setDate(Date d) { date = d; }

    public Currency getAmount()   { return amount; }
    public void setAmount(Currency c) { amount = c; }

    public class RunningTotal
    {
        private Currency total = new Currency();

        public RunningTotal()  {}
        public void add(Currency c) { total = total.add(c); }
        public Currency getTotal() { return total; }
    }
}

In one of my JSPs I try to instantiate the RunningTotal class. Below is a
listing of things I have tried

<ww:bean name="'xxx.domain.LedgerEntry.RunningTotal'" id="total"/>
<ww:bean name="xxx.domain.LedgerEntry.RunningTotal" id="total"/>
<ww:bean name="'xxx.domain.LedgerEntry$RunningTotal'" id="total"/>
<ww:bean name="xxx.domain.LedgerEntry$RunningTotal" id="total"/>

None of these work, and they all basically result in the following stack
trace:
java.lang.NullPointerException
        at
weblogic.utils.UnsyncHashtable.put(Ljava.lang.Object;Ljava.lang.Object;)Ljav
a.lang.Object;(UnsyncHashtable.java:277)
        at
weblogic.servlet.jsp.PageContextImpl.setAttribute(Ljava.lang.String;Ljava.la
ng.Object;)V(PageContextImpl.java:164)
        at webwork.view.taglib.BeanTag.doStartTag()I(BeanTag.java:79)

Is there another trick? Am I doing something that is completley unallowed?

In the same JSP I tried the following with success,
<%
   Object o =
Beans.instantiate(Thread.currentThread().getContextClassLoader(),
           "raider.domain.LedgerEntry$RunningTotal");
%>

Thanks,
Frank




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to