Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-02 Thread Milan Milanovic

Well, actually no.

I work through my application 30 mins. with my session o.k., but when I came
to redirect action it dissapear. I will create test application with nearly
empty action class and jsp-s to try if redirect action
to another namespace really delete session, as it happes to me. I checked
this with log, variable is here, user click on redirect link, after showing
resulting jsp, there is no any variable in session. And what is interesting,
Acegi doesn't ask for login, so not whole session is deleted, only variables
I set in Struts action class.

--
Regards, Milan


stanlick wrote:
 
 Is it possible you have the server session-time-to-live set to a very
 small
 duration of time?  This might explain why the sessions are disappearing.
 
 
 On Fri, Aug 1, 2008 at 11:47 AM, Milan Milanovic
 [EMAIL PROTECTED]wrote:
 

 I know that they are passed through serlvet, I'm just wondering if struts
 makes some error there.

 Could you be positive that Struts 2.0.11.1 doesn't do anything with
 session,
 i.e., session remains
 intact and session is set for folowing action in case of redirect action
 ?

 --
 Regards, Milan



 Al Sutton wrote:
 
  Milan,
 
  Please read up on how sessions work. They are NOT passed via URLs
 unless
  you have cookies disabled, URL rewriting enabled on your appserver, and
  a very sick sense of what a normal configuration is.
 
  Al.
 
 
  Milan Milanovic wrote:
  Hi Dave,
 
  one short question, don't be angry ;-).
 
  The link which when clicked action class lost its session looks like
  this:
 
 
 http://localhost:8080/myproject/show.action?dojo.preventCache=1224214242324id=4
 
  Is it possible that session is not passed through this link ?
 
  --
  Regards, Milan
 
 
  newton.dave wrote:
 
  Seriously, refactor your code. 5K lines of code in 7 files
  could hide all manner of nasties.
 
  We have a 1M class where I'm at now. That's *1M* of source. 30k+
 lines,
  mostly if-elseif.
 
  It broke our cyclometric complexity meter, had to put in a bigger
 fuse.
  It
  makes Eclipse cry. It makes *me* cry. Kinda like this thread.
 
  Dave
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
 
 
  --
  --
  Al Sutton
 
  W: www.alsutton.com
  T: twitter.com/alsutton
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18778594.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18787879.html
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: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

O.K. Chris, thank!

But, do I need this invalidation ? What is its purpose ?

--
Thx, Milan



Chris Pratt wrote:
 
 Yes, that's exactly what that does.  It invalidates the session and
 removes
 all the data.
   (*Chris*)
 
 On Thu, Jul 31, 2008 at 3:27 PM, Milan Milanovic
 [EMAIL PROTECTED]wrote:
 

 Hi Dave,

 excuse me for disturbing this list or you personally, I asked for this in
 Spring forum (
 http://forum.springframework.org/showthread.php?p=194333#post194333
 http://forum.springframework.org/showthread.php?p=194333#post194333 ).
 I figured out what I do in those method with session which forces user to
 log in again, that I don't do in other methods, I do this:

 // Test if session is valid
 if (session instanceof org.apache.struts2.dispatcher.SessionMap) {
  try {
 ((org.apache.struts2.dispatcher.SessionMap)session ).invalidate();
   } catch (IllegalStateException e) {
logger.error(Session is not valid!, e);
return Action.ERROR;
}
 }

 Is this possible to erase session ?

 --
 Thx, Milan


 newton.dave wrote:
 
  I already told you I don't know and you continue to refuse to provide
 the
  information I've asked for. You also added new information about Acegi,
  which I responded to by saying that yes, if you're getting logged out
 it's
  unlikely you'd keep the same session, as that would somewhat defeat the
  purpose of any reasonable login/logout mechanism.
 
  I don't think I have anything further of value to offer you. I don't
 know
  of any issues with session variables; if you're having an Acegi issue
 then
  pursue the issue on a Spring forum.
 
  Dave
 
  Milan Milanovic wrote:
  Dear Dave,
  O.K. But when you look at this scenario:
  MyFirstActionClass - show first.jsp - user click on link -
  MyFirstActionClass.method where I set session variable
  (getSession().put(variable, new Boolean(true)); - show second.jsp
  (here I
  see my variable) - user click on some link -
  MySecondActionClass.method-third.jsp (here I don't see my variable).
  I should note that in MySecondActionClass.method I don't clear session
 or
  something similar, I just add remove some other variables and set some
  new.
  Why my session is obviously cleared when action from another namespace
 is
  called ?
  --
  Thx, Milan
  newton.dave wrote:
 
  I didn't say it wouldn't work. I, and the Sun documentation I quoted,
  said
  it was a known bad programming practice.
 
  Dave
 
  Milan Milanovic wrote:
  Hi Dave,
  no, I think that this is not an issue. I tried with Boolean.TRUE and
 it
  is
  the same, but I earlier used new Boolean(true) and that worked.
  --
  Milan
  newton.dave wrote:
 
  --- On Thu, 7/31/08, Milan Milanovic wrote:
  (getSession().put(variable, new Boolean(true));
 
  Use Boolean.TRUE rather than instantiating a new object.
 
  Note also that the Javadocs for Boolean state in big bold letters:
 
  Note: It is rarely appropriate to use this constructor. Unless a
 new
  instance is required, the static factory valueOf(boolean) is
 generally
  a
  better choice. It is likely to yield significantly better space and
  time
  performance.
 
  Dave
 
 
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  --
  View this message in context:
 
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756698.html
  Sent from the Struts - User mailing list archive at Nabble.com.
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
  --
  View this message in context:
 
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18758095.html
  Sent from the Struts - User mailing list archive at Nabble.com.
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18764848.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18771006.html
Sent from the Struts - User mailing list archive at Nabble.com

[OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Thu, 7/31/08, Milan Milanovic wrote:
 ((org.apache.struts2.dispatcher.SessionMap)session ).invalidate();
 [...]
 Is this possible to erase session ?

You're asking if session.invalidate() will erase the session? Really?

Here's the thought process I'd use to figure that out, step-by-step.

Step 1: Read the Javadoc.

That's all the steps, because the Javadocs say the following:

Invalidates this session then unbinds any objects bound to it.

So I'm guessing that yes, calling session.invalidate() could actually 
invalidate the session.

Dave


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

As you can see, I've read it, conclude it and write here, if I didn't I'll
still have a problem, isn't it ?!

I have asked in which cases this method should be used ?

--
Milan



newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic wrote:
 ((org.apache.struts2.dispatcher.SessionMap)session ).invalidate();
 [...]
 Is this possible to erase session ?
 
 You're asking if session.invalidate() will erase the session? Really?
 
 Here's the thought process I'd use to figure that out, step-by-step.
 
 Step 1: Read the Javadoc.
 
 That's all the steps, because the Javadocs say the following:
 
 Invalidates this session then unbinds any objects bound to it.
 
 So I'm guessing that yes, calling session.invalidate() could actually
 invalidate the session.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18774795.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



[OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Fri, 8/1/08, Milan Milanovic wrote:
 I have asked in which cases this method should be used?

It should be used when you want to invalidate the session and remove all 
objects in the session.

Dave


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

O.K. Thanks.

One more question, is it possible that my session variable is erased when I
redirect
to another action/namespace, like this:

action name=show class=mySecondAction
!-- Redirect to another namespace --
result type=redirect-action
  show
  /actions
  true
   ${id}
 /result
/action

?

--
Milan


newton.dave wrote:
 
 --- On Fri, 8/1/08, Milan Milanovic wrote:
 I have asked in which cases this method should be used?
 
 It should be used when you want to invalidate the session and remove all
 objects in the session.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18775883.html
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: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Fri, 8/1/08, Milan Milanovic wrote:
 One more question, is it possible that my session variable
 is erased when I redirect to another action/namespace, like this:
 
 action name=show
 class=mySecondAction
   !-- Redirect to another namespace --
   result type=redirect-action
 show
 /actions
 true
${id}
/result
 /action

As I've said, I know of no default S2 mechanism that would arbitrarily remove 
session variables. As I've also said, and as the documentation clearly states, 
and as you were told on the Spring forum, if you're calling 
session.invalidate() you'll lose all your session variables.

Dave


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

Yes, I understand. But I don't remove session variable or call invalidate
anymore, and when my variable is stored during the whole scenario and when I
click to this redirect I get lost of my variable.

--
Milan



newton.dave wrote:
 
 --- On Fri, 8/1/08, Milan Milanovic wrote:
 One more question, is it possible that my session variable
 is erased when I redirect to another action/namespace, like this:
 
 action name=show
 class=mySecondAction
  !-- Redirect to another namespace --
  result type=redirect-action
show
/actions
true
${id}
   /result
 /action
 
 As I've said, I know of no default S2 mechanism that would arbitrarily
 remove session variables. As I've also said, and as the documentation
 clearly states, and as you were told on the Spring forum, if you're
 calling session.invalidate() you'll lose all your session variables.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18776195.html
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: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
 Yes, I understand. But I don't remove session variable
 or call invalidate anymore, and when my variable is stored 
 during the whole scenario and when I click to this redirect 
 I get lost of my variable.

Then provide the artifacts I requested so people can look at it--how do you 
expect anybody to diagnose your problem if you don't provide what's necessary?

Dave


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton

Dave,

Repeat after me;

It's Friday. It's nearly the weekend. And if they don't give me what I 
want I'm going to take my toys away and stop playing :).


Al.

Dave Newton wrote:

--- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
  

Yes, I understand. But I don't remove session variable
or call invalidate anymore, and when my variable is stored 
during the whole scenario and when I click to this redirect 
I get lost of my variable.



Then provide the artifacts I requested so people can look at it--how do you 
expect anybody to diagnose your problem if you don't provide what's necessary?

Dave


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

  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

Al ?!

Dave, I cannot give you all that info, because of two things, first my
classes
and jsp-s are pretty complex, and not in english! So, I narrowed my scenario
to this, my variable is in session - when redirect action is clicked, there
is no
variable in session any more! It's seems like that redirect action doesn't
pass
or set session to another action class.

--
Regards, Milan



Al Sutton wrote:
 
 Dave,
 
 Repeat after me;
 
 It's Friday. It's nearly the weekend. And if they don't give me what I 
 want I'm going to take my toys away and stop playing :).
 
 Al.
 
 Dave Newton wrote:
 --- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
   
 Yes, I understand. But I don't remove session variable
 or call invalidate anymore, and when my variable is stored 
 during the whole scenario and when I click to this redirect 
 I get lost of my variable.
 

 Then provide the artifacts I requested so people can look at it--how do
 you expect anybody to diagnose your problem if you don't provide what's
 necessary?

 Dave


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

   
 
 
 -- 
 --
 Al Sutton
 
 W: www.alsutton.com
 T: twitter.com/alsutton
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18777031.html
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: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

I already gave you my action configuration:

action name=show class=mySecondAction 
!-- Redirect to another namespace -- 
result type=redirect-action 
  show
  /actions
  true
   ${id}
 /result 
/action 


and here it is how it is called from jsp:

s:url id=connectUrl action=show
s:param name=id value=id /
/s:url
s:a id=d_%{id} href=%{connectUrl}Show/s:a

--
Regards, Milan


Milan Milanovic wrote:
 
 Al ?!
 
 Dave, I cannot give you all that info, because of two things, first my
 classes
 and jsp-s are pretty complex, and not in english! So, I narrowed my
 scenario
 to this, my variable is in session - when redirect action is clicked,
 there is no
 variable in session any more! It's seems like that redirect action doesn't
 pass
 or set session to another action class.
 
 --
 Regards, Milan
 
 
 
 Al Sutton wrote:
 
 Dave,
 
 Repeat after me;
 
 It's Friday. It's nearly the weekend. And if they don't give me what I 
 want I'm going to take my toys away and stop playing :).
 
 Al.
 
 Dave Newton wrote:
 --- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
   
 Yes, I understand. But I don't remove session variable
 or call invalidate anymore, and when my variable is stored 
 during the whole scenario and when I click to this redirect 
 I get lost of my variable.
 

 Then provide the artifacts I requested so people can look at it--how do
 you expect anybody to diagnose your problem if you don't provide what's
 necessary?

 Dave


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

   
 
 
 -- 
 --
 Al Sutton
 
 W: www.alsutton.com
 T: twitter.com/alsutton
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18777073.html
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: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Piero Sartini
 It's seems like that redirect action doesn't
 pass
 or set session to another action class.

If you can't give us the code, we aren't able to help you.
Session's don't need to be passed between actions. They are managed by the 
servlet container. But it is pretty safe to assume that Struts2 is not 
destroying your session.

Piero

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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton

Just making sure hurricane Dave doesn't blow through the list.

If you ask for help, and someone offers, give them what they ask for. 
They can always ask for a translation of bits that may be critical, but 
unless you've rewritten large chunks of the JVM and Struts your tags and 
code will still be understandable.


Milan Milanovic wrote:

Al ?!

Dave, I cannot give you all that info, because of two things, first my
classes
and jsp-s are pretty complex, and not in english! So, I narrowed my scenario
to this, my variable is in session - when redirect action is clicked, there
is no
variable in session any more! It's seems like that redirect action doesn't
pass
or set session to another action class.

--
Regards, Milan



Al Sutton wrote:
  

Dave,

Repeat after me;

It's Friday. It's nearly the weekend. And if they don't give me what I 
want I'm going to take my toys away and stop playing :).


Al.

Dave Newton wrote:


--- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
  
  

Yes, I understand. But I don't remove session variable
or call invalidate anymore, and when my variable is stored 
during the whole scenario and when I click to this redirect 
I get lost of my variable.



Then provide the artifacts I requested so people can look at it--how do
you expect anybody to diagnose your problem if you don't provide what's
necessary?

Dave


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

  
  

--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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






  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

O.K. My 5 jsp which are used and two action classes have 5000+k lines of
code, should I send them here ?

--
Milan


Al Sutton wrote:
 
 Just making sure hurricane Dave doesn't blow through the list.
 
 If you ask for help, and someone offers, give them what they ask for. 
 They can always ask for a translation of bits that may be critical, but 
 unless you've rewritten large chunks of the JVM and Struts your tags and 
 code will still be understandable.
 
 Milan Milanovic wrote:
 Al ?!

 Dave, I cannot give you all that info, because of two things, first my
 classes
 and jsp-s are pretty complex, and not in english! So, I narrowed my
 scenario
 to this, my variable is in session - when redirect action is clicked,
 there
 is no
 variable in session any more! It's seems like that redirect action
 doesn't
 pass
 or set session to another action class.

 --
 Regards, Milan



 Al Sutton wrote:
   
 Dave,

 Repeat after me;

 It's Friday. It's nearly the weekend. And if they don't give me what I 
 want I'm going to take my toys away and stop playing :).

 Al.

 Dave Newton wrote:
 
 --- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
   
   
 Yes, I understand. But I don't remove session variable
 or call invalidate anymore, and when my variable is stored 
 during the whole scenario and when I click to this redirect 
 I get lost of my variable.
 
 
 Then provide the artifacts I requested so people can look at it--how do
 you expect anybody to diagnose your problem if you don't provide what's
 necessary?

 Dave


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

   
   
 -- 
 --
 Al Sutton

 W: www.alsutton.com
 T: twitter.com/alsutton


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



 

   
 
 
 -- 
 --
 Al Sutton
 
 W: www.alsutton.com
 T: twitter.com/alsutton
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18777372.html
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: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

Hi Piero,

O.K. Basically I'm just asking one simple question, is it possible that
redirect action delete session or variables in it or maybe not pass some,
because they after redirecting I don't have that variable in session ?

--
Regards, Milan


Piero Sartini-3 wrote:
 
 It's seems like that redirect action doesn't
 pass
 or set session to another action class.
 
 If you can't give us the code, we aren't able to help you.
 Session's don't need to be passed between actions. They are managed by the 
 servlet container. But it is pretty safe to assume that Struts2 is not 
 destroying your session.
 
   Piero
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18777402.html
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: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton

:O imho first stop would be someone who will refactor them.

5 jsps and 2 classes with 5K lines of code is not a healthy program.  
Once they have been refactored you may find it easier to find the problem.


Al.

Milan Milanovic wrote:

O.K. My 5 jsp which are used and two action classes have 5000+k lines of
code, should I send them here ?

--
Milan


Al Sutton wrote:
  

Just making sure hurricane Dave doesn't blow through the list.

If you ask for help, and someone offers, give them what they ask for. 
They can always ask for a translation of bits that may be critical, but 
unless you've rewritten large chunks of the JVM and Struts your tags and 
code will still be understandable.


Milan Milanovic wrote:


Al ?!

Dave, I cannot give you all that info, because of two things, first my
classes
and jsp-s are pretty complex, and not in english! So, I narrowed my
scenario
to this, my variable is in session - when redirect action is clicked,
there
is no
variable in session any more! It's seems like that redirect action
doesn't
pass
or set session to another action class.

--
Regards, Milan



Al Sutton wrote:
  
  

Dave,

Repeat after me;

It's Friday. It's nearly the weekend. And if they don't give me what I 
want I'm going to take my toys away and stop playing :).


Al.

Dave Newton wrote:



--- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
  
  
  

Yes, I understand. But I don't remove session variable
or call invalidate anymore, and when my variable is stored 
during the whole scenario and when I click to this redirect 
I get lost of my variable.




Then provide the artifacts I requested so people can look at it--how do
you expect anybody to diagnose your problem if you don't provide what's
necessary?

Dave


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

  
  
  

--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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





  
  

--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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






  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton

Answer : No

Only your code and your site design will affect the session variables 
you have set and whether they are accessible.


Milan Milanovic wrote:

Hi Piero,

O.K. Basically I'm just asking one simple question, is it possible that
redirect action delete session or variables in it or maybe not pass some,
because they after redirecting I don't have that variable in session ?

--
Regards, Milan


Piero Sartini-3 wrote:
  

It's seems like that redirect action doesn't
pass
or set session to another action class.
  

If you can't give us the code, we aren't able to help you.
Session's don't need to be passed between actions. They are managed by the 
servlet container. But it is pretty safe to assume that Struts2 is not 
destroying your session.


Piero

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






  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Nils-Helge Garli Hegvik
If your artifacts are that big, I suggest that you create a minimal
example that reproduces your error and then provide us with those as
examples. Otherwise, it's impossible to help. And who knows, maybe the
little example works, and then we can rule out Struts 2 in the
equation.

Nils-H

On Fri, Aug 1, 2008 at 5:45 PM, Milan Milanovic
[EMAIL PROTECTED] wrote:

 O.K. My 5 jsp which are used and two action classes have 5000+k lines of
 code, should I send them here ?

 --
 Milan


 Al Sutton wrote:

 Just making sure hurricane Dave doesn't blow through the list.

 If you ask for help, and someone offers, give them what they ask for.
 They can always ask for a translation of bits that may be critical, but
 unless you've rewritten large chunks of the JVM and Struts your tags and
 code will still be understandable.

 Milan Milanovic wrote:
 Al ?!

 Dave, I cannot give you all that info, because of two things, first my
 classes
 and jsp-s are pretty complex, and not in english! So, I narrowed my
 scenario
 to this, my variable is in session - when redirect action is clicked,
 there
 is no
 variable in session any more! It's seems like that redirect action
 doesn't
 pass
 or set session to another action class.

 --
 Regards, Milan



 Al Sutton wrote:

 Dave,

 Repeat after me;

 It's Friday. It's nearly the weekend. And if they don't give me what I
 want I'm going to take my toys away and stop playing :).

 Al.

 Dave Newton wrote:

 --- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:


 Yes, I understand. But I don't remove session variable
 or call invalidate anymore, and when my variable is stored
 during the whole scenario and when I click to this redirect
 I get lost of my variable.


 Then provide the artifacts I requested so people can look at it--how do
 you expect anybody to diagnose your problem if you don't provide what's
 necessary?

 Dave


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



 --
 --
 Al Sutton

 W: www.alsutton.com
 T: twitter.com/alsutton


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








 --
 --
 Al Sutton

 W: www.alsutton.com
 T: twitter.com/alsutton


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




 --
 View this message in context: 
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18777372.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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



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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

O.K. Thanks.

I must see why my session is deleted when redirect action is called :-(. I
checked everything 10 times, and I don't anything with session, so it is
very wierd to me why it is removed after just one click.

--
Regards, Milan


Al Sutton wrote:
 
 Answer : No
 
 Only your code and your site design will affect the session variables 
 you have set and whether they are accessible.
 
 Milan Milanovic wrote:
 Hi Piero,

 O.K. Basically I'm just asking one simple question, is it possible that
 redirect action delete session or variables in it or maybe not pass some,
 because they after redirecting I don't have that variable in session ?

 --
 Regards, Milan


 Piero Sartini-3 wrote:
   
 It's seems like that redirect action doesn't
 pass
 or set session to another action class.
   
 If you can't give us the code, we aren't able to help you.
 Session's don't need to be passed between actions. They are managed by
 the 
 servlet container. But it is pretty safe to assume that Struts2 is not 
 destroying your session.

 Piero

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



 

   
 
 
 -- 
 --
 Al Sutton
 
 W: www.alsutton.com
 T: twitter.com/alsutton
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18777689.html
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: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton
Seriously, refactor your code. 5K lines of code in 7 files could hide 
all manner of nasties.


Milan Milanovic wrote:

O.K. Thanks.

I must see why my session is deleted when redirect action is called :-(. I
checked everything 10 times, and I don't anything with session, so it is
very wierd to me why it is removed after just one click.

--
Regards, Milan


Al Sutton wrote:
  

Answer : No

Only your code and your site design will affect the session variables 
you have set and whether they are accessible.


Milan Milanovic wrote:


Hi Piero,

O.K. Basically I'm just asking one simple question, is it possible that
redirect action delete session or variables in it or maybe not pass some,
because they after redirecting I don't have that variable in session ?

--
Regards, Milan


Piero Sartini-3 wrote:
  
  

It's seems like that redirect action doesn't
pass
or set session to another action class.
  
  

If you can't give us the code, we aren't able to help you.
Session's don't need to be passed between actions. They are managed by
the 
servlet container. But it is pretty safe to assume that Struts2 is not 
destroying your session.


Piero

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





  
  

--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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






  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
 O.K. Basically I'm just asking one simple question, is
 it possible that redirect action delete session or variables 
 in it or maybe not pass some, because they after redirecting 
 I don't have that variable in session ?

NO.

There is no mechanism in S2 that arbitrarily removes session variables. The 
redirectAction result don't do anything to the session at all. In fact, very 
little does anything with the session at all.

Look at the S2 code. Since you're not going to help us help you, you're going 
to have to help yourself. All the code is available. Step through it if you 
have to. Read the documentation of any code you use that might involve the 
session; not knowing what session.invalidate() does leads me to believe you 
haven't spent much time with the Javadocs. Check your interceptor stack and 
interceptor configuration. If you don't want to step through code, add an 
interceptor that tracks session variables and see if an interceptor is removing 
it. Understand Acegi better; if it's making you log in then something is wrong 
and you may lose your session there.

RedirectAction is not the culprit, AFAICT, from the information you've provided.

Hurricane Dave


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton
Thhhaaa she blows!! (I use she in the shipping sense of the 
word... i.e. everythings a she when you're at sea for that long and it's 
all blokes).


Dave Newton wrote:

--- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
  

O.K. Basically I'm just asking one simple question, is
it possible that redirect action delete session or variables 
in it or maybe not pass some, because they after redirecting 
I don't have that variable in session ?



NO.

There is no mechanism in S2 that arbitrarily removes session variables. The 
redirectAction result don't do anything to the session at all. In fact, very 
little does anything with the session at all.

Look at the S2 code. Since you're not going to help us help you, you're going 
to have to help yourself. All the code is available. Step through it if you 
have to. Read the documentation of any code you use that might involve the 
session; not knowing what session.invalidate() does leads me to believe you 
haven't spent much time with the Javadocs. Check your interceptor stack and 
interceptor configuration. If you don't want to step through code, add an 
interceptor that tracks session variables and see if an interceptor is removing 
it. Understand Acegi better; if it's making you log in then something is wrong 
and you may lose your session there.

RedirectAction is not the culprit, AFAICT, from the information you've provided.

Hurricane Dave


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

  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Fri, 8/1/08, Al Sutton [EMAIL PROTECTED] wrote:
 Thhhaaa she blows!!

*lol*

Tropical Depression Dave


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



[Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
 Seriously, refactor your code. 5K lines of code in 7 files
 could hide all manner of nasties.

We have a 1M class where I'm at now. That's *1M* of source. 30k+ lines, mostly 
if-elseif.

It broke our cyclometric complexity meter, had to put in a bigger fuse. It 
makes Eclipse cry. It makes *me* cry. Kinda like this thread.

Dave


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



Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

Thanks huricane Dave ;-).

O.K. I'll check everything one more time. I'm using only default stack and
it worked until now good. And I fixed that invalidate problem, so I don't
invalidate nor clear session anywhere in my project.

--
Regards, Milan


newton.dave wrote:
 
 --- On Fri, 8/1/08, Milan Milanovic [EMAIL PROTECTED] wrote:
 O.K. Basically I'm just asking one simple question, is
 it possible that redirect action delete session or variables 
 in it or maybe not pass some, because they after redirecting 
 I don't have that variable in session ?
 
 NO.
 
 There is no mechanism in S2 that arbitrarily removes session variables.
 The redirectAction result don't do anything to the session at all. In
 fact, very little does anything with the session at all.
 
 Look at the S2 code. Since you're not going to help us help you, you're
 going to have to help yourself. All the code is available. Step through it
 if you have to. Read the documentation of any code you use that might
 involve the session; not knowing what session.invalidate() does leads me
 to believe you haven't spent much time with the Javadocs. Check your
 interceptor stack and interceptor configuration. If you don't want to step
 through code, add an interceptor that tracks session variables and see if
 an interceptor is removing it. Understand Acegi better; if it's making you
 log in then something is wrong and you may lose your session there.
 
 RedirectAction is not the culprit, AFAICT, from the information you've
 provided.
 
 Hurricane Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18777852.html
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: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton
Don't worry, I've just written a rant about not relying on dirty reads 
and had to re-word it to include the footnote This discussion is about 
the SQL  JDBC Drivers and is not about porn.


Dave Newton wrote:

--- On Fri, 8/1/08, Al Sutton [EMAIL PROTECTED] wrote:
  

Thhhaaa she blows!!



*lol*

Tropical Depression Dave


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

  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



[Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Fri, 8/1/08, Al Sutton [EMAIL PROTECTED] wrote:
 Don't worry, I've just written a rant about not relying on dirty 
 reads and had to re-word it to include the footnote This
 discussion is about the SQL  JDBC Drivers and is not about porn.

Well, they're both just as exciting.

Right?

Anyone?

*chirp*

Dave


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton
Captin... The cyclometric complexity meter is at max... I canne give it 
any more.


Reflection can seriously help with big else-ifs. If your switching on a 
variable use the variable name and value as part of the class name and 
then do;


Class blahHandlerClass = Class.forName( BlahHandlerFor+value );
BlahHandler blahHandler = blahHandlerClass.newInstance();
blahHandler.doYourWork();

It splits your code into more manageable chunks, allows you to add 
handlers for new values without touching the motherload, and it makes it 
look like you're a java ninja blending in with the workplace :).


Al.

Dave Newton wrote:

Seriously, refactor your code. 5K lines of code in 7 files
could hide all manner of nasties.



We have a 1M class where I'm at now. That's *1M* of source. 30k+ lines, mostly 
if-elseif.

It broke our cyclometric complexity meter, had to put in a bigger fuse. It 
makes Eclipse cry. It makes *me* cry. Kinda like this thread.

Dave


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

  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton
So you'd choose JDBC driver source code over porn and you called me 
wierd :).


Dave Newton wrote:

--- On Fri, 8/1/08, Al Sutton [EMAIL PROTECTED] wrote:
  
Don't worry, I've just written a rant about not relying on dirty 
reads and had to re-word it to include the footnote This

discussion is about the SQL  JDBC Drivers and is not about porn.



Well, they're both just as exciting.

Right?

Anyone?

*chirp*

Dave


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

  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

Hi Dave,

one short question, don't be angry ;-).

The link which when clicked action class lost its session looks like this:

http://localhost:8080/myproject/show.action?dojo.preventCache=1224214242324id=4

Is it possible that session is not passed through this link ?

--
Regards, Milan


newton.dave wrote:
 
 Seriously, refactor your code. 5K lines of code in 7 files
 could hide all manner of nasties.
 
 We have a 1M class where I'm at now. That's *1M* of source. 30k+ lines,
 mostly if-elseif.
 
 It broke our cyclometric complexity meter, had to put in a bigger fuse. It
 makes Eclipse cry. It makes *me* cry. Kinda like this thread.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18778274.html
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: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton

Milan,

Please read up on how sessions work. They are NOT passed via URLs unless 
you have cookies disabled, URL rewriting enabled on your appserver, and 
a very sick sense of what a normal configuration is.


Al.


Milan Milanovic wrote:

Hi Dave,

one short question, don't be angry ;-).

The link which when clicked action class lost its session looks like this:

http://localhost:8080/myproject/show.action?dojo.preventCache=1224214242324id=4

Is it possible that session is not passed through this link ?

--
Regards, Milan


newton.dave wrote:
  

Seriously, refactor your code. 5K lines of code in 7 files
could hide all manner of nasties.
  

We have a 1M class where I'm at now. That's *1M* of source. 30k+ lines,
mostly if-elseif.

It broke our cyclometric complexity meter, had to put in a bigger fuse. It
makes Eclipse cry. It makes *me* cry. Kinda like this thread.

Dave


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






  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Fri, 8/1/08, Al Sutton [EMAIL PROTECTED] wrote:
 It splits your code into more manageable chunks, [...]

You're right, it does split *my* code. Unfortunately (well... fortunately, 
really) that code isn't mine and I'm forbidden from even looking at it.

Dave


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Fri, 8/1/08, Al Sutton wrote:
 So you'd choose JDBC driver source code over porn

And it's not filtered at work! Win-win!

Dave


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton
A Medusa code.  So named because anyone who looks at it gets so 
petrified they turn to freeze up and turn to stone.


I once worked for a company where one of their classes was about 200K in 
size, the reason was the developer thought that in every you needed to 
catch every exception thrown, wrap it in something else, and re-throw it.


Laugh... I laughed so hard I almost peed in my pants when I saw it. (and 
yes, the company was dumb enough to pay  an expensive contractor to 
optimize the code. he corrected the exception handling, which reduced 
the code size and sped things up slighly, for which he got glowing 
praise by the management).


Al.

Dave Newton wrote:

--- On Fri, 8/1/08, Al Sutton [EMAIL PROTECTED] wrote:
  

It splits your code into more manageable chunks, [...]



You're right, it does split *my* code. Unfortunately (well... fortunately, 
really) that code isn't mine and I'm forbidden from even looking at it.

Dave


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

  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton
Tonight on the Struts 2 comedy channel; How your employer is ensuring 
you enjoy your day by only filtering out the boring websites to avoid 
you having to waste time checking them out :).


Dave Newton wrote:

--- On Fri, 8/1/08, Al Sutton wrote:
  

So you'd choose JDBC driver source code over porn



And it's not filtered at work! Win-win!

Dave


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

  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Milan Milanovic

I know that they are passed through serlvet, I'm just wondering if struts
makes some error there.

Could you be positive that Struts 2.0.11.1 doesn't do anything with session,
i.e., session remains
intact and session is set for folowing action in case of redirect action ?

--
Regards, Milan



Al Sutton wrote:
 
 Milan,
 
 Please read up on how sessions work. They are NOT passed via URLs unless 
 you have cookies disabled, URL rewriting enabled on your appserver, and 
 a very sick sense of what a normal configuration is.
 
 Al.
 
 
 Milan Milanovic wrote:
 Hi Dave,

 one short question, don't be angry ;-).

 The link which when clicked action class lost its session looks like
 this:

 http://localhost:8080/myproject/show.action?dojo.preventCache=1224214242324id=4

 Is it possible that session is not passed through this link ?

 --
 Regards, Milan


 newton.dave wrote:
   
 Seriously, refactor your code. 5K lines of code in 7 files
 could hide all manner of nasties.
   
 We have a 1M class where I'm at now. That's *1M* of source. 30k+ lines,
 mostly if-elseif.

 It broke our cyclometric complexity meter, had to put in a bigger fuse.
 It
 makes Eclipse cry. It makes *me* cry. Kinda like this thread.

 Dave


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



 

   
 
 
 -- 
 --
 Al Sutton
 
 W: www.alsutton.com
 T: twitter.com/alsutton
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18778594.html
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: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Dave Newton
--- On Fri, 8/1/08, Milan Milanovic wrote:
 Could you be positive that Struts 2.0.11.1 doesn't 
 do anything with session, i.e., session remains intact 
 and  session is set for folowing action in case of 
 redirect action?

Session handling is no different for a redirectAction than any other result 
(more or less).

The advice to write a test application that reproduces the error was good 
advice--without it it will even *more* difficult to help you.

Dave


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread Al Sutton

I refer you to the answer on sessions I gave you some emails ago.

You **REALLY** should read how session work. They are not passed through 
a servlet.


Al.

Milan Milanovic wrote:

I know that they are passed through serlvet, I'm just wondering if struts
makes some error there.

Could you be positive that Struts 2.0.11.1 doesn't do anything with session,
i.e., session remains
intact and session is set for folowing action in case of redirect action ?

--
Regards, Milan



Al Sutton wrote:
  

Milan,

Please read up on how sessions work. They are NOT passed via URLs unless 
you have cookies disabled, URL rewriting enabled on your appserver, and 
a very sick sense of what a normal configuration is.


Al.


Milan Milanovic wrote:


Hi Dave,

one short question, don't be angry ;-).

The link which when clicked action class lost its session looks like
this:

http://localhost:8080/myproject/show.action?dojo.preventCache=1224214242324id=4

Is it possible that session is not passed through this link ?

--
Regards, Milan


newton.dave wrote:
  
  

Seriously, refactor your code. 5K lines of code in 7 files
could hide all manner of nasties.
  
  

We have a 1M class where I'm at now. That's *1M* of source. 30k+ lines,
mostly if-elseif.

It broke our cyclometric complexity meter, had to put in a bigger fuse.
It
makes Eclipse cry. It makes *me* cry. Kinda like this thread.

Dave


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





  
  

--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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






  



--
--
Al Sutton

W: www.alsutton.com
T: twitter.com/alsutton


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



Re: [Friday] Re: [OT] RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-08-01 Thread stanlick
Is it possible you have the server session-time-to-live set to a very small
duration of time?  This might explain why the sessions are disappearing.


On Fri, Aug 1, 2008 at 11:47 AM, Milan Milanovic
[EMAIL PROTECTED]wrote:


 I know that they are passed through serlvet, I'm just wondering if struts
 makes some error there.

 Could you be positive that Struts 2.0.11.1 doesn't do anything with
 session,
 i.e., session remains
 intact and session is set for folowing action in case of redirect action ?

 --
 Regards, Milan



 Al Sutton wrote:
 
  Milan,
 
  Please read up on how sessions work. They are NOT passed via URLs unless
  you have cookies disabled, URL rewriting enabled on your appserver, and
  a very sick sense of what a normal configuration is.
 
  Al.
 
 
  Milan Milanovic wrote:
  Hi Dave,
 
  one short question, don't be angry ;-).
 
  The link which when clicked action class lost its session looks like
  this:
 
 
 http://localhost:8080/myproject/show.action?dojo.preventCache=1224214242324id=4
 
  Is it possible that session is not passed through this link ?
 
  --
  Regards, Milan
 
 
  newton.dave wrote:
 
  Seriously, refactor your code. 5K lines of code in 7 files
  could hide all manner of nasties.
 
  We have a 1M class where I'm at now. That's *1M* of source. 30k+ lines,
  mostly if-elseif.
 
  It broke our cyclometric complexity meter, had to put in a bigger fuse.
  It
  makes Eclipse cry. It makes *me* cry. Kinda like this thread.
 
  Dave
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
 
 
  --
  --
  Al Sutton
 
  W: www.alsutton.com
  T: twitter.com/alsutton
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18778594.html
 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: [S2] Testing if session variable is present

2008-07-31 Thread Milan Milanovic

No one have any idea how to access session variable in jsp in this kind of
simple scenario ?

--
Milan


Milan Milanovic wrote:
 
 So, scenario is like this:
 
 MyFirstAction.method1 [put session variable] - show first.jsp - user
 click on link in first.jsp page - show second.jsp - user click on link
 in second.jsp - MySecondAction.someMethod is called - show third.jsp
 where this session test should be done.
 
 I hope this helps.
 
 --
 Thx, Milan
 
 
 Milan Milanovic wrote:
 
 Hi,
 
 just to note, I treid with this too: s:if test=#session.your_variable
 != null and it doesn't work.
 I put my session variable in one action class, and then redirect to
 another page which is connected to another action class. When that second
 class method is runned, and resulting jsp is shown in that page I test
 this. My both classes implements sessionAware.
 
 --
 Milan
 
 
 
 Milan Milanovic wrote:
 
 Well, this : s:if test=%{#session.your_variable != null} doesn't
 work, event though my class implements sessionAware and I put my
 your_variable in session before displaying this jsp page.
 
 I should note that I put that variable in one action class and then that
 s:if test is runned in jsp for another action class, but both classes
 implements sessionAware.
 
 What can I do ?
 
 --
 Thx, Milan
 
 
 
 felipe.lorenz wrote:
 
 Hummm.. Struts 1 or 2?
 
 This code is to S2.
 
 s:if test=%{#session.your_variable != null}
 
 do something
 
 /s:if
 
 I didnt test it, so im not sure about the code.
 
 But try it, and tell us.
 
 Felipe Lorenz
 
 On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
 [EMAIL PROTECTED]wrote:
 

 Hi,

 I need to test in jsp if some session variable is present, and based
 on
 that
 to
 show some struts view code or not. How can I do that ?

 --
 Thx, Milan
 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18752896.html
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: [S2] Testing if session variable is present

2008-07-31 Thread Dave Newton
--- On Thu, 7/31/08, Milan Milanovic [EMAIL PROTECTED] wrote:
 No one have any idea how to access session variable in jsp
 in this kind of simple scenario ?

That's one explanation.

 So, scenario is like this:
 [...]

I am unable to duplicate the inability to test session variables for 
non-existence/null.

If I have an action implementing SessionAware (properly), set foo1 into 
session, and do not set foo2 into session, the following tests work:

  s:if test=#session.foo1 == null
  ...
  s:if test=#session.foo2 != null
  ...

They continue to work if I go through multiple actions using the exact same JSP 
to test for their presence/non-presence.

It is likely you are doing something wrong. I suppose that means you'll need to 
post the relevant SessionAware implementation, the code that sets the session 
variable(s), any action code in the application path that could modify session 
variables, the JSP that currently doesn't work, and any variants of the JSP 
code you've tried that also hasn't worked.

Dave


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



Re: [S2] Testing if session variable is present

2008-07-31 Thread Milan Milanovic

Hi Dave,


newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic [EMAIL PROTECTED] wrote:
 No one have any idea how to access session variable in jsp
 in this kind of simple scenario ?
 
 That's one explanation.
 
 So, scenario is like this:
 [...]
 
 I am unable to duplicate the inability to test session variables for
 non-existence/null.
 
 If I have an action implementing SessionAware (properly), set foo1 into
 session, and do not set foo2 into session, the following tests work:
 
   s:if test=#session.foo1 == null
   ...
   s:if test=#session.foo2 != null
   ...
 
 They continue to work if I go through multiple actions using the exact
 same JSP to test for their presence/non-presence.
 

Yes, I tried with this, but session variable is not found.

I think that you didn't understand what is my scenario. I have implemented
SessionAware interface for both of my action classes and that works
perfectly in the case of jsp's that are connected to that classes.
But in this case, I have this:

MyFirstActionClass - show first.jsp - user click on link -
MyFirstActionClass.method where I set session variable
(getSession().put(variable); - show second.jsp - user click on some link
- MySecondActionClass.method is called to return some results - show
third.jsp with those results, and in this page I test if my session.variable
is present, but there is not !! But, my variables that are set in
MySecondActionClass.method are present in session for third.jsp!

What is the problem ?

--
Thx in advance, Milan



newton.dave wrote:
 
 It is likely you are doing something wrong. I suppose that means you'll
 need to post the relevant SessionAware implementation, the code that sets
 the session variable(s), any action code in the application path that
 could modify session variables, the JSP that currently doesn't work, and
 any variants of the JSP code you've tried that also hasn't worked.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756012.html
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: [S2] Testing if session variable is present

2008-07-31 Thread Milan Milanovic

It seems that my session variable is deleted somehow when first action method
of the second Action class is called:

MyFirstActionClass - show first.jsp - user click on link -
MyFirstActionClass.method where I set session variable
(getSession().put(variable, new Boolean(true)); - show second.jsp (here I
see my variable) - user click on some link -
MySecondActionClass.method-third.jsp (here I don't see my variable).

I should note that in MySecondActionClass.method I don't clear session or
something similar, I just add remove some other variables and set some new.

--
Thx, Milan


Milan Milanovic wrote:
 
 Hi Dave,
 
 
 newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic [EMAIL PROTECTED] wrote:
 No one have any idea how to access session variable in jsp
 in this kind of simple scenario ?
 
 That's one explanation.
 
 So, scenario is like this:
 [...]
 
 I am unable to duplicate the inability to test session variables for
 non-existence/null.
 
 If I have an action implementing SessionAware (properly), set foo1 into
 session, and do not set foo2 into session, the following tests work:
 
   s:if test=#session.foo1 == null
   ...
   s:if test=#session.foo2 != null
   ...
 
 They continue to work if I go through multiple actions using the exact
 same JSP to test for their presence/non-presence.
 
 
 Yes, I tried with this, but session variable is not found.
 
 I think that you didn't understand what is my scenario. I have implemented
 SessionAware interface for both of my action classes and that works
 perfectly in the case of jsp's that are connected to that classes.
 But in this case, I have this:
 
 MyFirstActionClass - show first.jsp - user click on link -
 MyFirstActionClass.method where I set session variable
 (getSession().put(variable); - show second.jsp - user click on some
 link - MySecondActionClass.method is called to return some results -
 show third.jsp with those results, and in this page I test if my
 session.variable is present, but there is not !! But, my variables that
 are set in MySecondActionClass.method are present in session for
 third.jsp!
 
 What is the problem ?
 
 --
 Thx in advance, Milan
 
 
 
 newton.dave wrote:
 
 It is likely you are doing something wrong. I suppose that means you'll
 need to post the relevant SessionAware implementation, the code that sets
 the session variable(s), any action code in the application path that
 could modify session variables, the JSP that currently doesn't work, and
 any variants of the JSP code you've tried that also hasn't worked.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756151.html
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: [S2] Testing if session variable is present

2008-07-31 Thread Piero Sartini
 No one have any idea how to access session variable in jsp in this kind of
 simple scenario ?

You may access your session variable just like you would do without S2. There 
is no difference. Then use either the s:test tag from struts or c:if from the 
standard tag library. 

Piero

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



Re: [S2] Testing if session variable is present

2008-07-31 Thread Dave Newton
--- On Thu, 7/31/08, Milan Milanovic wrote:
 I think that you didn't understand what is my scenario.

I'm reasonably certain that I did.

 What is the problem ?

I still don't know, because you still didn't include the code I asked for. That 
would have saved at least one posting (this one).

I duplicated your scenario, except for that whole mine works thing. I store 
things in session all the time and have never seen this issue (except one time 
when our replication wasn't working properly, which isn't a Struts issue).

I know of no default mechanism that would remove a session variable without 
being told to do so. Unless you provide more information it's unlikely you will 
get any replies that will magically solve your problem.

Dave


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



Re: [S2] Testing if session variable is present

2008-07-31 Thread Milan Milanovic

Hi Dave,

one question, is it possible that Acegi security remove my session variable,
because it sometimes ask to login between actions ? But, I'm not sure for
this.

--
Regards, Milan


newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic wrote:
 I think that you didn't understand what is my scenario.
 
 I'm reasonably certain that I did.
 
 What is the problem ?
 
 I still don't know, because you still didn't include the code I asked for.
 That would have saved at least one posting (this one).
 
 I duplicated your scenario, except for that whole mine works thing. I
 store things in session all the time and have never seen this issue
 (except one time when our replication wasn't working properly, which isn't
 a Struts issue).
 
 I know of no default mechanism that would remove a session variable
 without being told to do so. Unless you provide more information it's
 unlikely you will get any replies that will magically solve your problem.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756303.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



[OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-07-31 Thread Dave Newton
--- On Thu, 7/31/08, Milan Milanovic wrote:
 (getSession().put(variable, new Boolean(true));

Use Boolean.TRUE rather than instantiating a new object.

Note also that the Javadocs for Boolean state in big bold letters:

Note: It is rarely appropriate to use this constructor. Unless a new instance 
is required, the static factory valueOf(boolean) is generally a better choice. 
It is likely to yield significantly better space and time performance.

Dave


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



Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-07-31 Thread Milan Milanovic

Hi Dave,

no, I think that this is not an issue. I tried with Boolean.TRUE and it is
the same, but I earlier used new Boolean(true) and that worked.

--
Milan


newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic wrote:
 (getSession().put(variable, new Boolean(true));
 
 Use Boolean.TRUE rather than instantiating a new object.
 
 Note also that the Javadocs for Boolean state in big bold letters:
 
 Note: It is rarely appropriate to use this constructor. Unless a new
 instance is required, the static factory valueOf(boolean) is generally a
 better choice. It is likely to yield significantly better space and time
 performance.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756698.html
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: Re: [S2] Testing if session variable is present

2008-07-31 Thread [EMAIL PROTECTED]
Sure it's possible.

Milan Milanovic wrote:
 Hi Dave,
 one question, is it possible that Acegi security remove my session variable,
 because it sometimes ask to login between actions ? But, I'm not sure for
 this.
 --
 Regards, Milan
 newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic wrote:
 I think that you didn't understand what is my scenario.
 
 I'm reasonably certain that I did.
 
 What is the problem ?
 
 I still don't know, because you still didn't include the code I asked for.
 That would have saved at least one posting (this one).
 
 I duplicated your scenario, except for that whole mine works thing. I
 store things in session all the time and have never seen this issue
 (except one time when our replication wasn't working properly, which isn't
 a Struts issue).
 
 I know of no default mechanism that would remove a session variable
 without being told to do so. Unless you provide more information it's
 unlikely you will get any replies that will magically solve your problem.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 View this message in context: 
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756303.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


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



RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-07-31 Thread [EMAIL PROTECTED]
I didn't say it wouldn't work. I, and the Sun documentation I quoted, said it 
was a known bad programming practice.

Dave

Milan Milanovic wrote:
 Hi Dave,
 no, I think that this is not an issue. I tried with Boolean.TRUE and it is
 the same, but I earlier used new Boolean(true) and that worked.
 --
 Milan
 newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic wrote:
 (getSession().put(variable, new Boolean(true));
 
 Use Boolean.TRUE rather than instantiating a new object.
 
 Note also that the Javadocs for Boolean state in big bold letters:
 
 Note: It is rarely appropriate to use this constructor. Unless a new
 instance is required, the static factory valueOf(boolean) is generally a
 better choice. It is likely to yield significantly better space and time
 performance.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 View this message in context: 
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756698.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


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



RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-07-31 Thread Milan Milanovic

Dear Dave,

O.K. But when you look at this scenario:

MyFirstActionClass - show first.jsp - user click on link -
MyFirstActionClass.method where I set session variable
(getSession().put(variable, new Boolean(true)); - show second.jsp (here I
see my variable) - user click on some link -
MySecondActionClass.method-third.jsp (here I don't see my variable). 

I should note that in MySecondActionClass.method I don't clear session or
something similar, I just add remove some other variables and set some new. 

Why my session is obviously cleared when action from another namespace is
called ?

--
Thx, Milan


newton.dave wrote:
 
 I didn't say it wouldn't work. I, and the Sun documentation I quoted, said
 it was a known bad programming practice.
 
 Dave
 
 Milan Milanovic wrote:
 Hi Dave,
 no, I think that this is not an issue. I tried with Boolean.TRUE and it
 is
 the same, but I earlier used new Boolean(true) and that worked.
 --
 Milan
 newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic wrote:
 (getSession().put(variable, new Boolean(true));
 
 Use Boolean.TRUE rather than instantiating a new object.
 
 Note also that the Javadocs for Boolean state in big bold letters:
 
 Note: It is rarely appropriate to use this constructor. Unless a new
 instance is required, the static factory valueOf(boolean) is generally a
 better choice. It is likely to yield significantly better space and time
 performance.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756698.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18758095.html
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: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-07-31 Thread [EMAIL PROTECTED]
I already told you I don't know and you continue to refuse to provide the 
information I've asked for. You also added new information about Acegi, which I 
responded to by saying that yes, if you're getting logged out it's unlikely 
you'd keep the same session, as that would somewhat defeat the purpose of any 
reasonable login/logout mechanism.

I don't think I have anything further of value to offer you. I don't know of 
any issues with session variables; if you're having an Acegi issue then pursue 
the issue on a Spring forum.

Dave

Milan Milanovic wrote:
 Dear Dave,
 O.K. But when you look at this scenario:
 MyFirstActionClass - show first.jsp - user click on link -
 MyFirstActionClass.method where I set session variable
 (getSession().put(variable, new Boolean(true)); - show second.jsp (here I
 see my variable) - user click on some link -
 MySecondActionClass.method-third.jsp (here I don't see my variable). 
 I should note that in MySecondActionClass.method I don't clear session or
 something similar, I just add remove some other variables and set some new. 
 Why my session is obviously cleared when action from another namespace is
 called ?
 --
 Thx, Milan
 newton.dave wrote:
 
 I didn't say it wouldn't work. I, and the Sun documentation I quoted, said
 it was a known bad programming practice.
 
 Dave
 
 Milan Milanovic wrote:
 Hi Dave,
 no, I think that this is not an issue. I tried with Boolean.TRUE and it
 is
 the same, but I earlier used new Boolean(true) and that worked.
 --
 Milan
 newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic wrote:
 (getSession().put(variable, new Boolean(true));
 
 Use Boolean.TRUE rather than instantiating a new object.
 
 Note also that the Javadocs for Boolean state in big bold letters:
 
 Note: It is rarely appropriate to use this constructor. Unless a new
 instance is required, the static factory valueOf(boolean) is generally a
 better choice. It is likely to yield significantly better space and time
 performance.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756698.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 View this message in context: 
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18758095.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


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



RE: RE: Re: [OT] new Boolean(true)? Re: [S2] Testing if session variable is present

2008-07-31 Thread Milan Milanovic

Hi Dave,

excuse me for disturbing this list or you personally, I asked for this in
Spring forum (
http://forum.springframework.org/showthread.php?p=194333#post194333
http://forum.springframework.org/showthread.php?p=194333#post194333 ).
I figured out what I do in those method with session which forces user to
log in again, that I don't do in other methods, I do this:

// Test if session is valid
if (session instanceof org.apache.struts2.dispatcher.SessionMap) {
  try {
 ((org.apache.struts2.dispatcher.SessionMap)session ).invalidate();
   } catch (IllegalStateException e) {
logger.error(Session is not valid!, e);
return Action.ERROR;
}
}

Is this possible to erase session ?

--
Thx, Milan


newton.dave wrote:
 
 I already told you I don't know and you continue to refuse to provide the
 information I've asked for. You also added new information about Acegi,
 which I responded to by saying that yes, if you're getting logged out it's
 unlikely you'd keep the same session, as that would somewhat defeat the
 purpose of any reasonable login/logout mechanism.
 
 I don't think I have anything further of value to offer you. I don't know
 of any issues with session variables; if you're having an Acegi issue then
 pursue the issue on a Spring forum.
 
 Dave
 
 Milan Milanovic wrote:
 Dear Dave,
 O.K. But when you look at this scenario:
 MyFirstActionClass - show first.jsp - user click on link -
 MyFirstActionClass.method where I set session variable
 (getSession().put(variable, new Boolean(true)); - show second.jsp
 (here I
 see my variable) - user click on some link -
 MySecondActionClass.method-third.jsp (here I don't see my variable). 
 I should note that in MySecondActionClass.method I don't clear session or
 something similar, I just add remove some other variables and set some
 new. 
 Why my session is obviously cleared when action from another namespace is
 called ?
 --
 Thx, Milan
 newton.dave wrote:
 
 I didn't say it wouldn't work. I, and the Sun documentation I quoted,
 said
 it was a known bad programming practice.
 
 Dave
 
 Milan Milanovic wrote:
 Hi Dave,
 no, I think that this is not an issue. I tried with Boolean.TRUE and it
 is
 the same, but I earlier used new Boolean(true) and that worked.
 --
 Milan
 newton.dave wrote:
 
 --- On Thu, 7/31/08, Milan Milanovic wrote:
 (getSession().put(variable, new Boolean(true));
 
 Use Boolean.TRUE rather than instantiating a new object.
 
 Note also that the Javadocs for Boolean state in big bold letters:
 
 Note: It is rarely appropriate to use this constructor. Unless a new
 instance is required, the static factory valueOf(boolean) is generally
 a
 better choice. It is likely to yield significantly better space and
 time
 performance.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18756698.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18758095.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18764848.html
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: [S2] Testing if session variable is present

2008-07-30 Thread Milan Milanovic

Well, this : s:if test=%{#session.your_variable != null} doesn't work,
event though my class implements sessionAware and I put my your_variable in
session before displaying this jsp page.

What can I do ?

--
Thx, Milan



felipe.lorenz wrote:
 
 Hummm.. Struts 1 or 2?
 
 This code is to S2.
 
 s:if test=%{#session.your_variable != null}
 
 do something
 
 /s:if
 
 I didnt test it, so im not sure about the code.
 
 But try it, and tell us.
 
 Felipe Lorenz
 
 On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
 [EMAIL PROTECTED]wrote:
 

 Hi,

 I need to test in jsp if some session variable is present, and based on
 that
 to
 show some struts view code or not. How can I do that ?

 --
 Thx, Milan
 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18735618.html
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: [S2] Testing if session variable is present

2008-07-30 Thread Marcos Hermida

Have you tried this:
s:if test=#session['your_variable']!= null


Milan Milanovic escribió:

Well, this : s:if test=%{#session.your_variable != null} doesn't work,
event though my class implements sessionAware and I put my your_variable in
session before displaying this jsp page.

What can I do ?

--
Thx, Milan



felipe.lorenz wrote:
  

Hummm.. Struts 1 or 2?

This code is to S2.

s:if test=%{#session.your_variable != null}

do something

/s:if

I didnt test it, so im not sure about the code.

But try it, and tell us.

Felipe Lorenz

On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
[EMAIL PROTECTED]wrote:



Hi,

I need to test in jsp if some session variable is present, and based on
that
to
show some struts view code or not. How can I do that ?

--
Thx, Milan
--
View this message in context:
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


  



  



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



Re: [S2] Testing if session variable is present

2008-07-30 Thread Milan Milanovic

Hi,

just to note, I treid with this too: s:if test=#session.your_variable !=
null and it doesn't work.
I put my session variable in one action class, and then redirect to another
page which is connected to another action class. When that second class
method is runned, and resulting jsp is shown in that page I test this. My
both classes implements sessionAware.

--
Milan



Milan Milanovic wrote:
 
 Well, this : s:if test=%{#session.your_variable != null} doesn't work,
 event though my class implements sessionAware and I put my your_variable
 in session before displaying this jsp page.
 
 I should note that I put that variable in one action class and then that
 s:if test is runned in jsp for another action class, but both classes
 implements sessionAware.
 
 What can I do ?
 
 --
 Thx, Milan
 
 
 
 felipe.lorenz wrote:
 
 Hummm.. Struts 1 or 2?
 
 This code is to S2.
 
 s:if test=%{#session.your_variable != null}
 
 do something
 
 /s:if
 
 I didnt test it, so im not sure about the code.
 
 But try it, and tell us.
 
 Felipe Lorenz
 
 On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
 [EMAIL PROTECTED]wrote:
 

 Hi,

 I need to test in jsp if some session variable is present, and based on
 that
 to
 show some struts view code or not. How can I do that ?

 --
 Thx, Milan
 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18735966.html
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: [S2] Testing if session variable is present

2008-07-30 Thread Milan Milanovic

Nop, it doesn't work.

--
Milan


Marcos Hermida-2 wrote:
 
 Have you tried this:
 s:if test=#session['your_variable']!= null
 
 
 Milan Milanovic escribió:
 Well, this : s:if test=%{#session.your_variable != null} doesn't
 work,
 event though my class implements sessionAware and I put my your_variable
 in
 session before displaying this jsp page.

 What can I do ?

 --
 Thx, Milan



 felipe.lorenz wrote:
   
 Hummm.. Struts 1 or 2?

 This code is to S2.

 s:if test=%{#session.your_variable != null}

 do something

 /s:if

 I didnt test it, so im not sure about the code.

 But try it, and tell us.

 Felipe Lorenz

 On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
 [EMAIL PROTECTED]wrote:

 
 Hi,

 I need to test in jsp if some session variable is present, and based on
 that
 to
 show some struts view code or not. How can I do that ?

 --
 Thx, Milan
 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


   
 

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

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18736048.html
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: [S2] Testing if session variable is present

2008-07-30 Thread Milan Milanovic

So, scenario is like this:

MyFirstAction.method1 [put session variable] - show first.jsp - user click
on link in first.jsp page - show second.jsp - user click on link in
second.jsp - MySecondAction.someMethod is called - show third.jsp where
this session test should be done.

I hope this helps.

--
Thx, Milan


Milan Milanovic wrote:
 
 Hi,
 
 just to note, I treid with this too: s:if test=#session.your_variable !=
 null and it doesn't work.
 I put my session variable in one action class, and then redirect to
 another page which is connected to another action class. When that second
 class method is runned, and resulting jsp is shown in that page I test
 this. My both classes implements sessionAware.
 
 --
 Milan
 
 
 
 Milan Milanovic wrote:
 
 Well, this : s:if test=%{#session.your_variable != null} doesn't
 work, event though my class implements sessionAware and I put my
 your_variable in session before displaying this jsp page.
 
 I should note that I put that variable in one action class and then that
 s:if test is runned in jsp for another action class, but both classes
 implements sessionAware.
 
 What can I do ?
 
 --
 Thx, Milan
 
 
 
 felipe.lorenz wrote:
 
 Hummm.. Struts 1 or 2?
 
 This code is to S2.
 
 s:if test=%{#session.your_variable != null}
 
 do something
 
 /s:if
 
 I didnt test it, so im not sure about the code.
 
 But try it, and tell us.
 
 Felipe Lorenz
 
 On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
 [EMAIL PROTECTED]wrote:
 

 Hi,

 I need to test in jsp if some session variable is present, and based on
 that
 to
 show some struts view code or not. How can I do that ?

 --
 Thx, Milan
 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18736124.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2] Testing if session variable is present

2008-07-29 Thread Milan Milanovic

Hi,

I need to test in jsp if some session variable is present, and based on that
to 
show some struts view code or not. How can I do that ?

--
Thx, Milan
-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
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: [S2] Testing if session variable is present

2008-07-29 Thread Felipe Lorenz
Hummm.. Struts 1 or 2?

This code is to S2.

s:if test=%{#session.your_variable != null}

do something

/s:if

I didnt test it, so im not sure about the code.

But try it, and tell us.

Felipe Lorenz

On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
[EMAIL PROTECTED]wrote:


 Hi,

 I need to test in jsp if some session variable is present, and based on
 that
 to
 show some struts view code or not. How can I do that ?

 --
 Thx, Milan
 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
 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: [S2] Testing if session variable is present

2008-07-29 Thread Ylva D

Hi Milan,

If you're using Struts 1 you should be able to use the logic:present tag
like this:
logic:present name = NameOfVariableSavedInSession scope = session
   tags to execute if the above is true
/logic:present

Hope this helps!

/Ylva


Milan Milanovic wrote:
 
 Hi,
 
 I need to test in jsp if some session variable is present, and based on
 that to 
 show some struts view code or not. How can I do that ?
 
 --
 Thx, Milan
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18718079.html
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: [S2] Testing if session variable is present

2008-07-29 Thread Milan Milanovic

Hi,

it is S2, I wrote this in subject of this topis.

Thanks, I'll try it.

--
Regards, Milan


felipe.lorenz wrote:
 
 Hummm.. Struts 1 or 2?
 
 This code is to S2.
 
 s:if test=%{#session.your_variable != null}
 
 do something
 
 /s:if
 
 I didnt test it, so im not sure about the code.
 
 But try it, and tell us.
 
 Felipe Lorenz
 
 On Tue, Jul 29, 2008 at 9:34 AM, Milan Milanovic
 [EMAIL PROTECTED]wrote:
 

 Hi,

 I need to test in jsp if some session variable is present, and based on
 that
 to
 show some struts view code or not. How can I do that ?

 --
 Thx, Milan
 --
 View this message in context:
 http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18716278.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Testing-if-session-variable-is-present-tp18716278p18719597.html
Sent from the Struts - User mailing list archive at Nabble.com.


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