Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread Martin Gainty
, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: "Dave Newton" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, May 29, 2007 1:03 PM Subject:

Re: [OT] Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread Dave Newton
--- yitzle <[EMAIL PROTECTED]> wrote: > "JSPs are compiled into Java Servlets by a JSP > compiler. [1]" The way I see it, so long as the > result is a JSP page, the project contains a servlet. Semantics. The developer rarely, if ever, needs to care that a JSP page is compiled into a servlet. >

RE: [OT] Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread Forsberg, Mike
interview question. Hope I helped, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of yitzle Sent: Tuesday, May 29, 2007 4:29 PM To: Struts Users Mailing List Subject: Re: [OT] Re: [S2] Obtaining Session/Request Object On 5/29/07, Dave Newton <[EMAIL PROTECTED]&

Re: [OT] Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle
On 5/29/07, Dave Newton <[EMAIL PROTECTED]> wrote: I'm starting to feel like we're doing your homework for you. I'm sorry you feel that way. If you prefer not to reply, its your prerogative. I am just trying to understand the technology. A "Struts project" is not a servlet. A Struts project mi

[OT] Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread Dave Newton
--- yitzle <[EMAIL PROTECTED]> wrote: > So, it would seem a Strut project is a servlet. It > runs inside the web container, receives an HTTP > request, generates and sends an HTTP response. Meets > all the criteria. Right? Now, how do you define a web > application? You may wish to seek elsewhe

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle
Alright. Read that page. Wikipedia's definition needs updating. What I understand from that is that a servlet is basically like a Java CGI program that runs in the web server process. So, it would seem a Strut project is a servlet. It runs inside the web container, receives an HTTP request, genera

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle
Oh. OK. That makes sense... They have some sample code here [1] that made it "click" for me. Thanks! [1] http://www.infoq.com/articles/converting-struts-2-part1 On 5/29/07, Dave Newton <[EMAIL PROTECTED]> wrote: --- yitzle <[EMAIL PROTECTED]> wrote: > SessionAware only provides a setSession() me

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread Dave Newton
--- yitzle <[EMAIL PROTECTED]> wrote: > SessionAware only provides a setSession() method. No > getSession(). Do I use setSession both to set and get > Session variables? No, you use the map provided to the setSession method. d. _

RE: [S2] Obtaining Session/Request Object

2007-05-29 Thread Al Sutton
ailto:[EMAIL PROTECTED] On Behalf Of yitzle Sent: 29 May 2007 18:57 To: Struts Users Mailing List Subject: Re: [S2] Obtaining Session/Request Object On 5/29/07, Dave Newton <[EMAIL PROTECTED]> wrote: > --- yitzle <[EMAIL PROTECTED]> wrote: > > Now I need to figure out what cla

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle
SessionAware only provides a setSession() method. No getSession(). Do I use setSession both to set and get Session variables? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle
The SessionAware documentation you linked me to earlier [1] states: "This interface is only relevant if the Action is used in a servlet environment." So is SessionAware really ServletSessionAware and/or ServletRequestAware the same as RequestAware? (I'm not trying to equate two classes, but rather

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle
On 5/29/07, Dave Newton <[EMAIL PROTECTED]> wrote: --- yitzle <[EMAIL PROTECTED]> wrote: > Now I need to figure out what classifies a Servlet > vs a Web Application. Er... In case you're serious, a servlet is part of a web application. d. Let me see if I get this... According to Wikipedia: "

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread Dave Newton
--- yitzle <[EMAIL PROTECTED]> wrote: > Now I need to figure out what classifies a Servlet > vs a Web Application. Er... In case you're serious, a servlet is part of a web application. d. Yahoo! oneSe

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle
Now I need to figure out what classifies a Servlet vs a Web Application. Wikipedia should be of use... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread Dave Newton
--- yitzle <[EMAIL PROTECTED]> wrote: > ... unless I am writing a Servlet. In which case it isn't an S2 question at all and should be asked elsewhere, and the previous sub-optimal solution would also be incorrect. d. _

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle
No, you should implement SessionAware http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/interceptor/SessionAware.html55 and avoid being tied to the Servlet spec. ... unless I am writing a Servlet. - To unsubs

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread Dave Newton
--- Yoni Amir <[EMAIL PROTECTED]> wrote: > Your action should implement the ServletRequestAware > interface, then the Servlet Config Interceptor, which > is active by default, does the rest. > http://struts.apache.org/2.x/docs/servlet-config-interceptor.html No, you should implement SessionAware

Re: [S2] Obtaining Session/Request Object

2007-05-29 Thread Yoni Amir
Your action should implement the ServletRequestAware interface, then the Servlet Config Interceptor, which is active by default, does the rest. http://struts.apache.org/2.x/docs/servlet-config-interceptor.html Yoni On 5/29/07, yitzle <[EMAIL PROTECTED]> wrote: I want to store session informati

[S2] Obtaining Session/Request Object

2007-05-29 Thread yitzle
I want to store session information. From what I understand, the best way to do this is by accessing the Session Object. It appears I get the session by getting the Request Object (HttpServletRequest or whatever) and calling its getSession(). Struts1 had execute() methods that took a Request as