Aye, but whoops, I forgot this one :)

import com.opensymphony.xwork2.util.ValueStack;

Cheers,
Bill

On Mon, Feb 1, 2010 at 2:18 PM, Jake Vang <vangj...@googlemail.com> wrote:

> bill, thanks for including the code (especially the import statements
> so i will know where these objects/classes are coming from).
>
> On Mon, Feb 1, 2010 at 11:09 AM, Bill Bohnenberger <bill98...@gmail.com>
> wrote:
> > Hi Jake,
> >
> > I have a custom table tag that needs Value Stack access, too.
> > Here's how I do it:
> >
> > package...
> >
> > import org.apache.struts2.views.jsp.TagUtils;
> > import org.apache.struts2.util.MakeIterator;
> >
> > public class TableTag extends SimpleTagSupport
> > {
> >    private String list;
> >
> >    public void doTag() throws JspException
> >    {
> >        ValueStack stack =
> TagUtils.getStack((PageContext)getJspContext());
> >        Iterator iterator = MakeIterator.convert(stack.findValue(list));
> >            while (iterator.hasNext())
> >            {
> >                ...
> >            }
> >    }
> >
> >    public void setList(String list)
> >    {
> >        this.list = list;
> >    }
> > }
> >
> > Of course "list" is one of my custom tag's attributes and appropriately
> > defined in my TLD.
> >
> > Cheers,
> > Bill
> >
> >
> > On Mon, Feb 1, 2010 at 5:04 AM, Jake Vang <vangj...@googlemail.com>
> wrote:
> >
> >> i found something helpful here. it works.
> >>
> >>
> http://struts.apache.org/2.1.8.1/docs/access-to-valuestack-from-jsps.html
> >>
> >>
> >>
> >> On Mon, Feb 1, 2010 at 7:34 AM, Jake Vang <vangj...@googlemail.com>
> wrote:
> >> > i was wondering if it was possible to write a custom tag that is able
> >> > to access objects in the ActionContext using OGNL? i'm not sure if
> >> > this is a "correct" question.
> >> >
> >> > my problem is that i have a form. the form is posted to an action. the
> >> > action has getters/setters for the form fields. i then forward to
> >> > form-success.jsp. on this page, i can use the struts taglibs to access
> >> > the information posted. for example, <s:property value="email"/>.
> >> > however, if i have a custom tag, how do i access "email" from the
> >> > ActionContext? for example, <customTabLib:showEmail value="email"/>,
> >> > doesn't work. the tag displays the value, "email". i also tried a
> >> > couple of things too that didn't work.
> >> >
> >> > <customTagLib:showEmail value="#email"/>
> >> > <customTagLib:showEmail value="%{#email}"/>
> >> >
> >> > is there a class/interface that i can extend/implement in struts 2
> >> > that would easily help me get the value of email from the
> >> > ActionContext in my custom tag?
> >> >
> >> > thanks.
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to