Author Login
Post Reply
user Digest 29 May 2008 13:54:47 -0000 Issue 8056
Topics (messages 186933 through 186953):
Re: dojo 0.4 XMLHttp requst submit progress indicator
186933 by: Wes Wannemacher
186938 by: Bob Tiernay
Re: optiontransferselect Problem
186934 by: mailtorakeshp
Re: s:if test request parameter variable problem
186935 by: Martin
186936 by: Dave Newton
186937 by: Martin
186939 by: Laurie Harper
Re: How to promt SaveAs dialog when a file is to be downloaded?
186940 by: quinquin2209
Struts 2 + Hibernate question
186941 by: Márcio Gurgel
186942 by: Al Sutton
Re: sending multiple parameter with display tag
186943 by: vdeep.ygconsultants.com
Re: XML Validation Problem
186944 by: Lukasz Lenart
186945 by: Stetze
186946 by: Lukasz Lenart
186947 by: Stetze
186948 by: Lukasz Lenart
186949 by: Stetze
Re: [Struts 2] Session scope
186950 by: Milan Milanovic
186951 by: Juan Pablo Pizarro
186952 by: Milan Milanovic
186953 by: Martin
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_186933.ezm (zipped)Jane,
I've taken a simple route in the past and simply replaced the submit
button with an animated gif file...
Here is one I created (by myself, no copyright) that you can use if you
want -
http://www.doubleatrailer.com/dat_r3/images/AnimStatus.gif
It's purposely a bit big, in production, I usually use img height and
width attributes to make it look right. Since it's familiar to users,
they will think the intarwebs are working on their request, since it is
a status bar ;-D
-Wes
On Wed, 2008-05-28 at 15:25 -0400, Jiang, Jane (NIH/NCI) [C] wrote:
> I am using Struts 2.0.11 with dojo 0.4. This is the first Ajax enabled
> application for our users. I use dojo.io.bind to submit most of the
> requests. Is there a solution I can use to present some visual
> indicator after submitting a request?
>
> Many thanks for your help,
>
> Jane
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment:
user_186938.ezm (zipped)You can also check out:
http://www.ajaxload.info/
--------------------------------------------------
From: "Wes Wannemacher" <wesw@(protected)>
Sent: Wednesday, May 28, 2008 6:17 PM
To: "Struts Users Mailing List" <user@(protected)>
Subject: Re: dojo 0.4 XMLHttp requst submit progress indicator
> Jane,
>
> I've taken a simple route in the past and simply replaced the submit
> button with an animated gif file...
>
> Here is one I created (by myself, no copyright) that you can use if you
> want -
>
> http://www.doubleatrailer.com/dat_r3/images/AnimStatus.gif
>
> It's purposely a bit big, in production, I usually use img height and
> width attributes to make it look right. Since it's familiar to users,
> they will think the intarwebs are working on their request, since it is
> a status bar ;-D
>
> -Wes
>
>
> On Wed, 2008-05-28 at 15:25 -0400, Jiang, Jane (NIH/NCI) [C] wrote:
>> I am using Struts 2.0.11 with dojo 0.4. This is the first Ajax enabled
>> application for our users. I use dojo.io.bind to submit most of the
>> requests. Is there a solution I can use to present some visual
>> indicator after submitting a request?
>>
>> Many thanks for your help,
>>
>> Jane
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186934.ezm (zipped)
It's working now. The problem was with the submit button and the javascript.
Usually, all the values in those select boxes should be selected(generated
javascript does that for you) once you click on the submit button; this was
not happening in my case as I had an onclick event for the form submission,
which was causing the generated javascript to not get executed. Submit
button should be simple enough as follows.
<s:submit action="TestingTool_filter" value="Filter Logs"/>
cheers
Rakesh
mailtorakeshp wrote:
>
> Hi Sagarlotiya,
> Thanks a lot for the quick reply.
> I am new bee to struts 2 world and do not know much about
> 'paramPrepareParamStack'. I googled for 'paramPrepareParamStack', but no
> luck on (google returned just 4 results, all of them are the replies from
> you :-)) what exactly is meant by this term. Can you please explain what
> it is and how it works and may be a sample code that can resolve my
> issues.
>
> Thanks
> Rakesh
>
>
> sagarlotiya wrote:
>>
>> hi,
>> Your jsp code looks ok...
>> But when will u submit form and try to set the parameter using getter and
>> setter, be sure that u are using paramPrepareParamStack other wise it
>> will not set any value on getter and setter.
>>
>>
>> mailtorakeshp wrote:
>>>
>>> Hi,
>>> I just started using the optiontransferselect tag and am bugged up with
>>> the following problem.
>>>
>>> The selected values for the double list (on the right side) are null in
>>> the action class.
>>>
>>> JSP code:
>>>
>>> <s:optiontransferselect
>>> label="Log Filter for Top Level Campaign"
>>> name="topCampLog"
>>> leftTitle="Elements of Log"
>>> rightTitle="Filtered Elements of Log"
>>> list="defaultTopCampLog"
>>> headerKey="headerKey"
>>> headerValue="--- Please Select ---"
>>> doubleName="topCampFilter"
>>> doubleList="defaultTopCampFilter"
>>> doubleHeaderKey="doubleHeaderKey"
>>> doubleHeaderValue="--- Please Select ---" />
>>>
>>> Action Class code:
>>>
>>> private List topCampLog;
>>> private List topCampFilter;
>>> private List defaultTopCampLog;
>>> private List defaultTopCampFilter;
>>>
>>> public List getTopCampLog() {
>>> return topCampLog;
>>> }
>>> public void setTopCampLog(List topCampLog) {
>>> this.topCampLog = topCampLog;
>>> }
>>> public List getTopCampFilter() {
>>> return topCampFilter;
>>> }
>>> public void setTopCampFilter(List topCampFilter) {
>>> this.topCampFilter = topCampFilter;
>>> }
>>> public List getDefaultTopCampLog() {
>>> return defaultTopCampLog;
>>> }
>>> public void setDefaultTopCampLog(List defaultTopCampLog) {
>>> this.defaultTopCampLog = defaultTopCampLog;
>>> }
>>> public List getDefaultTopCampFilter() {
>>> return defaultTopCampFilter;
>>> }
>>> public void setDefaultTopCampFilter(List defaultTopCampFilter) {
>>> this.defaultTopCampFilter = defaultTopCampFilter;
>>> }
>>>
>>> public String execute() {
>>> ......
>>> do something with the selected values on the right.
>>> .......
>>> return SUCCESS;
>>> }
>>>
>>> list is populated from the database without any issues and doubleList is
>>> empty (Just the please select header is present). When I transfer few
>>> values from left to right and submit the page, I cannot find any values
>>> for the selected list, in the action class. ie. getTopCampFilter() and
>>> topCampFilter are null.
>>>
>>> Am I missing something here? Why can't I see the selected list in the
>>> action class? Why is it null?
>>> Any kind of help would be greatly appreciated.
>>>
>>> Thanks
>>> Rakesh
>>>
>>
>>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_186935.ezm (zipped)is the patch in the new distros?
Thanks
----- Original Message -----
From: "Musachy Barroso" <musachy@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Wednesday, May 28, 2008 3:38 PM
Subject: Re: s:if test request parameter variable problem
> Thanks for reporting. Fixed.
>
> musachy
>
> On Wed, May 28, 2008 at 3:09 PM, Mark Lester <MarkL@(protected)>
> wrote:
>> Nah that didn't work but I found the page that explains what the
>> problem is
>> http://struts.apache.org/2.x/docs/why-doesnt-the-if-tag-evaluate-test.
>> html
>> and that fixed it. The question is actually part of the FAQ but the
>> link to the solution is incorrect. It should be changed to the link
>> that I provided.
>> Regards,
>> Mark
>>
>> -----Original Message-----
>> From: Juan Pablo Pizarro [mailto:juanpablo.pizarro@(protected)]
>> Sent: Wednesday, May 28, 2008 3:00 PM
>> To: Struts Users Mailing List
>> Subject: Re: s:if test request parameter variable problem
>>
>> Try with something like this:
>>
>> <s:if test="#session['parameters'].location.equals('abc')">
>>
>> Regards,
>>
>> JP
>>
>> 2008/5/28, Mark Lester <MarkL@(protected)>:
>>> I find this very odd but essentially I want to test something
>> against
>>> the request parameter
>>>
>>> So I put ?location=abc in the url
>>>
>>> And when I print to the page via
>>>
>>> <s:property value="%{#parameters.location}">
>>>
>>> Its prints out abc
>>>
>>> But if I try and test against it value via
>>>
>>> <s:if test="%{#parameters.location == 'abc'}">
>>>
>>> Or
>>>
>>> <s:if test='%{#parameters.location.compareTo("abc") == 0}'>
>>>
>>> Both return false
>>>
>>> Any ideas on why its exhibiting this behavior?
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186936.ezm (zipped)The wiki update?
--- Martin <mgainty@(protected):
> is the patch in the new distros?
> Thanks
> ----- Original Message -----
> From: "Musachy Barroso" <musachy@(protected)>
> To: "Struts Users Mailing List" <user@(protected)>
> Sent: Wednesday, May 28, 2008 3:38 PM
> Subject: Re: s:if test request parameter variable problem
>
>
> > Thanks for reporting. Fixed.
> >
> > musachy
> >
> > On Wed, May 28, 2008 at 3:09 PM, Mark Lester
> <MarkL@(protected)>
> > wrote:
> >> Nah that didn't work but I found the page that explains what the
> >> problem is
> >>
>
http://struts.apache.org/2.x/docs/why-doesnt-the-if-tag-evaluate-test.
> >> html
> >> and that fixed it. The question is actually part of the FAQ but
> the
> >> link to the solution is incorrect. It should be changed to the
> link
> >> that I provided.
> >> Regards,
> >> Mark
> >>
> >> -----Original Message-----
> >> From: Juan Pablo Pizarro [mailto:juanpablo.pizarro@(protected)]
> >> Sent: Wednesday, May 28, 2008 3:00 PM
> >> To: Struts Users Mailing List
> >> Subject: Re: s:if test request parameter variable problem
> >>
> >> Try with something like this:
> >>
> >> <s:if test="#session['parameters'].location.equals('abc')">
> >>
> >> Regards,
> >>
> >> JP
> >>
> >> 2008/5/28, Mark Lester <MarkL@(protected)>:
> >>> I find this very odd but essentially I want to test something
> >> against
> >>> the request parameter
> >>>
> >>> So I put ?location=abc in the url
> >>>
> >>> And when I print to the page via
> >>>
> >>> <s:property value="%{#parameters.location}">
> >>>
> >>> Its prints out abc
> >>>
> >>> But if I try and test against it value via
> >>>
> >>> <s:if test="%{#parameters.location == 'abc'}">
> >>>
> >>> Or
> >>>
> >>> <s:if test='%{#parameters.location.compareTo("abc") == 0}'>
> >>>
> >>> Both return false
> >>>
> >>> Any ideas on why its exhibiting this behavior?
> >>>
> >>>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >>
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186937.ezm (zipped)(Mark L's report of a bug with s:if is correct ..)
I was looking for the distro that has musachy's updated struts taglib (s:if
patch)
Thanks Dave
----- Original Message -----
From: "Dave Newton" <newton.dave@(protected)>
To: "Struts Users Mailing List" <user@(protected)"
<mgainty@(protected)>
Sent: Wednesday, May 28, 2008 8:47 PM
Subject: Re: s:if test request parameter variable problem
> The wiki update?
>
> --- Martin <mgainty@(protected):
>
>> is the patch in the new distros?
>> Thanks
>> ----- Original Message -----
>> From: "Musachy Barroso" <musachy@(protected)>
>> To: "Struts Users Mailing List" <user@(protected)>
>> Sent: Wednesday, May 28, 2008 3:38 PM
>> Subject: Re: s:if test request parameter variable problem
>>
>>
>> > Thanks for reporting. Fixed.
>> >
>> > musachy
>> >
>> > On Wed, May 28, 2008 at 3:09 PM, Mark Lester
>> <MarkL@(protected)>
>> > wrote:
>> >> Nah that didn't work but I found the page that explains what the
>> >> problem is
>> >>
>>
> http://struts.apache.org/2.x/docs/why-doesnt-the-if-tag-evaluate-test.
>> >> html
>> >> and that fixed it. The question is actually part of the FAQ but
>> the
>> >> link to the solution is incorrect. It should be changed to the
>> link
>> >> that I provided.
>> >> Regards,
>> >> Mark
>> >>
>> >> -----Original Message-----
>> >> From: Juan Pablo Pizarro [mailto:juanpablo.pizarro@(protected)]
>> >> Sent: Wednesday, May 28, 2008 3:00 PM
>> >> To: Struts Users Mailing List
>> >> Subject: Re: s:if test request parameter variable problem
>> >>
>> >> Try with something like this:
>> >>
>> >> <s:if test="#session['parameters'].location.equals('abc')">
>> >>
>> >> Regards,
>> >>
>> >> JP
>> >>
>> >> 2008/5/28, Mark Lester <MarkL@(protected)>:
>> >>> I find this very odd but essentially I want to test something
>> >> against
>> >>> the request parameter
>> >>>
>> >>> So I put ?location=abc in the url
>> >>>
>> >>> And when I print to the page via
>> >>>
>> >>> <s:property value="%{#parameters.location}">
>> >>>
>> >>> Its prints out abc
>> >>>
>> >>> But if I try and test against it value via
>> >>>
>> >>> <s:if test="%{#parameters.location == 'abc'}">
>> >>>
>> >>> Or
>> >>>
>> >>> <s:if test='%{#parameters.location.compareTo("abc") == 0}'>
>> >>>
>> >>> Both return false
>> >>>
>> >>> Any ideas on why its exhibiting this behavior?
>> >>>
>> >>>
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> >> For additional commands, e-mail: user-help@(protected)
>> >>
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> >> For additional commands, e-mail: user-help@(protected)
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@(protected)
>> > For additional commands, e-mail: user-help@(protected)
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186939.ezm (zipped)Martin wrote:
> (Mark L's report of a bug with s:if is correct ..)
No it isn't. The problem was a usage error, as documented in the link he
posted.
> I was looking for the distro that has musachy's updated struts taglib
> (s:if patch)
There is no such patch. The 'fix' Musachy was refering to was the broken
link to the documentation Mark cited.
L.
>
> Thanks Dave
> ----- Original Message ----- From: "Dave Newton" <newton.dave@(protected)>
> To: "Struts Users Mailing List" <user@(protected)"
> <mgainty@(protected)>
> Sent: Wednesday, May 28, 2008 8:47 PM
> Subject: Re: s:if test request parameter variable problem
>
>
>> The wiki update?
>>
>> --- Martin <mgainty@(protected):
>>
>>> is the patch in the new distros?
>>> Thanks
>>> ----- Original Message ----- From: "Musachy Barroso" <musachy@(protected)>
>>> To: "Struts Users Mailing List" <user@(protected)>
>>> Sent: Wednesday, May 28, 2008 3:38 PM
>>> Subject: Re: s:if test request parameter variable problem
>>>
>>>
>>> > Thanks for reporting. Fixed.
>>> >
>>> > musachy
>>> >
>>> > On Wed, May 28, 2008 at 3:09 PM, Mark Lester
>>> <MarkL@(protected)>
>>> > wrote:
>>> >> Nah that didn't work but I found the page that explains what the
>>> >> problem is
>>> >>
>>>
>> http://struts.apache.org/2.x/docs/why-doesnt-the-if-tag-evaluate-test.
>>> >> html
>>> >> and that fixed it. The question is actually part of the FAQ but
>>> the
>>> >> link to the solution is incorrect. It should be changed to the
>>> link
>>> >> that I provided.
>>> >> Regards,
>>> >> Mark
>>> >>
>>> >> -----Original Message-----
>>> >> From: Juan Pablo Pizarro [mailto:juanpablo.pizarro@(protected)]
>>> >> Sent: Wednesday, May 28, 2008 3:00 PM
>>> >> To: Struts Users Mailing List
>>> >> Subject: Re: s:if test request parameter variable problem
>>> >>
>>> >> Try with something like this:
>>> >>
>>> >> <s:if test="#session['parameters'].location.equals('abc')">
>>> >>
>>> >> Regards,
>>> >>
>>> >> JP
>>> >>
>>> >> 2008/5/28, Mark Lester <MarkL@(protected)>:
>>> >>> I find this very odd but essentially I want to test something
>>> >> against
>>> >>> the request parameter
>>> >>>
>>> >>> So I put ?location=abc in the url
>>> >>>
>>> >>> And when I print to the page via
>>> >>>
>>> >>> <s:property value="%{#parameters.location}">
>>> >>>
>>> >>> Its prints out abc
>>> >>>
>>> >>> But if I try and test against it value via
>>> >>>
>>> >>> <s:if test="%{#parameters.location == 'abc'}">
>>> >>>
>>> >>> Or
>>> >>>
>>> >>> <s:if test='%{#parameters.location.compareTo("abc") == 0}'>
>>> >>>
>>> >>> Both return false
>>> >>>
>>> >>> Any ideas on why its exhibiting this behavior?
>>> >>>
>>> >>>
>>> >>
>>> >>
>>> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> >> For additional commands, e-mail: user-help@(protected)
>>> >>
>>> >>
>>> >>
>>> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> >> For additional commands, e-mail: user-help@(protected)
>>> >>
>>> >>
>>> >
>>> >
>>> >
>>> > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd
>>> >
>>> >
>>> ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> > For additional commands, e-mail: user-help@(protected)
>>> >
>>> >
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>

Attachment:
user_186940.ezm (zipped)
Hi,
Thanks for your kindly help. It works fine now.
Queenie
Gabriel Belingueres-2 wrote:
>
> You have to set the Content-Disposition in the HTTP header. See
> http://www.ietf.org/rfc/rfc2183.txt for the details, but setting as
> "attachment" will ask for the save dialog. Set the "filename" too if
> you want to pre-set the saved filename.
> See http://www.javaworld.com/javaworld/javatips/jw-javatip94.html for
> an example.
>
> 2008/5/28, quinquin2209 <quinquin2209-noip@(protected)>:
>>
>> Hi,
>>
>> I am not sure if this is a javascript question or structs question. But I
>> hope you may help.
>>
>> I have a page which will list out attachments of a message. When user
>> click
>> on the attachment, it is expected that a SaveAs dialog should be prompted
>> such that user can download the file.
>>
>> In struts.xml, I define something like this:
>>
>> <action name="download" method="downloadAttachment"
>> class="attachmentAction">
>> <result name="success" type="stream">
>> inputStream
>> filename="${downloadAttachmentFileName}"
>> 4096
>> </result>
>> <result name="input" type="redirect-action">
>> list
>> /message
>> ${docId}
>> </result>
>> </action>
>>
>> And in the html, I write like this
>>
>> <s:url id="downloadUrl" action="../attachment/download.action">
>> <s:param name="downloadAttachmentFileName"
>> value="attachments[#status.index].name"/>
>> </s:url>
>> <s:a href="%{downloadUrl}"><s:property
>> value="attachments[#status.index].name" /></s:a>
>>
>> So now when the file name is clicked, it will automatically show the file
>> content in a new page.
>>
>> Can anyone suggest how I can open a SaveAs dialog when the file is
>> clicked?
>> I look from the web knowing that document.execCommand("SaveAs"); is the
>> javascript to open the SaveAs dialog. But I don't know how can I combine
>> this in my page. Any suggestion?
>>
>> Queenie
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-promt-SaveAs-dialog-when-a-file-is-to-be-downloaded--tp17510502p17510502.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_186941.ezm (zipped)Hi all!
I'm using struts 2 + hibernate.
I've a strange problem, if someone could give me a hand I'll be so tankfull.
If I persist a object in my app every things go well and all relationchips
are stored correctey correctly.
The problem occours when I update this object... After the update all data
are stored correctly too, but the problem is that my page shows the old
object (different from database).
This could be some kind of cash from struts 2? Or my problem is just
hibernate?
I tryed this methods to force a refresh after bring the object from database
session.refresh(obj)
session.flush()
Tank so much for attention!
Márcio Gurgel

Attachment:
user_186942.ezm (zipped)Are you sure the page isn't being cached by your browser? Try hitting
reload (or CTRL + Reload if you're using IE).
Al.
Márcio Gurgel wrote:
> Hi all!
>
> I'm using struts 2 + hibernate.
> I've a strange problem, if someone could give me a hand I'll be so tankfull.
>
> If I persist a object in my app every things go well and all relationchips
> are stored correctey correctly.
> The problem occours when I update this object... After the update all data
> are stored correctly too, but the problem is that my page shows the old
> object (different from database).
>
> This could be some kind of cash from struts 2? Or my problem is just
> hibernate?
>
> I tryed this methods to force a refresh after bring the object from database
> session.refresh(obj)
> session.flush()
>
> Tank so much for attention!
>
> Márcio Gurgel
>
>

Attachment:
user_186943.ezm (zipped)Thanks for the support.
I saw the site. Its good.
But I have some questions
1. What we have to do with other file to implement it. Because I use one
but the result was same as before.
2. For multiple parameter which on to use.
3. If I want to display multiple properties in single column how can we
do it?
I am very thankful we you send me some descriptive example or any
suggestions.
Thank
Varun
-----Original Message-----
From: Engr. Jherald Gerome Lacambra [mailto:jgalacambra@(protected)]
Sent: Tuesday, May 27, 2008 3:23 AM
To: Varun Deep
Cc: user@(protected)
Subject: Re: sending multiple parameter with display tag
Hi Varun,
you can use a decorator class for this.
http://displaytag.sourceforge.net/11/tut_decorators.html
2008/5/27 Varun Deep <vdeep@(protected)>:
> Hello to all
>
>
>
> <display:table id="displaycolumn" name="listOfEmployee" pagesize="4"
> requestURI="offices.action">
>
>
>
> <display:column property="name" title="Emp Name"
href="getEmployees.action
> "
>
> paramId="id,name" paramProperty = "id,name" >
>
>
>
> </display:column>
>
>
>
> </display:table>
>
>
>
> with above column I am trying to send multiple parameters with the
column "
> Emp Name "but it shows nothing on the page.
>
> (means blank page).
>
>
>
> Please help me and if possible suggest me the solution.
>
>
>
> I am using displaytag.tld in web-inf folder and other jar file in the
lib.
>
>
>
>
>
> Thanks in advance
>
>
>
> varun
>
--
Jherald Gerome Lacambra

Attachment:
user_186944.ezm (zipped)Hi,
Did you define input result for that action? How it looks?
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart
http://jdn.pl/blog/416
http://www.lenart.org.pl/

Attachment:
user_186945.ezm (zipped)Hi,
I have defined two action in my struts.xml:
<action name="showProfile" class="profileAction" method="showProfile">
<result type="tiles">page.user.profile</result>
</action>
<action name="editProfile" class="profileAction" method="editProfile">
<result type="tiles">page.user.profile</result>
<result name="input" type="tiles">page.user.profile</result>
</action>
the showProfile action shows all the user information (user name, nick name, email, ...) in a form on the profile page.
the editProfile action is used to save the changed values of the form and is being validated via xml validation. but as I wrote if the validation returns a field error the error message is shown but all the form contents are gone on the profile page.
what would be the solution to solve this problem?
thanks in advance
-------- Original-Message--------
> Date: Thu, 29 May 2008 08:48:58 +0200
> From: "Lukasz Lenart" <lukasz.lenart@(protected)>
> To: "Struts Users Mailing List" <user@(protected)>
> Subject: Re: XML Validation Problem
> Hi,
>
> Did you define input result for that action? How it looks?
>
>
> Regards
> --
> Lukasz
>
> http://www.linkedin.com/in/lukaszlenart
> http://jdn.pl/blog/416
> http://www.lenart.org.pl/
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

Attachment:
user_186946.ezm (zipped)Hi,
Your configuration looks ok, maybe there is something in your action, maybe
you reset a profile bean, or recreate it or something in editProfile method,
could you share it?
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart
http://jdn.pl/blog/416
http://www.lenart.org.pl/

Attachment:
user_186947.ezm (zipped)Hi,
thanks for looking at the problem. here is the relevant part of my action:
public class ProfileAction extends JombolaAction {
private static Logger l = Logger.getLogger("UserAction");
private UserService userService;
private ScopeUserService scopeUserService;
private String username;
private String email;
private String password;
private String newPassword;
private String confirmPassword;
private String fullname;
private String scope;
private Collection<GameScopeValue> scopes;
private String button;
private static final long serialVersionUID = 1L;
public String showProfile() throws Exception {
UserContext uCtx;
String result = ERROR;
uCtx = getUserContext();
if (uCtx != null) {
username = uCtx.getUser().getUsername();
fullname = uCtx.getUser().getFullname();
email = uCtx.getUser().getEmail();
result = SUCCESS;
}
return result;
}
public String editProfile() throws Exception {
String result = ERROR;
UserContext uCtx = getUserContext();
if (uCtx != null) {
uCtx.getUser().setUsername(username);
uCtx.getUser().setFullname(fullname);
uCtx.getUser().setEmail(email);
}
try {
userService.updateUser(uCtx.getUser());
setUserContext(uCtx);
addActionMessage(getText("message.profile.updated"));
result = SUCCESS;
} catch (UserNotExistsException e) {
l.debug("Exception while updating profile/password of user: "
+ username + ", user does not exist!");
addActionError(getText("message.profile.error"));
}
showProfile(); // I tried it with and without this line but if there is a validation error all fields in the jsps are empty
return result;
}
is there an error?
-------- Original-Nachricht --------
> Datum: Thu, 29 May 2008 14:20:18 +0200
> Von: "Lukasz Lenart" <lukasz.lenart@(protected)>
> An: "Struts Users Mailing List" <user@(protected)>
> Betreff: Re: XML Validation Problem
> Hi,
>
> Your configuration looks ok, maybe there is something in your action,
> maybe
> you reset a profile bean, or recreate it or something in editProfile
> method,
> could you share it?
>
>
> Regards
> --
> Lukasz
>
> http://www.linkedin.com/in/lukaszlenart
> http://jdn.pl/blog/416
> http://www.lenart.org.pl/
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Attachment:
user_186948.ezm (zipped)Hi,
That's strange, everything looks ok, and the last think is validation.xml
showProfile(); // I tried it with and without this line but if there
> is a validation error all fields in the jsps are empty
>
You should never do like this, if you want to call such method (which is
mapped as action), call action via redirect.
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart
http://jdn.pl/blog/416
http://www.lenart.org.pl/

Attachment:
user_186949.ezm (zipped)this is for example an extract of my ProfileAction-editProfile-validation.xml:
<field name="fullname">
<field-validator type="requiredstring">
<message>Please insert your first and last name!</message>
</field-validator>
<field-validator type="regex">
<param name="expression">[a-zA-ZäöüÄÖÜ]+ [a-zA-ZäöüÄÖÜ]+</param>
<message>Please insert both first and last name!</message>
</field-validator>
</field>
And this is the relevant part of my jsp:
<s:form method="POST" action="editProfile">
<table cellpadding="2" class="mainBody">
<tr>
<td><s:textfield name="username" cssClass="loginForm" key="form.prompt.username"/></td>
</tr>
<tr>
<td><s:textfield name="fullname" cssClass="loginForm" key="form.prompt.fullname"/></td>
</tr>
<tr>
<td><s:textfield name="email" cssClass="loginForm" key="form.prompt.email"/></td>
</tr>
<tr>
<td>
<s:submit cssClass="loginForm" key="button.saveChanges"/>
</td>
</tr>
</s:form>
the correct validation field error message is shown but the form is empty though the fields were filled before sending the form.
-------- Original-Nachricht --------
> Datum: Thu, 29 May 2008 14:48:30 +0200
> Von: "Lukasz Lenart" <lukasz.lenart@(protected)>
> An: "Struts Users Mailing List" <user@(protected)>
> Betreff: Re: XML Validation Problem
> Hi,
>
> That's strange, everything looks ok, and the last think is validation.xml
>
> showProfile(); // I tried it with and without this line but if
> there
> > is a validation error all fields in the jsps are empty
> >
>
> You should never do like this, if you want to call such method (which is
> mapped as action), call action via redirect.
>
>
> Regards
> --
> Lukasz
>
> http://www.linkedin.com/in/lukaszlenart
> http://jdn.pl/blog/416
> http://www.lenart.org.pl/
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Attachment:
user_186950.ezm (zipped)Hi,
>So you have a 2 page wizard and you want to save the first page of
>information in the session so the user can keep those values and edit the
>2nd page before committing all of the information to the database, right?
Yep, but I allow user to return to the first page if he has forgoted to enter something, or if he want to change that data.
>I am trying to understand some of what you are describing:
>
>* When you say "when I exit both page an execute method is called", what do
>you mean by exit? The user clicks a link on page 1 or page 2 that leaves
>the wizard? These links point to a central action that wipes the session
>and then moves on to another page? Define the "exit" process please.
O.K. I was confusing. When user left both of the pages, and when again he click on the link that start the wizard (i.e. show the first page). Yes, that link point to the MyAction class that run execute method where I clear session variable, if he entered some data earlier. He entered, that was saved to the database and he gone to some other part of the application.
>* The next part of that sentence says, "and my second page is called fruits
>from session are read again". You mean that the user returns to the wizard
>from somewhere else and goes directly to the 2nd page, without visiting Page
>1 first and clicking Next/Save/Whatever?
I say when user fill the first page and then the second page, I save that data in database and clear my session variable, but when he returns to the first page in the application later (from some other part of the application using link) the session variable is still there, it is not cleared !
--
Thx, Milan
dusty <dustin_pearce@(protected):
So you have a 2 page wizard and you want to save the first page of
information in the session so the user can keep those values and edit the
2nd page before committing all of the information to the database, right?
I am trying to understand some of what you are describing:
* When you say "when I exit both page an execute method is called", what do
you mean by exit? The user clicks a link on page 1 or page 2 that leaves
the wizard? These links point to a central action that wipes the session
and then moves on to another page? Define the "exit" process please.
* The next part of that sentence says, "and my second page is called fruits
from session are read again". You mean that the user returns to the wizard
from somewhere else and goes directly to the 2nd page, without visiting Page
1 first and clicking Next/Save/Whatever?
Milan Milanovic wrote:
>
> Hi,
>
> I have one action class and two pages. When first page is called, in its
> execute method I remove my session variable, like this:
>
> ServletActionContext.getContext().getSession().remove("fruits");
>
> and then when form from the first jsp page is submitted user enter details
> in the second form and there I save those changed to session, too:
>
> ServletActionContext.getContext().getSession().put("fruits", fruits);
>
> Of course, I first check if there is already fruits in session. I do this
> because some maybe want to go to first page to change something and then
> to go again to the second page to continue entering other info. But, when
> I exit both page an execute method is called (with above session remove
> method), and my second page is called fruits from session are read again -
> they are not removed ?
>
> --
> Thx in advance, Milan Milanovic
>
>
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_186951.ezm (zipped)I don't know, I suppose is because struts use a Map and I don't know
how it uses that. The users references change, but no the object.
I suppose that my problem is that somewhere I put a attribute in a
action, then due a action's are implemented as singleton, boila!, the
user reference is keeps in that attribute. I searching that now.
2008/5/28, Dave Newton <newton.dave@(protected)>:
> --- Laurie Harper <laurie@(protected):
> > Dave's question was: why, if there are only two users involved,
> > does each request log a different user instance?
>
> That was it :)
>
> But I was on the train, on my cel, and am, by nature, feck-deficient.
>
> Dave
>
> >
> > >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
> >
> > >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
> >
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
> >
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {user=org.gblx.entities.User@(protected),
> > >>> page=login.jsp}
> >
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {user=org.gblx.entities.User@(protected),
> > >>> req=org.gblx.entities.Request@(protected)}
> >
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
> >
> > Each request appears to have a different user.
> >
> > L.
> >
> > Juan Pablo Pizarro wrote:
> > > I didn't undesrtand your question. I use two users logged in
> > through
> > > two pc's. Then 1 user see the session of the other (the last legged
> > > see the session of the first).
> > >
> > >
> > >
> > > 2008/5/28, Dave Newton <newton.dave@(protected)>:
> > >> Why are all the session user variables different?
> > >>
> > >> I thought there were only two users logged in.
> > >>
> > >> Dave
> > >>
> > >> --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
> > >>
> > >>> The following are my logs (summary obviusly).
> > >>>
> > >>> 1.- The http session is the same, only change the Map of struts.
> > >>> 2.- The Map used as session for struts2 is changing through the
> > >>> invocations.
> > >>> 3.- The first 2 are the login with the user "1". The next 2 are
> > the
> > >>> login with user "2". The next log is a operation with user "1"
> > but it
> > >>> keeps the session of user "2"!!!. The last is the CTRL+F5 in the
> > >>> browser (in a separate PC) of user "1" and then, the http session
> > is
> > >>> right.
> > >>>
> > >>> Any idea?
> > >>>
> > >>> ...
> > >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> > >>> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> > >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
> > >>> ...
> > >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> > >>> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> > >>> INFO http-8182-1 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {LOGIN_ATTEMPT=yes, user=org.gblx.entities.User@(protected),
> > >>> page=login.jsp}
> > >>> ...
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > >>> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {page=index.jsp, user=org.gblx.entities.User@(protected)}
> > >>> ...
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > >>> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {user=org.gblx.entities.User@(protected),
> > >>> page=login.jsp}
> > >>> ...
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > >>> SET_HTTP_SESSION: 1F08BED6D2343E9DD5FF92860D6B5AE2
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {user=org.gblx.entities.User@(protected),
> > >>> req=org.gblx.entities.Request@(protected)}
> > >>> ...
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > >>> SET_HTTP_SESSION: 47DBA3C65D5111633FDEE12200214F2C
> > >>> INFO http-8182-2 org.gblx.action.common.CommonAction -
> > SET_SESSION:
> > >>> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
> > >>> ...
> > >>>
> > >>>
> > >>> 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> > >>>> I'm confused. I implemented SessionAware like:
> > >>>>
> > >>>> public class CommonAction extends ActionSupport implements
> > >>> SessionAware {
> > >>>> private static final long serialVersionUID = 1L;
> > >>>>
> > >>>> private static Logger logger =
> > >>> Logger.getLogger(CommonAction.class);
> > >>>> private Map session;
> > >>>>
> > >>>> public void setSession(Map session) {
> > >>>> logger.info("SET_SESSION: " + session);
> > >>>> this.session = session;
> > >>>> }
> > >>>>
> > >>>> public Map getSession() {
> > >>>> logger.info("GET_SESSION: " + session);
> > >>>> return session;
> > >>>> }
> > >>>>
> > >>>> }
> > >>>>
> > >>>> And all classes extends from it.
> > >>>>
> > >>>> I use
> > >>> ServletActionContext.getRequest().getSession().getAttribute(XXX);
> > >>>> (or set), and when I started to use the session with
> > SessionAware
> > >>>> implementation, I started to use this.getSession().XXX in the
> > >>> childs
> > >>>> of CommonAction.
> > >>>>
> > >>>> is that correct?
> > >>>>
> > >>>> As Milan, I see a diferent id in every invocation (see
> > >>>> logger.info("SET_SESSION..."); in CommonAction).
> > >>>>
> > >>>> Any suggestion/correction?
> > >>>>
> > >>>> I'm searching the log.. but for now, nothing new.
> > >>>>
> > >>>> JP
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>> 2008/5/28, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> > >>>>> But I opened in diferents pc.
> > >>>>>
> > >>>>> 2008/5/28, Dave Newton <newton.dave@(protected)>:
> > >>>>>> You don't really state explicitly what the problem is.
> > >>>>>>
> > >>>>>> As was said, different browsers handle session creation
> > >>> differently: a
> > >>>>>> new window does *not* necessarily mean you get a new session.
> > >>>>>>
> > >>>>>> Dave
> > >>>>>>
> > >>>>>> --- Juan Pablo Pizarro <juanpablo.pizarro@(protected):
> > >>>>>>
> > >>>>>>> Hi All.
> > >>>>>>>
> > >>>>>>> I've a problem with session scope. The problem is:
> > >>>>>>>
> > >>>>>>> 1.- I open a web browser and make a login with user 1.
> > >>>>>>> 2.- I open a web browser and make a login with user 2.
> > >>>>>>>
> > >>>>>>> so, in the web browser 2, my user name is "1". I pressed
> > >>> CTRL+F5 and
> > >>>>>>> refresh with the correct name ("2").
> > >>>>>>>
> > >>>>>>> I've implemented SessionAware (with get and set) in my
> > >>> CommonAction
> > >>>>>>> (all other actions extends from it).
> > >>>>>>>
> > >>>>>>> To login a user and check that the user is logged, I use a
> > >>>>>>> LoginInterceptor.
> > >>>>>>>
> > >>>>>>> I've surfed the web and I didn't find a real solution.
> > >>>>>>>
> > >>>>>>> Regards,
> > >>>>>>>
> > >>>>>>> JP
> > >>>>>>>
> > >>>>>>> 2008/5/28, Milan Milanovic <milanmilanovich@(protected)>:
> > >>>>>>>> Should my action class implement SessionAware ?
> > >>>>>>>>
> > >>>>>>>> Milan Milanovic <milanmilanovich@(protected)
> > >>> Martin,
> > >>>>>>>> thank you.
> > >>>>>>>>
> > >>>>>>>> My action package extends="struts-default", does this mean
> > >>> when I
> > >>>>>>> call
> > >>>>>>>> ActionContext.getContext().getSession() that I doesn't have
> > >>> access
> > >>>>>>> to session ?
> > >>>>>>>> It seems to me that every creates a new session for my
> > >>> action
> > >>>>>>> class, and at least two methods doesn't have access to the
> > >>> same
> > >>>>>>> session. How can I manage to share my variable through
> > >>> multiple jsp
> > >>>>>>> pages for one action class using the users session ?
> > >>>>>>>> --
> > >>>>>>>> Thx, Milan
> > >>>>>>>>
> > >>>>>>>> Martin wrote: Hello Milan-
> > >>>>>>>>
> > >>>>>>>> You can accomplish creation of HttpSession via
> > >>>>>>> CreateSessionInterceptor
> > >>
> >
> http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/CreateSessionInterceptor.html
> > >>>>>>>> (session parameters are available via a map which is is
> > >>> available
> > >>>>>>> via)
> > >>>>>>>> ActionContext.getContext().getSession()
> > >>>>>>>>
> > >>>>>>>> If you would be amenable to using a IOC container I would
> > >>> look at
> > >>>>>>>> implementing Springs SessionContextAutowiringInterceptor
> > >>>>>>>>
> > >>
> >
> http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/spring/interceptor/SessionContextAutowiringInterceptor.html
> > >>>>>>>> HTH
> > >>>>>>>> Martin
> > >>>>>>>>
> > >>>>>>>> ----- Original Message -----
> > >>>>>>>> From: "Milan Milanovic"
> > >>>>>>>> To: "Struts Users Mailing List"
> > >>>>>>>> Sent: Wednesday, May 28, 2008 11:08 AM
> > >>>>>>>> Subject: Re: [Struts 2] Session scope
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>> It seems that every request have its own scope ?!
> > >>>>>>>>>
> > >>>>>>>>> Milan Milanovic wrote: Hi,
> > >>>>>>>>>
> > >>>>>>>>> I have one action class and two pages. When first page is
> > >>> called,
> > >>>>>>> in its
> > >>>>>>>>> execute method I remove my session variable, like this:
> > >>>>>>>>>
> > >>>>>>>>>
> > >>> ServletActionContext.getContext().getSession().remove("fruits");
> > >>>>>>>>> and then when form from the first jsp page is submitted
> > >>> user
> > >>>>>>> enter details
> > >>>>>>>>> in the second form and there I save those changed to
> > >>> session,
> > >>>>>>> too:
> > >>>>>>>>>
> > >>> ServletActionContext.getContext().getSession().put("fruits",
> > >>>>>>> fruits);
> > >>>>>>>>> Of course, I first check if there is already fruits in
> > >>> session. I
> > >>>>>>> do this
> > >>>>>>>>> because some maybe want to go to first page to change
> > >>> something
> > >>>>>>> and then
> > >>>>>>>>> to go again to the second page to continue entering other
> > >>> info.
> > >>>>>>> But, when
> > >>>>>>>>> I exit both page an execute method is called (with above
> > >>> session
> > >>>>>>> remove
> > >>>>>>>>> method), and my second page is called fruits from session
> > >>> are
> > >>>>>>> read again -
> > >>>>>>>>> they are not removed ?
> > >>>>>>>>>
> > >>>>>>>>> --
> > >>>>>>>>> Thx in advance, Milan Milanovic
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>
> > >>>
> > ---------------------------------------------------------------------
> > >>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
> > >>>>>>> For additional commands, e-mail: user-help@(protected)
> > >>>>>>>
> > >>>>>>>
> > >>>>>>
> > >>>>>>
> > >>>
> > ---------------------------------------------------------------------
> > >>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
> > >>>>>> For additional commands, e-mail: user-help@(protected)
> > >>>>>>
> > >>>>>>
> > >>>
> > ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: user-unsubscribe@(protected)
> > >>> For additional commands, e-mail: user-help@(protected)
> > >>>
> > >>>
> > >>
> > >>
> > ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> > >> For additional commands, e-mail: user-help@(protected)
> > >>
> > >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186952.ezm (zipped)Hi Dave,
>There is only one session per conversation. If you're using the same
>session (i.e., same browser window/tab, etc.) then there shouldn't be
>any issues.
I'm using the same browser and tab, I'm just testing application by using links in it (without logging out).
>I'd focus first on your implementation logic. You can also check the
>session ID to make sure they're the same session--if they're not,
>something's wrong.
O.K. I'll check this.
--
Thx, Milan
Dave Newton <newton.dave@(protected)
session (i.e., same browser window/tab, etc.) then there shouldn't be
any issues.
I'd focus first on your implementation logic. You can also check the
session ID to make sure they're the same session--if they're not,
something's wrong.
Dave
--- Milan Milanovic wrote:
> Should my action class implement SessionAware ?
>
> Milan Milanovic wrote: Hi Martin,
>
> thank you.
>
> My action package extends="struts-default", does this mean when I
> call
> ActionContext.getContext().getSession() that I doesn't have access to
> session ?
>
> It seems to me that every creates a new session for my action class,
> and at least two methods doesn't have access to the same session. How
> can I manage to share my variable through multiple jsp pages for one
> action class using the users session ?
>
> --
> Thx, Milan
>
> Martin wrote: Hello Milan-
>
> You can accomplish creation of HttpSession via
> CreateSessionInterceptor
>
http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/CreateSessionInterceptor.html
>
> (session parameters are available via a map which is is available
> via)
> ActionContext.getContext().getSession()
>
> If you would be amenable to using a IOC container I would look at
> implementing Springs SessionContextAutowiringInterceptor
>
http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/spring/interceptor/SessionContextAutowiringInterceptor.html
>
> HTH
> Martin
>
> ----- Original Message -----
> From: "Milan Milanovic"
> To: "Struts Users Mailing List"
> Sent: Wednesday, May 28, 2008 11:08 AM
> Subject: Re: [Struts 2] Session scope
>
>
> > It seems that every request have its own scope ?!
> >
> > Milan Milanovic wrote: Hi,
> >
> > I have one action class and two pages. When first page is called,
> in its
> > execute method I remove my session variable, like this:
> >
> > ServletActionContext.getContext().getSession().remove("fruits");
> >
> > and then when form from the first jsp page is submitted user enter
> details
> > in the second form and there I save those changed to session, too:
> >
> > ServletActionContext.getContext().getSession().put("fruits",
> fruits);
> >
> > Of course, I first check if there is already fruits in session. I
> do this
> > because some maybe want to go to first page to change something and
> then
> > to go again to the second page to continue entering other info.
> But, when
> > I exit both page an execute method is called (with above session
> remove
> > method), and my second page is called fruits from session are read
> again -
> > they are not removed ?
> >
> > --
> > Thx in advance, Milan Milanovic
> >
> >
> >
> >
> >
> >
>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_186953.ezm (zipped)when your data is safely persisted to your DB I would call
session.invalidate() to 'clear' the session
dave has posted the struts code to accomplish this..
// Code fragment from class implementing SessionAware containing the
// session map in a instance variable "session". Attempting to invalidate
// an already-invalid session will result in an IllegalStateException.
if (session instanceof
org.apache.struts2.dispatcher.SessionMap) {
try {
((
org.apache.struts2.dispatcher.SessionMap) session).invalidate();
} catch (IllegalStateException e) {
logger.error(msg, e);
}
}http://struts.apache.org/2.0.11.1/docs/how-do-we-get-invalidate-the-session.html
FWIW
Martin
----- Original Message -----
From: "Milan Milanovic" <milanmilanovich@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Thursday, May 29, 2008 9:36 AM
Subject: Re: [Struts 2] Session scope
> Hi Dave,
>
>>There is only one session per conversation. If you're using the same
>>session (i.e., same browser window/tab, etc.) then there shouldn't be
>>any issues.
>
> I'm using the same browser and tab, I'm just testing application by using
> links in it (without logging out).
>
>>I'd focus first on your implementation logic. You can also check the
>>session ID to make sure they're the same session--if they're not,
>>something's wrong.
>
> O.K. I'll check this.
>
> --
> Thx, Milan
>
> Dave Newton <newton.dave@(protected)
> conversation. If you're using the same
> session (i.e., same browser window/tab, etc.) then there shouldn't be
> any issues.
>
> I'd focus first on your implementation logic. You can also check the
> session ID to make sure they're the same session--if they're not,
> something's wrong.
>
> Dave
>
> --- Milan Milanovic wrote:
>
>> Should my action class implement SessionAware ?
>>
>> Milan Milanovic wrote: Hi Martin,
>>
>> thank you.
>>
>> My action package extends="struts-default", does this mean when I
>> call
>> ActionContext.getContext().getSession() that I doesn't have access to
>> session ?
>>
>> It seems to me that every creates a new session for my action class,
>> and at least two methods doesn't have access to the same session. How
>> can I manage to share my variable through multiple jsp pages for one
>> action class using the users session ?
>>
>> --
>> Thx, Milan
>>
>> Martin wrote: Hello Milan-
>>
>> You can accomplish creation of HttpSession via
>> CreateSessionInterceptor
>>
> http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/CreateSessionInterceptor.html
>>
>> (session parameters are available via a map which is is available
>> via)
>> ActionContext.getContext().getSession()
>>
>> If you would be amenable to using a IOC container I would look at
>> implementing Springs SessionContextAutowiringInterceptor
>>
> http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/spring/interceptor/SessionContextAutowiringInterceptor.html
>>
>> HTH
>> Martin
>>
>> ----- Original Message -----
>> From: "Milan Milanovic"
>> To: "Struts Users Mailing List"
>> Sent: Wednesday, May 28, 2008 11:08 AM
>> Subject: Re: [Struts 2] Session scope
>>
>>
>> > It seems that every request have its own scope ?!
>> >
>> > Milan Milanovic wrote: Hi,
>> >
>> > I have one action class and two pages. When first page is called,
>> in its
>> > execute method I remove my session variable, like this:
>> >
>> > ServletActionContext.getContext().getSession().remove("fruits");
>> >
>> > and then when form from the first jsp page is submitted user enter
>> details
>> > in the second form and there I save those changed to session, too:
>> >
>> > ServletActionContext.getContext().getSession().put("fruits",
>> fruits);
>> >
>> > Of course, I first check if there is already fruits in session. I
>> do this
>> > because some maybe want to go to first page to change something and
>> then
>> > to go again to the second page to continue entering other info.
>> But, when
>> > I exit both page an execute method is called (with above session
>> remove
>> > method), and my second page is called fruits from session are read
>> again -
>> > they are not removed ?
>> >
>> > --
>> > Thx in advance, Milan Milanovic
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>