You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Néstor Boscán <ne...@gmail.com> on 2010/01/15 21:25:46 UTC

Is there a way to create or get a ValueStack outside of Struts 2?

Hi

I wish to access or create the ValueStack from outside Struts 2 so I can
apply the expression language and conversion properties of OGNL to create
some reportes. Is this possible?

Regards,

Néstor Boscán

Re: Is there a way to create or get a ValueStack outside of Struts 2?

Posted by Néstor Boscán <ne...@gmail.com>.
Great tip Wes!

Found the solution:

        ConfigurationManager configurationManager = new
ConfigurationManager();
        OgnlValueStackFactory factory = new OgnlValueStackFactory();
        configurationManager.addContainerProvider(new
XWorkConfigurationProvider());

 configurationManager.getConfiguration().getContainer().inject(factory);
        ValueStack stack = factory.createValueStack();

Regards,

Néstor Boscán

On Fri, Jan 15, 2010 at 4:39 PM, Wes Wannemacher <we...@wantii.com> wrote:

> One thing I've done in the past to figure things out is to just check
> the unit tests. I'd imagine there are some tests for the
> ValueStackFactory somewhere and they might give you some clues on how
> to bootstrap an instance.
>
> -Wes
>
> 2010/1/15 Néstor Boscán <ne...@gmail.com>:
> > Thanks for the Reply
> >
> > I know that ValueStack is part of XWork. I checked the code there is an
> > OgnlValueStack and a OgnlValueStackFactory. But when I try to use
> > OgnlValueStackFactory I get:
> >
> > java.lang.IllegalArgumentException: Wrapped type converter cannot be null
> >
> > So I try to set the XWorkTypeConverter but I don't know how to instante
> it.
> >
> > Regards,
> >
> > Néstor Boscán
> >
> > 2010/1/15 Rafał Krupiński <r....@gmail.com>
> >
> >> On 15.01.2010 21:25, Néstor Boscán wrote:
> >>
> >>> Hi
> >>>
> >>> I wish to access or create the ValueStack from outside Struts 2 so I
> can
> >>> apply the expression language and conversion properties of OGNL to
> create
> >>> some reportes. Is this possible?
> >>>
> >>
> >> ValueStack is part of XWork, so it's possible.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>
>
>
> --
> Wes Wannemacher
>
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Is there a way to create or get a ValueStack outside of Struts 2?

Posted by Wes Wannemacher <we...@wantii.com>.
One thing I've done in the past to figure things out is to just check
the unit tests. I'd imagine there are some tests for the
ValueStackFactory somewhere and they might give you some clues on how
to bootstrap an instance.

-Wes

2010/1/15 Néstor Boscán <ne...@gmail.com>:
> Thanks for the Reply
>
> I know that ValueStack is part of XWork. I checked the code there is an
> OgnlValueStack and a OgnlValueStackFactory. But when I try to use
> OgnlValueStackFactory I get:
>
> java.lang.IllegalArgumentException: Wrapped type converter cannot be null
>
> So I try to set the XWorkTypeConverter but I don't know how to instante it.
>
> Regards,
>
> Néstor Boscán
>
> 2010/1/15 Rafał Krupiński <r....@gmail.com>
>
>> On 15.01.2010 21:25, Néstor Boscán wrote:
>>
>>> Hi
>>>
>>> I wish to access or create the ValueStack from outside Struts 2 so I can
>>> apply the expression language and conversion properties of OGNL to create
>>> some reportes. Is this possible?
>>>
>>
>> ValueStack is part of XWork, so it's possible.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: Is there a way to create or get a ValueStack outside of Struts 2?

Posted by Néstor Boscán <ne...@gmail.com>.
Thanks for the Reply

I know that ValueStack is part of XWork. I checked the code there is an
OgnlValueStack and a OgnlValueStackFactory. But when I try to use
OgnlValueStackFactory I get:

java.lang.IllegalArgumentException: Wrapped type converter cannot be null

So I try to set the XWorkTypeConverter but I don't know how to instante it.

Regards,

Néstor Boscán

2010/1/15 Rafał Krupiński <r....@gmail.com>

> On 15.01.2010 21:25, Néstor Boscán wrote:
>
>> Hi
>>
>> I wish to access or create the ValueStack from outside Struts 2 so I can
>> apply the expression language and conversion properties of OGNL to create
>> some reportes. Is this possible?
>>
>
> ValueStack is part of XWork, so it's possible.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Is there a way to create or get a ValueStack outside of Struts 2?

Posted by Rafał Krupiński <r....@gmail.com>.
On 15.01.2010 21:25, Néstor Boscán wrote:
> Hi
>
> I wish to access or create the ValueStack from outside Struts 2 so I can
> apply the expression language and conversion properties of OGNL to create
> some reportes. Is this possible?

ValueStack is part of XWork, so it's possible.

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


Re: Struts2 Tiles: specify the part of template that is to be rendered [SOLVED]

Posted by "Stephan R. Mueller" <st...@stud.leuphana.de>.
Am 17.01.2010 um 09:08 schrieb Antonio Petrelli:

> 2010/1/17 Stephan R. Mueller <st...@stud.leuphana.de>:
>> Hi list.
>> 
>> I'm playing with tiles and currently, I'm only able
>> insert the full code of a template. Is there a way
>> to define what part of a template is about to be
>> inserted? like:
>> <html>
>>  <title>template</title>
>>  <body>
>>  random stuff
>>   <insert_the_following>
>>    only this section will be inserted
>>   </insert_the_following>
>>  other random stuff
>>  </body>
>> </html>
>> 
>> I'm missing this, since I've played with wicket before
>> and now I'm wondering, if tiles2 allows this too.
> 
> Short answer: no.
> For the long answer please ask the Tiles Users mailing list:
> http://tiles.apache.org/mail.html
> 
> Antonio

Thank you. Will head for the tiles-list.

Stephan

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


Re: Struts2 Tiles: specify the part of template that is to be rendered

Posted by Antonio Petrelli <an...@gmail.com>.
2010/1/17 Stephan R. Mueller <st...@stud.leuphana.de>:
> Hi list.
>
> I'm playing with tiles and currently, I'm only able
> insert the full code of a template. Is there a way
> to define what part of a template is about to be
> inserted? like:
> <html>
>  <title>template</title>
>  <body>
>  random stuff
>   <insert_the_following>
>    only this section will be inserted
>   </insert_the_following>
>  other random stuff
>  </body>
> </html>
>
> I'm missing this, since I've played with wicket before
> and now I'm wondering, if tiles2 allows this too.

Short answer: no.
For the long answer please ask the Tiles Users mailing list:
http://tiles.apache.org/mail.html

Antonio

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


Struts2 Tiles: specify the part of template that is to be rendered

Posted by "Stephan R. Mueller" <st...@stud.leuphana.de>.
Hi list.

I'm playing with tiles and currently, I'm only able
insert the full code of a template. Is there a way
to define what part of a template is about to be
inserted? like:
<html>
 <title>template</title>
 <body>
  random stuff
   <insert_the_following>
    only this section will be inserted
   </insert_the_following>
  other random stuff
 </body>
</html>

I'm missing this, since I've played with wicket before
and now I'm wondering, if tiles2 allows this too.

I'm using tiles-2.0.6.

Regards,
Stephan

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