Re: How to setup includes/excludes in Chaining Interceptor

2015-01-16 Thread Tenchi Masaki
Hi Lukasz,

Thank you very much for your attention, it's really nice to have detailed
examples in the docs.
But unfortunately it's still not working for me. I've followed the example
exactly as the docs, but all the properties from SomeAction are being
copied. In the /result.jsp page I have this:









The "SomeAction" class has prop1 to prop5.
The "OtherAction" class has prop6 and prop7.

And I have the test.jsp with this:










So my testing example is very simple: test.jsp calls someAction and
populates prop1 to 5. Then it's chained into otherAction which populates
prop6 and prop7 and finally we get the result into result.jsp.

Whenever I chain someAction to otherAction, I can see all the values from
prop1 to prop7 in the result.jsp page, even though I'm setting the
chain.includes to be only prop1.
In the other hand, whenever I redirectAction someAction to otherAction, I
can only see the values from prop6 and prop7 in the result page, just as
one expects (because whenever you redirect actions, the context from one
action is not copied to the other, right?).

Lukasz, please, do you have a Struts 2 project with a working example of
the chaining includes/excludes? If anyone is interested, I think I can
share my failing test project somewhere too.

Regards,
Masaki





On Wed, Jan 14, 2015 at 8:28 AM, Lukasz Lenart 
wrote:

> Here is the proper configuration, see my comments below
>
> 
> 
> 
> chain2
> 
> 
> 
> 
> username
> 
>     /WEB-INF/jsp/example/HelloWorld.jsp
> 
>
> 2015-01-13 3:39 GMT+01:00 Tenchi Masaki :
> > Yes, at first I thought that I was supposed to pass the "includes" param
> > into the "chain" result like this:
> >
> > 
> >
> > 
> > otherAction
> > prop1
> > 
> > 
>
> ChainResult doesn't contain "includes" - it must be defined on
> ChainInterceptor
>
> > 
> > 
> > 
> > /result.jsp
> > 
>
> There is "chainStack" which you can use instead of "chain" & "basicStack"
>
> > But it doesn't work.
>
> Yes as you must define "includes" for the result action (it strange
> for me too and sorry for misleading you ... but it makes sense :) )
>
> > I've tried this too and no success (actually it doesn't make sense at
> all,
> > so it's good that it does not work.. lol):
> >
> > 
> > 
> > prop1
>
> "basicStack" doesn't include "chain" interceptor, it won't work
> either, instead you can do it like this
>
> 
> prop1
> 
>
> > 
> > 
> > otherAction
> > 
> > 
> > 
> > 
> > 
> > /result.jsp
> > 
> >
> > And last:
> >
> > 
> > 
> > prop1
> > 
> > 
> > 
> > otherAction
> > 
> > 
> > 
> > /result.jsp
> > 
>
> Almost there, but just move  to the second
> action
>
> And to close this issue I have updated the docs - thanks for support!
> https://cwiki.apache.org/confluence/display/WW/Chaining+Interceptor
>
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Header and Footer file include struts 2

2015-01-12 Thread Tenchi Masaki
This was already pointed out at stackoverflow, but you're pointing out your
action result to a jsp fragment:

/WEB-INF/views/header/header.jspf

It doesn't make much sense. You should point it to a jsp that has the
fragment included in it. For example:

/WEB-INF/views/success-result.jsp

where success-result.jsp is a jsp file which includes your header.jspf
file.


How does one include header and footers across all pages in struts 2
> without using tiles?


Well, to make it in a neat way, I'd highly recommend using tiles. It's
pretty simple and elegant. One alternative is to use a template engine like
Velocity and use its macros to create your templates.

On Sat, Jan 10, 2015 at 3:35 AM, Kiran Badi  wrote:

> I have jspf fragments rather than jsp file.
>
> I did try with jsp also but same issue.
>
> How does one include header and footers across all pages in struts 2
> without using tiles?
> On Jan 10, 2015 12:31 AM, "Yaragalla Muralidhar" <
> yaragallamur...@gmail.com>
> wrote:
>
> > you have written
> >
> >  /WEB-INF/views/header/header.jspf
> >
> >
> > i think it is not header.jspf it is header.jsp
> >
> >
> > *Thanks and Regards,*
> > Muralidhar Yaragalla.
> >
> > *http://yaragalla.blogspot.in/ *
> >
> > On Sat, Jan 10, 2015 at 10:42 AM, Kiran Badi  wrote:
> >
> > > I already have that in page but still getting error
> > >
> > > On Friday, January 9, 2015, Yaragalla Muralidhar <
> > > yaragallamur...@gmail.com>
> > > wrote:
> > >
> > > > if you are using struts tags add this to your jsp
> > > >
> > > > <%@ taglib prefix="s" uri="/struts-tags" %>
> > > >
> > > >
> > > >
> > > > *Thanks and Regards,*
> > > > Muralidhar Yaragalla.
> > > >
> > > > *http://yaragalla.blogspot.in/ *
> > > >
> > > > On Sat, Jan 10, 2015 at 9:49 AM, Kiran Badi  > > > > wrote:
> > > >
> > > > > Hi
> > > > >
> > > > > I need some help and I have to include header and footer file in
> > Index
> > > > > jsp...
> > > > >
> > > > > For some reason its not working and showing up source code in
> > browser.
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> http://stackoverflow.com/questions/27220192/struts-2-sinclude-tag-not-working-for-header-jspf-file?noredirect=1#comment42946997_27220192
> > > > >
> > > > > Appreciate if some one can take a look.
> > > > >
> > > > > - Kiran
> > > > >
> > > >
> > >
> >
>


Re: How to setup includes/excludes in Chaining Interceptor

2015-01-12 Thread Tenchi Masaki
Yes, at first I thought that I was supposed to pass the "includes" param
into the "chain" result like this:


   

otherAction
prop1





/result.jsp


But it doesn't work.

I've tried this too and no success (actually it doesn't make sense at all,
so it's good that it does not work.. lol):



prop1


otherAction





/result.jsp


And last:



prop1



otherAction



/result.jsp


All in vain. :(
They all copy all the parameters. I want to pass just a few parameters from
SomeAction into OtherAction.

On Thu, Jan 8, 2015 at 4:43 AM, Lukasz Lenart 
wrote:

> 2015-01-07 20:46 GMT+01:00 Tenchi Masaki :
> > Hi Lukasz,
> >
> > I've tried setting up a new project just to test the chained action and
> now
> > I'm a bit confused. It's exactly the same configuration on struts.xml:
> >
> > 
> > 
>
> Can you move the props config here? As you want pass only few props of
> someAction to the otherAction, right?
>
> > otherAction
> > 
> > 
> > 
> > prop1,prop2,prop3
>
> This param doesn't make sense here as you don't use "chain" result here
>
> > 
> > 
> > good_result.ftl
> > 
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: How to setup includes/excludes in Chaining Interceptor

2015-01-07 Thread Tenchi Masaki
Hi Lukasz,

I've tried setting up a new project just to test the chained action and now
I'm a bit confused. It's exactly the same configuration on struts.xml:



otherAction



prop1,prop2,prop3


good_result.ftl


but now I noticed that all the parameters from "SomeAction" are being
copied. I was expecting that only prop1, prop2 and prop3 would be available
for the "OtherAction".
I've tried setting only one prop and also using the expression
${'prop1','prop2','prop3'}.
It's all the same, all properties from SomeAction become available to the
OtherAction.
Is it supposed to be like this? Or am I doing something wrong?

Regards,
Masaki






On Wed, Jan 7, 2015 at 5:56 AM, Lukasz Lenart 
wrote:

> 2015-01-06 3:47 GMT+01:00 Tenchi Masaki :
> > Hi,
> >
> > I'm trying to configure a list of parameters to be passed into a chained
> > action, but I can't make it work. I've tried the following configuration
> in
> > my struts.xml:
> >
> > 
> > 
> > otherAction
> > 
> > 
> > 
> > prop1,prop2,prop3
>
> Can you try with just one prop here? or use expression like this:
> ${'prop1','prop2','prop3'} ?
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


How to setup includes/excludes in Chaining Interceptor

2015-01-05 Thread Tenchi Masaki
Hi,

I'm trying to configure a list of parameters to be passed into a chained
action, but I can't make it work. I've tried the following configuration in
my struts.xml:



otherAction



prop1,prop2,prop3


good_result.ftl


so I was expecting that prop1, prop2, prop3 would be copied into
"otherAction", but none of the "someAction" properties are being copied.
I've tried the other way around setting the excludes instead, but didn't
work either.
What's the correct syntax to setup the includes/excludes params for the
Chaining interceptor? Thanks in advance!

Masaki