Re: Action with session and jsp without session doesn't work

2008-02-23 Thread doktora v
Of course. But the problem is not one of accessing the session. The jsp DOES
NOT access the session and does not need to.
If it did try to access the session there would be an exception thrown.

Therefore, i guess struts puts the form beans in the session if
request="session" and in the page context otherwise.

And I guess that answers the question.

On Sat, Feb 23, 2008 at 4:33 PM, Dave Newton <[EMAIL PROTECTED]> wrote:

> --- doktora v <[EMAIL PROTECTED]> wrote:
> > [...] my jsp contains a <%@ page session="false" %> directive,
> > [...]
> > This took me a while to debug so I'm posting in case anyone has any
> > information about this behaviour. Is this documented anywhere?
>
> If you set session="false" then you can't access the session in the JSP.
> See
> any of the JSP "page" directive docs. I guess my gut reaction would be if
> I
> set the session to false then I shouldn't be surprised when I can't access
> it.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Action with session and jsp without session doesn't work

2008-02-23 Thread doktora v
I've just discovered that if in struts-config.xml my action specifies
request="session" (or does not specify a request in which case the default
is session), and my jsp contains a <%@ page session="false" %> directive,
the JSP does not see any of the form beans.
There is no warning and no messages, it's just as if the bean was never set
in the form.

This took me a while to debug so I'm posting in case anyone has any
information about this behaviour. Is this documented anywhere?

Here is the example. If the  definition contains scope="request" the
expected behaviour is observed. If scope="session" then the testbean is not
accessible by the jsp.

-
from struts-config.xml:

   
   
   
...
   
   

-
The test action (abbreviated):

 public ActionForward execute(ActionMapping mapping, ActionForm theForm,
 HttpServletRequest request, HttpServletResponse response)
 throws Exception {

   DynaActionForm form = (DynaActionForm)theForm;
   form.set("testbean", "hello");

   return mapping.getInputForward();
 }

--
the jsp (in tiles.xml the test.layout tile (I'm using Tiles) is mapped to
test.jsp

...
<%@ page session="false"%>


 



Bean not set


---


Any comments, thoughts?
dok


Zero-config and annotations

2007-03-28 Thread doktora

Zero-config will be quite some fun if we had some more annotations.

Are there any plans on adding Interceptor and onther annotations?

All we have now is org.apache.struts2.config.Result.

-- doktora
-- 
View this message in context: 
http://www.nabble.com/Zero-config-and-annotations-tf3481752.html#a9718432
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 and Struts1 comingling w/ Tiles

2007-03-28 Thread doktora

Ray,

Which definition files specifically do you need to be split?

One of the biggest problems I had (which I couldn't figure out) was mixing
jsps with T1 and T2. At compile time, all my JSPs wanted to be either
T1-compliant, or T2-compliant.

Even if I had figured this out, there is still a big problem because you
can't migrate some actions to S2 without duplicating jsps to be in T2 mode
because S1 actoins and S2 actions may be using those jsps simultaneously.
Which means a messy migration with a lot of (jsp) code replication.

I still stand firm -- until there is S1->T2 compatibility, migrating from
S1->S2 will be a nightmare, if Tiles are involved.

I also suspect that calling S2 actions from S1 would have to be hard-wired
with  , as opposed to using html:link. Is that so?

doktora


Ray Clough wrote:
> 
> It definitely IS possible to comingle a S1 app using Tiles1 and an S2 
> app using Tiles2 in the same WAR file.  But they have separate 
> definition files.  You can call a S1 action from an S2 page and vice 
> versa.  I know it is possible, because I'm doing it.  I believe that it 
> is NOT possible to use S1 with T2 or S2 with T1 - at least not out of 
> the box.
> 
> Ray Clough
> 
> 
> 
> Greg Reddin wrote:
>> On 3/27/07, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
>>>
>>> Your saying that any S1 app using Tiles can't, based on your experience,
>>> be run with part of it being S2-based, in the same WAR?  Could you
>>> describe more what the problems you encountered were?
>>
>>
>> If I had to guess I would say that the problems are mostly due to the 
>> fact
>> that Struts 2 does not have support for Tiles 1.  So you'll have to 
>> migrate
>> to Tiles 2 at the same time.  I can't imagine there being huge
>> incompatibilities between Tiles 1 and 2 that would keep them from running
>> together in the same app, but it's certainly possible.  The biggest 
>> struggle
>> would likely be the taglib API differences between Tiles 1 and 2.
>>
>> Greg
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts2-and-Struts1-comingling-w--Tiles-tf3474341.html#a9718430
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts.xml - change default location

2007-03-28 Thread doktora

I think the fact that you cannot change the location of struts.xml should be
put in here:

http://struts.apache.org/2.x/docs/struts-1-solutions.html

This will help out a lot of people who do not expect s2 to have this
different behaviour. I failed to find this documented anywhere which cost me
quite a bit of time and frustration with s2 because I couldn't even
jumpstart it.



Ted Husted-4 wrote:
> 
> Struts 2 uses a different approach to loading the configuration. The
> initial struts.xml is loaded from the root of the classpath. The
> easiest way to set that up is to put the struts.xml under the classes
> folder. The "boostrap" struts.xml can then load whatever other
> struts.xml's you would like using the include element.
> 
> HTH, Ted
>  <http://www.husted.com/ted/blog/>
> 
> 
> On 3/27/07, doktora <[EMAIL PROTECTED]> wrote:
>>
>> Why is it that putting this in the FilterDispatcher  section in
>> web.xml breaks Sturts2:
>>
>> 
>>   config
>>   /WEB-INF/struts.xml
>> 
>>
>> It looks to me as if this makes S2 confused about the whereabouts of its
>> other struts-default.xml, etc. files.
>>
>>
>> doktora
>>
>>
>> Ted Husted-4 wrote:
>> >
>> > Put a stub struts.xml on the classpath that loads your working
>> > configuration from another location. If the stub is under classes and
>> > the one you want is under WEB-INF, try
>> >
>> > 
>> > 
>> > 
>> >
>> > -HTH, Ted
>> >  <http://www.husted.com/ted/blog/>
>> >
>> > On 3/19/07, Bartek <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Hi
>> >>
>> >> I have to face up the following issue. My location of struts.xml
>> shoudl
>> >> be
>> >> WEB-INF directory, not WEB-INF/classes.
>> >> What is the easiest way to achieve this?? I tried several different
>> >> config
>> >> locations (e.g. WEB-INF/struts.xml) for
>> StrutsXmlConfigurationProvider,
>> >> none
>> >> of them worked. Creating custom configuration provider might help, but
>> it
>> >> is
>> >> pojo by default , protocol independant and therefore without any
>> >> ServletContext access - what is a pain in this case.
>> >>
>> >> Cheers
>> >> bartek
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/struts.xml---change-default-location-tf3425865.html#a9718423
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts.xml - change default location

2007-03-27 Thread doktora

Why is it that putting this in the FilterDispatcher  section in
web.xml breaks Sturts2:


  config
  /WEB-INF/struts.xml


It looks to me as if this makes S2 confused about the whereabouts of its
other struts-default.xml, etc. files.


doktora


Ted Husted-4 wrote:
> 
> Put a stub struts.xml on the classpath that loads your working
> configuration from another location. If the stub is under classes and
> the one you want is under WEB-INF, try
> 
> 
> 
> 
> 
> -HTH, Ted
>  <http://www.husted.com/ted/blog/>
> 
> On 3/19/07, Bartek <[EMAIL PROTECTED]> wrote:
>>
>> Hi
>>
>> I have to face up the following issue. My location of struts.xml shoudl
>> be
>> WEB-INF directory, not WEB-INF/classes.
>> What is the easiest way to achieve this?? I tried several different
>> config
>> locations (e.g. WEB-INF/struts.xml) for StrutsXmlConfigurationProvider,
>> none
>> of them worked. Creating custom configuration provider might help, but it
>> is
>> pojo by default , protocol independant and therefore without any
>> ServletContext access - what is a pain in this case.
>>
>> Cheers
>> bartek
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/struts.xml---change-default-location-tf3425865.html#a9696987
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts2 and Struts1 comingling w/ Tiles

2007-03-27 Thread doktora

I just wanted to inform anyone out there that may be thinking of migrating to
Struts2 in a gradual way -- by having both S1 and S2 in the same war -- do
not try this at home, if you are using Tiles.

It is a futile excercise which cost me 24 man-hours.

The best approach would be to do a complete port of your app to S2 and T2!
-- 
View this message in context: 
http://www.nabble.com/Struts2-and-Struts1-comingling-w--Tiles-tf3474341.html#a9696650
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]