Author Login
Post Reply
user Digest 30 May 2008 23:57:30 -0000 Issue 8062
Topics (messages 187044 through 187063):
ApplicationResources.properties accessed by Javascript function: is it possible?
187044 by: cacodemon79
Re: PRe Execute
187045 by: Martin
Struts 1 Validation: One field, multiple datatypes
187046 by: tidalwav1
187054 by: Laurie Harper
File download problem in IE7 (struts 2)
187047 by: Gustavo Felisberto
[Struts 2] s:file with ajax validation
187048 by: thinair
Re: Datetimepicker can't be rendered with remote access
187049 by: Laurie Harper
Getting a s:select selected value
187050 by: piltrafeta
Re: Struts 2 Performance
187051 by: Laurie Harper
Re: Issue with ForwardAction when migrating from Struts 1.2.9 to 1.3.9
187052 by: Adam Gordon
Lookup Spring Context
187053 by: Juan Pablo Pizarro
187057 by: Lukasz Lenart
187058 by: Juan Pablo Pizarro
Re: <s:password> Problem
187055 by: Raghu Kasturi
Interceptor problem - Struts 2.0.11.1
187056 by: Tom Ivers
Re: Dojo and TabbedPanel in Internet Explorer 7
187059 by: Jay Bose
187061 by: Jay Bose
JSF Page not rendering in Ajax tabbed panel
187060 by: manisha5
Re: Are sessions confused?
187062 by: Juan Pablo Pizarro
187063 by: Juan Pablo Pizarro
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_187044.ezm (zipped)
Hi to all.
I'm a newbie on Struts framework. I'm developing a web site with Struts 1.3,
Tomcat 6.0, MySQL 5.0 and Eclipse.
I have stored in the ApplicationResources.properties the strings (labels,
values, ...) of my site.
I'm wondering if it's possible to access this file by a Javascript function
as I would like to use the same strings without be obliged to redefine them
in Javascript functions.
Is there a special functionality (method) to do so?
I have tought to the following alternatives:
1) to store the ApplicationResources.properties keys in hidden fields so
that i can access them in javascript functions;
2) to pass these strings as parameters when calling a javascript function
Can you give me any suggestion on the matter?
Thanks in advance.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_187045.ezm (zipped)Frans
The interceptors execute before or after the action is called depending on
how the stack is configured
take a look at
http://struts.apache.org/2.0.6/docs/interceptors.html
HTH
Martin
----- Original Message -----
From: "Jim Kiley" <jhkiley@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Friday, May 30, 2008 10:38 AM
Subject: Re: PRe Execute
> Hi Frans,
>
> Is this something you could do with the prepare() method of the Preparable
> interface? Or is the problem more complex than that?
>
> jk
>
> On Fri, May 30, 2008 at 10:29 AM, Frans Thamura <frans@(protected)>
> wrote:
>
>> hi there
>>
>> i want to implement a execute before execute, we call it pre-execute
>>
>> any idea to implement this?
>>
>> i want to query to my Hibernate POJO to get the first execution
>>
>> and if the execution success, the second execute can be run, if not,
>> the execption will show , said that the execute have return something
>>
>> F
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>

Attachment:
user_187046.ezm (zipped)
Hello all,
I'm having issues with form validation inside struts 1.2.4. I'm very new to
Struts in general, so I'll ask this question as simply as possible to begin
with, and will provide more code/details if needed to help answer the
question.
Basically, I'm trying to write a validations.xml file that will be used for
server-side form validation. Among other components, the form has an input
text box and select dropdown menu. Let's say things are laid out thusly:
---
[ Dropdown ]
--> Name
--> Age
[ search box ]
---
I'd like to be able to validate the user's input into the search box for
different datatypes depending on what's selected in the dropdown box. For
example, if the user typed 'John' in the box if 'Age' was selected, that
input should be invalid, but 'John' should be accepted/valid input if 'Name'
is selected.
Is this possible with Struts 1? All of the tutorials I've looked at so far
have seemed to mostly deal with validating forms that will always have one
type of data in them (for example, 'Ensure that only valid email addresses
were typed into this text box', etc.)
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_187054.ezm (zipped)tidalwav1 wrote:
> Hello all,
>
> I'm having issues with form validation inside struts 1.2.4. I'm very new to
> Struts in general, so I'll ask this question as simply as possible to begin
> with, and will provide more code/details if needed to help answer the
> question.
>
> Basically, I'm trying to write a validations.xml file that will be used for
> server-side form validation. Among other components, the form has an input
> text box and select dropdown menu. Let's say things are laid out thusly:
>
> ---
>
> [ Dropdown ]
> --> Name
> --> Age
>
> [ search box ]
>
> ---
>
> I'd like to be able to validate the user's input into the search box for
> different datatypes depending on what's selected in the dropdown box. For
> example, if the user typed 'John' in the box if 'Age' was selected, that
> input should be invalid, but 'John' should be accepted/valid input if 'Name'
> is selected.
>
> Is this possible with Struts 1? All of the tutorials I've looked at so far
> have seemed to mostly deal with validating forms that will always have one
> type of data in them (for example, 'Ensure that only valid email addresses
> were typed into this text box', etc.)
I'm afraid that's beyond what you can express with declarative
validation. You'll need to implement constraints like that in Java (i.e.
in you validate() method).
L.

Attachment:
user_187047.ezm (zipped)Hello ALL,
I'm generating an Excel file in runtime and sending it to the client.I'm
using struts 2.0.11.
In struts.xml I have:
<action name="ExportExcelFile" class="my.Class">
<result name="success" type="stream">
<param name="contentType">application/vnd.ms-excel</param>
<param name="inputName">excelInputStream</param>
<param name="contentDisposition">filename="contacts.xls"</param>
<param name="bufferSize">4096</param>
</result>
</action>
In the class I have:
public InputStream getExcelInputStream() {
return new ByteArrayInputStream(exportExcelFile().toByteArray());
}
private ByteArrayOutputStream exportExcelFile() {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
WritableWorkbook workbook = Workbook.createWorkbook(bos);
WritableSheet sheet = workbook.createSheet("Contactos", 0);
WritableCellFormat textFormat = new
WritableCellFormat(NumberFormats.TEXT);
//ADD STUFF TO SHEET
workbook.write();
workbook.close();
} catch (RowsExceededException e) {
} catch (WriteException e) {
} catch (IOException e) {
}
return bos;
}
If I use IE7 and I choose to save the file to disk and then open it with
Excel 2007 all works ok. If I choose to open the file instead of saving
it I get:
1 - an error in Tomcat: ERROR [http-8080-Processor21]
(CommonsLogger.java:24) - Can not find a
java.io.InputStream with the
name [excelInputStream] in the invocation stack. Check the <param
name="inputName"> tag specified for this action.
2- A message from excel saying that the file I'm trying to open
ExportExcelFile (and not the real name of the file) is in a diferent
format than the extension. If i choose to open it the file is ok
3- IE7 hard locks until I say yes/no in excel to open the file
I'm accessing tomcat via HTTP
Any help will be much appreciated.
--
Gustavo Felisberto.
WIT-Software, Lda
Coimbra (Portugal), San Jose (California)
Phone: +351239801030
Web: http://www.wit-software.com

Attachment:
signature.asc (zipped)
Attachment:
user_187048.ezm (zipped)
hello,
My Problem is the following, I have a form :
1. that use @RequiredStringValidator for textfield "title"
2. with a s:file included in the form name="upload"
When I put the attribute validate="true" (to enable ajax validation), I have
got the following error on the field file field : invalid field value for
field "upload".
I put ONLY validation annotation in front of the setTitle. I didn't put any
validation on setUpload
When I submit with validate="false" => validation works properly.
My jsp part :
<s:form action="soumissionCameraReady" method="post"
enctype="multipart/form-data" theme="ajax" validate="true">
<s:textfield name="title" key="auteurs.titrepapier" />
<s:file name="upload" key="auteurFinalCamera.uploadcameraready"/>
</s:form>
Does' any body have the same issue or a solution ?
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_187049.ezm (zipped)Vstar wrote:
> I'm using struts 2.0.11.1 under japanese system.now i meet a problem.
> when i access by the url like http://localhost/xxx,Drop-down datetimepicker
> could be rendered without any problem.But when I try to do it by the url
> like http://192.168.1.xxx/,the datetimepicker can't be rendered,and without
> any error infomation.
Struts doesn't care about the host name, so I would suspect a container
configuration or network issue. The way to figure out what's happening
is to watch what goes over the wire, though -- i.e. use a packet sniffer
like tcpflow or Ethereal to watch the HTTP communication.
> BTW:Does anyone know when the 2.1 GA version will be released?Is there any
> plan about it?
It'll happen when it happens. Struts is developed by volunteers and
progress occurs as people have time to contribute.
Anyone interested in forthcoming releases should follow the dev list.
All development discussions take place on the dev list, and anyone who
follows the dev list knows as much as the rest of us :)
A good way to check-in without bothering with another list is through
the nabble forum
* http://www.nabble.com/Struts---Dev-f205.html
L.

Attachment:
user_187050.ezm (zipped)
Hi ,
i have a jsp with some forms like this :
<s:form action="acceptUser" method="post">
<tr>
<td>
<s:a href="#" onclick="accept(%{#users.value._id})"> Accept </s:a>
</td>
<td><s:url id="url" action="rejectUser" includeParams="none" >
<s:param name="idUser" value="%{#users.value._id}" />
</s:url>
<s:a href="%{url}"> Reject </s:a>
<!--<s:form action="rejectUser" method="post">
<s:a href="#" onclick="onLinkClick(%{#users.value._id})"> Reject </s:a>
</s:form>-->
</td>
<td><s:property value="#users.value._name"/></td>
<td><s:property value="#users.value._username"/></td>
<td><s:select name="maxCoord"
headerValue="" headerKey="" list="#session.coordValues"
size="1" multiple="false" />
</td>
</tr>
<s:hidden name="idUser"/>
</s:form>
and in my JavaActionClass i have a attribute with the same name as the
select element :
private String maxCoord;
public String accept() {
print(maxCoord);
return SUCCESS;
}
public String getMaxCoord() {
return maxCoord;
}
public void setMaxCoord(String maxCoord) {
this.maxCoord = maxCoord;
}
when i'm printing the maxCoord value, i only obtanins the correct value if i
select the first form in my jsp class... if i chose any of the other i get
an empty string.
Can you halp me with this please ?
Thanks
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_187051.ezm (zipped)Richard Sayre wrote:
> Hi,
>
> I have a few questions regarding performance in Struts 2.
>
> First of all we are using 2.0.9. I am trying to get the source to fix
> the following memory leaks :
> https://issues.apache.org/struts/browse/WW-2167 but I can't find the
> 2.0.9 build. Can anyone point me to the source for that build?
http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_9/
> We have several Struts 2 applications hosted on a Tomcat server. We
> have a copy of our Struts libraries in each of the applications
> WEB-INF folder. Is there a better way to have this set up to save
> memory? I know this is more of a tomcat question but I figured some
> one here might have some suggestions.
As Giovanni said, you can put the struts jars (and dependencies) into a
shared lib folder. You don't need to introduce Tomcat instancing to do
this, though. I should also point out that this isn't a tested
configuration, so you will want to test thoroughly.
> Also, when I run Firebug to check the loading time of my page it seems
> that alot of time is spent downloading Dojo scripts. I am only using
> the Ajax and the Tabbed Panel provided by dojo, nothing else. Is
> there a way to configure dojo to only use what is nessessary? I did
> see a post on this list a while ago that involved extracting the files
> and rewriting the dojo require file, is this still the best way to
> increase dojo performance?
Yes; you can improve the Dojo multiple-http-requests issue by creating a
custom Dojo build, which will bundle everything you use into dojo.js.
You will then see only one request (for dojo.js) in place of the
multiple requests you have now. See the Dojo documentation for how to
create a custom profile/build, or see below.
> I was also getting a "script is busy - cancel or continue" in IE and
> Firefox. This was on a page that has a alot of HTML divs. I finally
> narrowed it down to some dojo that was running that seemed to be
> looping through every element on the page after it loaded. Does
> anyone have any insight into this behavior? Why is it needed?
By default, Dojo scans the entire page looking for widgets to
instantiate (i.e. looking for tags with a dojoType attribute). For pages
with a lot of markup, that can be quite costly. There's a Dojo
configuration switch to turn that off, but then you need to add code to
bootstrap the widgets.
> Does the latest version 2.0.11.1 use a different version of dojo?
> Does it perform better? Would there be alot of code changes to change
> from 0.4 to the version that the current build uses?
2.0.11.1 doesn't offer much improvement, but 2.1.2 (beta) does. 2.1.2
comes with a custom Dojo build pre-baked and with widget scanning turned
off (it also handles the widget bootstrapping for you). It's certainly
more work to upgrade to 2.1.2 than 2.0.11.1 but, given your concerns, it
is probably worth it.
L.

Attachment:
user_187052.ezm (zipped)Mark-
Thanks for your reply. I neglected to mention that /reports was a
module and /reports/meeting was a (separate) module. The solution you
mentioned didn't work verbatim, but reading the DTD section again the
phrase 'module-secific' jumped out at me so we tried /meeting/Index.do
as we were technically already in the /reports module and voila! It worked.
Thanks for the nudge in the right direction.
-adam
Mark Shifman wrote:
> Hi:
> This doesn't completely answer your question but it should work.
> if you look at the dtd for struts-config_1_3.dtd
> http://struts.apache.org/1.3.8/struts-core/dtddoc/struts-config_1_3.dtd.html
> or
> http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_3.dtd?view=markup
>
>> forward Module-relative path of the servlet or other resource that will process this request,
> instead of the Action class specified by "type". The path WILL NOT be
> processed through the "forwardPattern"
> attribute that is configured on the "controller" element for this
> module. Exactly one of "forward", "include", or "type" must be specified.
>
> <action path="/Index"
> forward="/reports/meeting/Index.do"/>
>
> Setting forward="/reports/meeting/Index.do" as an action attribute
> without any type should do what you want.
>
> mas
>
> Adam Gordon wrote:
>> We've successfully migrated our web application from Struts 1.2.9 to
>> 1.3.9 except for one small issue with ForwardAction. It appears that
>> given the following action definition,
>>
>
>> 1.3.9 handles the parameter value differently than 1.2.9. I've noticed
>> that 1.3.9 is much more strict about making sure stuff complies with the
>> stuff it's supposed to comply with so in that regard, perhaps there's an
>> issue with specifying an action URI as a value of a parameter attribute
>> in 1.3.9, but we don't know for sure.
>>
>> Ultimately, the error we're getting is a Tomcat 404 for the original URL
>> in 1.3.9 (and an invalid path Struts error in the logs) but not in
>> 1.2.9. Our configuration in our web.xml hasn't changed w.r.t. module
>> configuration or security constraints. As a workaround, we've replaced
>> ForwardAction with a custom action that simply does a
>> response.sendRedirect(...) to the right URI. It works, but I consider
>> it a hack because it doesn't fix the root problem.
>>
>> Any help would be appreciated. Thanks.
>>
>> -- adam
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
>

Attachment:
user_187053.ezm (zipped)Hi All,
I'm using spring (latest version) wired with struts (2.0.11), witch is
the correct way to get the applicationContext from the actions?
part of my applicationContext.
...
bean id="CommandResultService"
class="org.gblx.services.CommandResultServiceImpl" singleton="true"
lazy-init="default" autowire="default" dependency-check="default" />
<bean id="ActivityService"
class="org.gblx.services.ActivityServiceImpl" singleton="true"
lazy-init="default" autowire="default" dependency-check="default" />
<bean id="AttachmentService"
class="org.gblx.services.AttachmentServiceImpl" singleton="true"
lazy-init="default" autowire="default" dependency-check="default" />
- <!-- ******************** ACTIONS ***********************
-->
<bean id="LoginAction" class="org.gblx.action.common.LoginAction"
singleton="false" lazy-init="default" autowire="default"
dependency-check="default" />
<bean id="Welcome" class="org.gblx.action.common.CommonAction"
singleton="false" lazy-init="default" autowire="default"
dependency-check="default" />
</beans>
part of my struts conf.
...
<action name="Login_*" method="{1}"
class="org.gblx.action.common.LoginAction">
<result name="input">/common/Login.jsp</result>
<result type="redirect-action">Menu</result>
</action>
<action name="Welcome">
<result>/common/Welcome.jsp</result>
</action>
<action name="*" class="org.gblx.action.common.CommonSupport">
<result>/common/{1}.jsp</result>
</action>
I'm lazy with spring and struts. I red the tutorials, but there are
several ways.. I suppose there are some better than others.
And, Witch is the base tutorial for spring + struts 2 + jpa? I red and tried:
http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html
and roseindia page (for struts).
There are other "common" tutorial?
Regards,
JP

Attachment:
user_187057.ezm (zipped)>
> <bean id="LoginAction" class="org.gblx.action.common.LoginAction"
> singleton="false" lazy-init="default" autowire="default"
> dependency-check="default" />
>
> <action name="Login_*" method="{1}"
> class="org.gblx.action.common.LoginAction">
> <result name="input">/common/Login.jsp</result>
> <result type="redirect-action">Menu</result>
> </action>
>
Use class="LoginAction" instead as you defined in applicationContext.xml, if
you want to use some of the services you defined in applicationContext.xml,
just add setter for that service in action class and add <property name ref>
to applicationContext.xml for given action class.
<bean id="LoginAction" class="org.gblx.action.common.LoginAction"
singleton="false" >
<property name="activityService" ref="ActivityService"/>
</bean>
and instead ActivityService use activityService for id of your definition in
xml file.
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_187058.ezm (zipped)Thanks!
Juan Pablo.
2008/5/30 Lukasz Lenart <lukasz.lenart@(protected)>:
>>
>> <bean id="LoginAction" class="org.gblx.action.common.LoginAction"
>> singleton="false" lazy-init="default" autowire="default"
>> dependency-check="default" />
>>
>
>
>> <action name="Login_*" method="{1}"
>> class="org.gblx.action.common.LoginAction">
>> <result name="input">/common/Login.jsp</result>
>> <result type="redirect-action">Menu</result>
>> </action>
>>
>
> Use class="LoginAction" instead as you defined in applicationContext.xml, if
> you want to use some of the services you defined in applicationContext.xml,
> just add setter for that service in action class and add <property name ref>
> to applicationContext.xml for given action class.
>
>
> <bean id="LoginAction" class="org.gblx.action.common.LoginAction"
> singleton="false" >
> <property name="activityService" ref="ActivityService"/>
> </bean>
>
> and instead ActivityService use activityService for id of your definition in
> xml file.
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>

Attachment:
user_187055.ezm (zipped)
Hi,
Try this:
By default s:password tag don't shows value of your password, you can
change such behaviour by adding attribute showPassword=true, but you
should consider security issue.
Thanks,
Raghu
Himanshu Rathore wrote:
>
> Hi,
>
> The data set in password field is not displayed on jsp. In my bean, the
> value is set properly after retrieved from db but when page is displayed
> I'm
> not able to see it.
>
> May be this is security feature but it might not be acceptable by client.
> Is
> there way around?
>
> --
> --
> Regards,
> Himanshu Rathore
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_187056.ezm (zipped)I am having a strange issue when utilizing a 'SecureInterceptor' I created.
I use this interceptor to ensure the user is logged in and if not, I send
them to the login page. My struts.xml utilizes this interceptor as follows:
<struts>
<package name="default" extends="struts-default">
<interceptors>
<interceptor name="secureInterceptor"
class="com.a.core.struts2.interceptor.SecureInterceptor" />
</interceptors>
<action name="logon" class="com.a.core.struts2.action.LoginAction">
<result name="error">jsp/testing/loginfailure.jsp</result>
<result name="success">jsp/template/main.jsp</result>
</action>
<action name="Site" class="com.b.struts2.action.SiteAction">
<interceptor-ref name="secureInterceptor"/>
<result name="success">jsp/testing/sitesuccess.jsp</result>
<result name="login">jsp/login.jsp</result>
</action>
</package>
</struts>
Although my LoginAction properly calls the 'getMethods' when submitting a
form in login.jsp, the SiteAction one does not (both utilizing s:form tags
on their respective Action). If I remove the interceptor from the Site
definition it works 'properly'. Has anyone else seen this or proven it
worked ok as I explained? Has anyone had the same or a similar problem?
login.jsp (clip)
<s:form action="logon">
<s:textfield label="User Name" name="username"/>
<s:password label="Password" name="password" />
<s:submit/>
</s:form>
site.jsp (clip)
<s:form action="Site">
<s:hidden name="id" />
<s:textfield disabled="true" key="entity.code" name="code" />
<s:textfield key="site.friendlyname" name="friendlyName" />
<s:textfield key="entity.address1" name="address1" />
<s:textfield key="entity.address2" name="address2" />
<s:textfield key="entity.city" name="city" />
<s:textfield key="entity.state" name="state" />
<s:textfield key="entity.postalCode" name="postalCode" />
<s:textfield key="entity.country" name="country" />
<s:submit/>
</s:form>
I am sort of stumped and hope I am not doing something silly.
Thanks,
Tom

Attachment:
user_187059.ezm (zipped)Owen, I wish that was it, but the same thing happens over and over.
In other words, if I simply request the page/action, I get the debug error statements.
And if I immediately force a refresh, I get the desired page/response.
What have you've done in the past to resolve this issue?
--- Owen Berry <owen.berry@(protected):
> Does it work after that forced refresh? Maybe you had a previous
> version of the page cached in the browser and it wasn't loading the
> scripts correctly. I've had a hard time convincing IE and Opera to
> relinquish it's cache in the past.
>

Attachment:
user_187061.ezm (zipped)Owen, thanks for your response!
I did some more tweaking based on your original comment, and got it working.
Specifically, I have some javascript files in a jsp fragment being loaded by sitemesh.
Long story short, I had to make sure they all existed in one fragment. Which is why the
forced refresh showed up well, but fragments IE thought it saw before did not load
properly.
--- Jay Bose <digi9ten@(protected):
> Owen, I wish that was it, but the same thing happens over and over.
>
> In other words, if I simply request the page/action, I get the debug error statements.
> And if I immediately force a refresh, I get the desired page/response.
>
> What have you've done in the past to resolve this issue?
>
>
> --- Owen Berry <owen.berry@(protected):
>
> > Does it work after that forced refresh? Maybe you had a previous
> > version of the page cached in the browser and it wasn't loading the
> > scripts correctly. I've had a hard time convincing IE and Opera to
> > relinquish it's cache in the past.

Attachment:
user_187060.ezm (zipped)
I am using struts2 with Ajax.
I have ajax tabbed panel. In one of the tab I want to load JSF page.
I dont get any exception but I dont see JSF page being rendered.
I get error: Error mypage.jsf: /myweb/mypage.jsf (200 OK)
Please help!!!
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_187062.ezm (zipped)I've problems with sessions, but, is it an issue?.
The erratic behavior is this:
I opened a firefox and logged with user "1" (the login only put in
session a random number, the action no get a user from somewhere). The
page showed 28.
I opened a IE7 and logged with user "2". Showed 84.
I pressed CTRL+F5 (update the page and cache) in the firefox and it
updated the number to 84.
I repeat the experince in dev1 env. and in my workstation, and today,
in my computer (home).
To by sure, I used the struts2-blank-2.0.11.1.war expanded, obviusly,
with the minimal modifications to show the number, and
apache-tomcat-5.5.26 (and 6.X too).
I based my app on http://struts.apache.org/2.x/docs/bootstrap.html
Please, I need to know if the problem is an issue, is a bag strategy
to access to session, is a bag conf or other.
Any idea?
Best Regards,
Juan Pablo
===============================
===============================
The LoginAction
===============================
public String execute() throws Exception {
// This access way is from:
// http://struts.apache.org/2.x/docs/accessing-application-session-request-objects.html
Map session = (Map) ActionContext.getContext().get("session");
session.put("user", (int) (Math.random() * 100));
return SUCCESS;
}// excecute
Login Page
===============================
<%@(protected)" %>
<%@(protected)" %>
...
<s:form action="Login">
<s:textfield key="username"/>
<s:password key="password" />
<s:submit/>
</s:form>
...
Struts.xml
===============================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<include file="common.xml"/>
</struts>
Common.xml
===============================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="common" namespace="/common" extends="struts-default">
<action name="Login_*" method="{1}"
class="org.gblx.action.common.LoginAction">
<result name="input">/common/Login.jsp</result>
<result type="redirect-action">Menu</result>
</action>
<action name="Welcome">
<result>/common/Welcome.jsp</result>
</action>
<action name="*" class="org.gblx.action.common.CommonSupport">
<result>/common/{1}.jsp</result>
</action>
</package>
</struts>
Web.xml
===============================
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>...</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher </filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
2008/5/30 Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> Gracias Martin!
>
> These are my logs.
>
> I put a message in the session, and.. the session is copied or is the
> same!!. I don't know how avoid that.
>
> I use the same web browser, and other to make the tests.
>
> I'm looking for a similar thread.. but nothing yet.
>
> Juan Pablo.
>
> ------------------------------------------------
>
> INFO [http-8080-Processor23] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
> INFO [http-8080-Processor23] (CommonAction.java:48) -
> GET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:49) - GET_SESSION:
> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
> INFO [http-8080-Processor23] (WelcomeAction.java:27) - USER: 1
> INFO [http-8080-Processor24] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor24] (CommonAction.java:40) - SET_SESSION:
> {req=org.gblx.entities.Request@(protected)}
> INFO [http-8080-Processor24] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor24] (CommonAction.java:40) - SET_SESSION:
> {req=org.gblx.entities.Request@(protected),
> page=login.jsp}
> INFO [http-8080-Processor24] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor24] (CommonAction.java:40) - SET_SESSION:
> {req=org.gblx.entities.Request@(protected),
> message=Error!, the user isn't active., page=login.jsp}
> INFO [http-8080-Processor23] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
> {req=org.gblx.entities.Request@(protected),
> user=org.gblx.entities.User@(protected)
> active.}
> INFO [http-8080-Processor23] (CommonAction.java:48) -
> GET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:49) - GET_SESSION:
> {req=org.gblx.entities.Request@(protected),
> user=org.gblx.entities.User@(protected)
> active.}
> INFO [http-8080-Processor23] (WelcomeAction.java:27) - USER: jpp
> INFO [http-8080-Processor23] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
> {page=index.jsp, req=org.gblx.entities.Request@(protected),
> message=Error!, the user isn't active.}
> INFO [http-8080-Processor23] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
> {req=org.gblx.entities.Request@(protected),
> message=Error!, the user isn't active., page=login.jsp}
> INFO [http-8080-Processor23] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
> {page=menu.jsp, req=org.gblx.entities.Request@(protected)!,
> the user isn't active., user=org.gblx.entities.User@(protected)}
> INFO [http-8080-Processor23] (CommonAction.java:48) -
> GET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:49) - GET_SESSION:
> {page=menu.jsp, req=org.gblx.entities.Request@(protected)!,
> the user isn't active., user=org.gblx.entities.User@(protected)}
> INFO [http-8080-Processor23] (WelcomeAction.java:27) - USER: 1
> INFO [http-8080-Processor23] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
> {page=index.jsp, req=org.gblx.entities.Request@(protected),
> message=Error!, the user isn't active.}
> INFO [http-8080-Processor23] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
> {LOGIN_ATTEMPT=yes, req=org.gblx.entities.Request@(protected),
> message=Error!, the user isn't active., page=login.jsp}
> INFO [http-8080-Processor24] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor24] (CommonAction.java:40) - SET_SESSION:
> {page=menu.jsp, user=org.gblx.entities.User@(protected),
> req=org.gblx.entities.Request@(protected)
> active.}
> INFO [http-8080-Processor24] (CommonAction.java:48) -
> GET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor24] (CommonAction.java:49) - GET_SESSION:
> {page=menu.jsp, user=org.gblx.entities.User@(protected),
> req=org.gblx.entities.Request@(protected)
> active.}
> INFO [http-8080-Processor24] (WelcomeAction.java:27) - USER: jpp
> INFO [http-8080-Processor23] (CommonAction.java:39) -
> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
> {req=org.gblx.entities.Request@(protected),
> user=org.gblx.entities.User@(protected)!,
> the user isn't active.}
>
>
>
>
> 2008/5/29, Martin <mgainty@(protected)>:
>> Hola!
>>
>> so if you execute the sessions separately
>> 1st run
>> index.jsp SET_HTTP_SESSION=
>> login.jsp SET_HTTP_SESSION=
>> menu.jsp SET_HTTP_SESSION=
>> logout.jspSET_HTTP_SESSION=
>>
>> 2nd run
>> index.jsp SET_HTTP_SESSION=
>> login.jsp SET_HTTP_SESSION=
>> menu.jsp SET_HTTP_SESSION=
>> logout.jsp SET_HTTP_SESSION=
>>
>> once you are able to verify the SessionIDs for session1
>> and different for session2
>> then run them together and compare the results..
>>
>> let me know if you have any questions
>>
>> Saludos Cordiales!
>> Martin
>> ----- Original Message ----- From: "Juan Pablo Pizarro"
>> <juanpablo.pizarro@(protected)>
>> To: "Martin" <mgainty@(protected)>
>> Sent: Thursday, May 29, 2008 7:03 PM
>> Subject: Re: Are sessions confused?
>>
>>
>>
>> > I traied a lot of things.. now I'm reading things. Any idea?
>> >
>> > 2008/5/29, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
>> >
>> > > The form that I use the user through the app is with a session object.
>> > > I put it in my login interceptor and ask for it in others.
>> > >
>> > > I'm searching attributes in the actions that are not used as fields in
>> > > the html, but until now, I didn't find.
>> > >
>> > > public String intercept(ActionInvocation invocation) throws Exception {
>> > >
>> > > final ActionContext context =
>> invocation.getInvocationContext();
>> > > HttpServletRequest request = (HttpServletRequest)
>> > >
>> context.get(
org.apache.struts2.StrutsStatics.HTTP_REQUEST);
>> > >
>> > > session = request.getSession(true);
>> > >
>> > > User user = (User) session.getAttribute("user");
>> > > if (user == null || user.getLogin() == null) {
>> > > String registerAttempt = (String)
>> > > request.getSession().getAttribute(REGISTER_ATTEMPT);
>> > > String activateAttempt = (String) request.getSession()
>> > >
>> .getAttribute(ACTIVATE_ATTEMPT);
>> > > String loginAttempt = (String)
>> request.getSession().getAttribute(
>> > > LOGIN_ATTEMPT);
>> > > String page = (String)
>> request.getSession().getAttribute(PAGE);
>> > >
>> > > if (registerAttempt == "yes" || activateAttempt == "yes"
>> > > || page == "index.jsp")
>> > > return invocation.invoke();
>> > >
>> > > if (loginAttempt == "yes") {
>> > > if (processLoginAttempt(request, session)) {
>> > >
>> session.removeAttribute(LOGIN_ATTEMPT);
>> > > return "login-success";
>> > > } else {
>> > > Object action = invocation.getAction();
>> > > if (action instanceof ValidationAware) {
>> > > ((ValidationAware) action)
>> > > .addActionError("Username or password incorrect.");
>> > > }// if
>> > >
>> > > }// if-else
>> > >
>> > > }// if
>> > >
>> > > return "login-attempt";
>> > > } else {
>> > > return invocation.invoke();
>> > > }
>> > > }
>> > >
>> > >
>> > > 2008/5/29, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
>> > > > Ok, but the problem is that here
>> > > >
>> > > > lands on 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),
>> LOGIN_ATTEMPT=yes,
>> > > > page=login.jsp}
>> > > >
>> > > >
>> > > > is User 2 with the session of user 1. But I've a idea to test.
>> > > >
>> > > > Regards,
>> > > >
>> > > > JP
>> > > >
>> > > > 2008/5/28, Martin <mgainty@(protected)>:
>> > > > > Juan Pablo-
>> > > > >
>> > > > > 1st session
>> > > > > .lands on index.jsp
>> > > > > 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)}
>> > > > >
>> > > > > .lands on login.jsp
>> > > > > 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}
>> > > > >
>> > > > > .lands on menu.jsp..
>> > > > > 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)}
>> > > > >
>> > > > > 2nd session:
>> > > > > lands on index.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)}
>> > > > >
>> > > > > lands on 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),
>> LOGIN_ATTEMPT=yes,
>> > > > > page=login.jsp}
>> > > > >
>> > > > > .lands on welcome.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),
>> page=welcome.jsp}
>> > > > >
>> > > > > Saludos Cordiales!
>> > > > > Martin
>> > > > > ----- Original Message ----- From: "Juan Pablo Pizarro"
>> > > > > <juanpablo.pizarro@(protected)>
>> > > > > To: "Struts Users Mailing List" <user@(protected)>
>> > > > > Sent: Wednesday, May 28, 2008 4:11 PM
>> > > > > Subject: Are sessions confused?
>> > > > >
>> > > > >
>> > > > > >
>> > > > > > The problem:
>> > > > > > I'm using two browsers into separate machines, so, I loged as "1"
>> > > > in
>> > > > > > a browser and when a login with user "2" in other browser (and
>> > > > > > separate machine), I see logged es "1", then I press ctrl+f5 and
>> > > > > > change to user "2", but if I don't press that, the session is > >
>> > wrong.
>> > > > > >
>> > > > > > The following are my logs.
>> > > > > >
>> > > > > > ...
>> > > > > > 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),
>> LOGIN_ATTEMPT=yes,
>> > > > > > 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),
>> page=welcome.jsp}
>> > > > > > ...
>> > > > > > 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)}
>> > > > > >
>> > > > > > Steps:
>> > > > > > 1.- The first 2 are the login with the user "1".
>> > > > > > 2.- The next 2 are the login with user "2".
>> > > > > > 3.- The next log is a operation with user "1" but it keeps the
>> > > > > > session of user "2"!!!.
>> > > > > > 4.- The last is the CTRL+F5 in the browser (in a separate PC) of >
>> > > user
>> > > > > > "1" and then, the http session is right.
>> > > > > >
>> > > > > > My hard:
>> > > > > > - The project is running in a hp proliant 1100.
>> > > > > > - 2 PC's 1 laptop. From thats, I open web browsers (IE6, FIREFOX).
>> > > > > >
>> > > > > > Soft:
>> > > > > > - tomcat 6.0.16 running on w2003 server.
>> > > > > > - strts2 2.0.11.
>> > > > > > - I use spring and hibernate to get domain objects, but not
>> > > > > > integrated with struts in a conf.
>> > > > > >
>> > > > > > Conf:
>> > > > > > <interceptors>
>> > > > > > <interceptor name="login"
>> > > > > >
>> class="org.gblx.interceptor.common.LoginInterceptor" />
>> > > > > >
>> > > > > > <interceptor-stack name="defaultLoginStack">
>> > > > > > <interceptor-ref name="servlet-config" />
>> > > > > > <interceptor-ref name="params" />
>> > > > > > <interceptor-ref name="login" />
>> > > > > > <interceptor-ref name="prepare" />
>> > > > > > <interceptor-ref name="chain" />
>> > > > > > <interceptor-ref name="model-driven" />
>> > > > > > <interceptor-ref name="fileUpload" />
>> > > > > > <interceptor-ref name="static-params" />
>> > > > > > <interceptor-ref name="params" />
>> > > > > > <interceptor-ref name="conversionError" />
>> > > > > > <interceptor-ref name="validation" />
>> > > > > > <interceptor-ref name="workflow" />
>> > > > > > </interceptor-stack>
>> > > > > >
>> > > > > > <interceptor-stack name="defaultInsecureStack">
>> > > > > > <interceptor-ref name="servlet-config" />
>> > > > > > <interceptor-ref name="params" />
>> > > > > > <interceptor-ref name="prepare" />
>> > > > > > <interceptor-ref name="chain" />
>> > > > > > <interceptor-ref name="model-driven" />
>> > > > > > <interceptor-ref name="fileUpload" />
>> > > > > > <interceptor-ref name="static-params" />
>> > > > > > <interceptor-ref name="params" />
>> > > > > > <interceptor-ref name="conversionError" />
>> > > > > > <interceptor-ref name="validation" />
>> > > > > > <interceptor-ref name="workflow" />
>> > > > > > </interceptor-stack>
>> > > > > > </interceptors>
>> > > > > >
>> > > > > > <default-interceptor-ref name="defaultLoginStack" />
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > > > Code:
>> > > > > > I've a class called CommonAction. All Actions extends from it.
>> > > > > >
>> > > > > > public class CommonAction extends ActionSupport implements > > >
>> SessionAware,
>> > > > > > ParameterAware {
>> > > > > >
>> > > > > > private static final long serialVersionUID = 1L;
>> > > > > > private static Logger logger =
>> > > > > Logger.getLogger(CommonAction.class);
>> > > > > > private Map session;
>> > > > > > private Map parameters;
>> > > > > >
>> > > > > > public void setSession(Map session) {
>> > > > > > HttpServletRequest request = (HttpServletRequest)
>> > > > > >
>> > > > >
>> ActionContext.getContext().get(
org.apache.struts2.StrutsStatics.HTTP_REQUEST);
>> > > > > >
>> > > > > > logger.info("SET_HTTP_SESSION: " + request.getSession().getId());
>> > > > > > logger.info("SET_SESSION: " + session);
>> > > > > > this.session = session;
>> > > > > > }
>> > > > > >
>> > > > > > public Map getSession() {
>> > > > > > HttpServletRequest request = (HttpServletRequest)
>> > > > > >
>> > > > >
>> ActionContext.getContext().get(
org.apache.struts2.StrutsStatics.HTTP_REQUEST);
>> > > > > > logger.info("GET_HTTP_SESSION: " + request.getSession().getId());
>> > > > > > logger.info("GET_SESSION: " + session);
>> > > > > > return session;
>> > > > > > }
>> > > > > > public void setParameters(Map parameters) {
>> > > > > > this.parameters = parameters;
>> > > > > > }
>> > > > > > public Map getParameters() {
>> > > > > > return parameters;
>> > > > > > }
>> > > > > > }
>> > > > > >
>> > > > > >
>> > > > > > I use two forms to modify the session. Through this.getSession() >
>> > > and using
>> > > > > >
>> > > > > >
>> > > > >
>> ServletActionContext.getRequest().getSession().setAttribute("message",
>> > > > > > getText("message_user_exists"));
>> > > > > >
>> > > > > >
>> > > > > > I'm traied several things, but nothing. Any idea?
>> > > > > >
>> > > > > > Regards,
>> > > > > >
>> > > > > > JP
>> > > > > >
>> > > > > >
>> > > > >
>> ---------------------------------------------------------------------
>> > > > > > To unsubscribe, e-mail:
>> > > > > user-unsubscribe@(protected)
>> > > > > > For additional commands, e-mail: user-help@(protected)
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > >
>> > > > >
>> > > >
>> > >
>> > >
>> >
>> >
>>
>>
>

Attachment:
user_187063.ezm (zipped)With ServletActionContext.getRequest().getSession().setAttribute("user",
(int) (Math.random() * 100)); the problem is only in firefox!!.
So.. now I'm lost, I don't understand, I suppose that the problem is
from my project, but, I can't see it. This is a bit disappointing :(
Any idea?
2008/5/30 Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
> I've problems with sessions, but, is it an issue?.
> The erratic behavior is this:
>
> I opened a firefox and logged with user "1" (the login only put in
> session a random number, the action no get a user from somewhere). The
> page showed 28.
> I opened a IE7 and logged with user "2". Showed 84.
> I pressed CTRL+F5 (update the page and cache) in the firefox and it
> updated the number to 84.
>
> I repeat the experince in dev1 env. and in my workstation, and today,
> in my computer (home).
>
> To by sure, I used the struts2-blank-2.0.11.1.war expanded, obviusly,
> with the minimal modifications to show the number, and
> apache-tomcat-5.5.26 (and 6.X too).
> I based my app on http://struts.apache.org/2.x/docs/bootstrap.html
>
> Please, I need to know if the problem is an issue, is a bag strategy
> to access to session, is a bag conf or other.
>
> Any idea?
>
> Best Regards,
>
> Juan Pablo
>
> ===============================
> ===============================
>
> The LoginAction
> ===============================
> public String execute() throws Exception {
> // This access way is from:
> // http://struts.apache.org/2.x/docs/accessing-application-session-request-objects.html
> Map session = (Map) ActionContext.getContext().get("session");
> session.put("user", (int) (Math.random() * 100));
> return SUCCESS;
> }// excecute
>
> Login Page
> ===============================
> <%@(protected)" %>
> <%@(protected)" %>
> ...
> <s:form action="Login">
> <s:textfield key="username"/>
> <s:password key="password" />
> <s:submit/>
> </s:form>
> ...
>
> Struts.xml
> ===============================
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE struts PUBLIC
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
> <constant name="struts.enable.DynamicMethodInvocation" value="false" />
> <constant name="struts.devMode" value="false" />
> <include file="common.xml"/>
> </struts>
>
> Common.xml
> ===============================
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE struts PUBLIC
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
> <package name="common" namespace="/common" extends="struts-default">
> <action name="Login_*" method="{1}"
> class="org.gblx.action.common.LoginAction">
> <result name="input">/common/Login.jsp</result>
> <result type="redirect-action">Menu</result>
> </action>
> <action name="Welcome">
> <result>/common/Welcome.jsp</result>
> </action>
> <action name="*" class="org.gblx.action.common.CommonSupport">
> <result>/common/{1}.jsp</result>
> </action>
> </package>
> </struts>
>
> Web.xml
> ===============================
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app id="WebApp_9" version="2.4"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> <display-name>...</display-name>
> <filter>
> <filter-name>struts2</filter-name>
> <filter-class>
>
org.apache.struts2.dispatcher.FilterDispatcher> </filter-class>
> </filter>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> <welcome-file-list>
> <welcome-file>index.html</welcome-file>
> </welcome-file-list>
> </web-app>
>
>
>
>
>
>
>
> 2008/5/30 Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
>> Gracias Martin!
>>
>> These are my logs.
>>
>> I put a message in the session, and.. the session is copied or is the
>> same!!. I don't know how avoid that.
>>
>> I use the same web browser, and other to make the tests.
>>
>> I'm looking for a similar thread.. but nothing yet.
>>
>> Juan Pablo.
>>
>> ------------------------------------------------
>>
>> INFO [http-8080-Processor23] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
>> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
>> INFO [http-8080-Processor23] (CommonAction.java:48) -
>> GET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:49) - GET_SESSION:
>> {page=menu.jsp, user=org.gblx.entities.User@(protected)}
>> INFO [http-8080-Processor23] (WelcomeAction.java:27) - USER: 1
>> INFO [http-8080-Processor24] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor24] (CommonAction.java:40) - SET_SESSION:
>> {req=org.gblx.entities.Request@(protected)}
>> INFO [http-8080-Processor24] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor24] (CommonAction.java:40) - SET_SESSION:
>> {req=org.gblx.entities.Request@(protected),
>> page=login.jsp}
>> INFO [http-8080-Processor24] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor24] (CommonAction.java:40) - SET_SESSION:
>> {req=org.gblx.entities.Request@(protected),
>> message=Error!, the user isn't active., page=login.jsp}
>> INFO [http-8080-Processor23] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
>> {req=org.gblx.entities.Request@(protected),
>> user=org.gblx.entities.User@(protected)
>> active.}
>> INFO [http-8080-Processor23] (CommonAction.java:48) -
>> GET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:49) - GET_SESSION:
>> {req=org.gblx.entities.Request@(protected),
>> user=org.gblx.entities.User@(protected)
>> active.}
>> INFO [http-8080-Processor23] (WelcomeAction.java:27) - USER: jpp
>> INFO [http-8080-Processor23] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
>> {page=index.jsp, req=org.gblx.entities.Request@(protected),
>> message=Error!, the user isn't active.}
>> INFO [http-8080-Processor23] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
>> {req=org.gblx.entities.Request@(protected),
>> message=Error!, the user isn't active., page=login.jsp}
>> INFO [http-8080-Processor23] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
>> {page=menu.jsp, req=org.gblx.entities.Request@(protected)!,
>> the user isn't active., user=org.gblx.entities.User@(protected)}
>> INFO [http-8080-Processor23] (CommonAction.java:48) -
>> GET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:49) - GET_SESSION:
>> {page=menu.jsp, req=org.gblx.entities.Request@(protected)!,
>> the user isn't active., user=org.gblx.entities.User@(protected)}
>> INFO [http-8080-Processor23] (WelcomeAction.java:27) - USER: 1
>> INFO [http-8080-Processor23] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
>> {page=index.jsp, req=org.gblx.entities.Request@(protected),
>> message=Error!, the user isn't active.}
>> INFO [http-8080-Processor23] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
>> {LOGIN_ATTEMPT=yes, req=org.gblx.entities.Request@(protected),
>> message=Error!, the user isn't active., page=login.jsp}
>> INFO [http-8080-Processor24] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor24] (CommonAction.java:40) - SET_SESSION:
>> {page=menu.jsp, user=org.gblx.entities.User@(protected),
>> req=org.gblx.entities.Request@(protected)
>> active.}
>> INFO [http-8080-Processor24] (CommonAction.java:48) -
>> GET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor24] (CommonAction.java:49) - GET_SESSION:
>> {page=menu.jsp, user=org.gblx.entities.User@(protected),
>> req=org.gblx.entities.Request@(protected)
>> active.}
>> INFO [http-8080-Processor24] (WelcomeAction.java:27) - USER: jpp
>> INFO [http-8080-Processor23] (CommonAction.java:39) -
>> SET_HTTP_SESSION: 12038D86D797FB8C9487E8CE271B731B
>> INFO [http-8080-Processor23] (CommonAction.java:40) - SET_SESSION:
>> {req=org.gblx.entities.Request@(protected),
>> user=org.gblx.entities.User@(protected)!,
>> the user isn't active.}
>>
>>
>>
>>
>> 2008/5/29, Martin <mgainty@(protected)>:
>>> Hola!
>>>
>>> so if you execute the sessions separately
>>> 1st run
>>> index.jsp SET_HTTP_SESSION=
>>> login.jsp SET_HTTP_SESSION=
>>> menu.jsp SET_HTTP_SESSION=
>>> logout.jspSET_HTTP_SESSION=
>>>
>>> 2nd run
>>> index.jsp SET_HTTP_SESSION=
>>> login.jsp SET_HTTP_SESSION=
>>> menu.jsp SET_HTTP_SESSION=
>>> logout.jsp SET_HTTP_SESSION=
>>>
>>> once you are able to verify the SessionIDs for session1
>>> and different for session2
>>> then run them together and compare the results..
>>>
>>> let me know if you have any questions
>>>
>>> Saludos Cordiales!
>>> Martin
>>> ----- Original Message ----- From: "Juan Pablo Pizarro"
>>> <juanpablo.pizarro@(protected)>
>>> To: "Martin" <mgainty@(protected)>
>>> Sent: Thursday, May 29, 2008 7:03 PM
>>> Subject: Re: Are sessions confused?
>>>
>>>
>>>
>>> > I traied a lot of things.. now I'm reading things. Any idea?
>>> >
>>> > 2008/5/29, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
>>> >
>>> > > The form that I use the user through the app is with a session object.
>>> > > I put it in my login interceptor and ask for it in others.
>>> > >
>>> > > I'm searching attributes in the actions that are not used as fields in
>>> > > the html, but until now, I didn't find.
>>> > >
>>> > > public String intercept(ActionInvocation invocation) throws Exception {
>>> > >
>>> > > final ActionContext context =
>>> invocation.getInvocationContext();
>>> > > HttpServletRequest request = (HttpServletRequest)
>>> > >
>>> context.get(
org.apache.struts2.StrutsStatics.HTTP_REQUEST);
>>> > >
>>> > > session = request.getSession(true);
>>> > >
>>> > > User user = (User) session.getAttribute("user");
>>> > > if (user == null || user.getLogin() == null) {
>>> > > String registerAttempt = (String)
>>> > > request.getSession().getAttribute(REGISTER_ATTEMPT);
>>> > > String activateAttempt = (String) request.getSession()
>>> > >
>>> .getAttribute(ACTIVATE_ATTEMPT);
>>> > > String loginAttempt = (String)
>>> request.getSession().getAttribute(
>>> > > LOGIN_ATTEMPT);
>>> > > String page = (String)
>>> request.getSession().getAttribute(PAGE);
>>> > >
>>> > > if (registerAttempt == "yes" || activateAttempt == "yes"
>>> > > || page == "index.jsp")
>>> > > return invocation.invoke();
>>> > >
>>> > > if (loginAttempt == "yes") {
>>> > > if (processLoginAttempt(request, session)) {
>>> > >
>>> session.removeAttribute(LOGIN_ATTEMPT);
>>> > > return "login-success";
>>> > > } else {
>>> > > Object action = invocation.getAction();
>>> > > if (action instanceof ValidationAware) {
>>> > > ((ValidationAware) action)
>>> > > .addActionError("Username or password incorrect.");
>>> > > }// if
>>> > >
>>> > > }// if-else
>>> > >
>>> > > }// if
>>> > >
>>> > > return "login-attempt";
>>> > > } else {
>>> > > return invocation.invoke();
>>> > > }
>>> > > }
>>> > >
>>> > >
>>> > > 2008/5/29, Juan Pablo Pizarro <juanpablo.pizarro@(protected)>:
>>> > > > Ok, but the problem is that here
>>> > > >
>>> > > > lands on 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),
>>> LOGIN_ATTEMPT=yes,
>>> > > > page=login.jsp}
>>> > > >
>>> > > >
>>> > > > is User 2 with the session of user 1. But I've a idea to test.
>>> > > >
>>> > > > Regards,
>>> > > >
>>> > > > JP
>>> > > >
>>> > > > 2008/5/28, Martin <mgainty@(protected)>:
>>> > > > > Juan Pablo-
>>> > > > >
>>> > > > > 1st session
>>> > > > > .lands on index.jsp
>>> > > > > 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)}
>>> > > > >
>>> > > > > .lands on login.jsp
>>> > > > > 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}
>>> > > > >
>>> > > > > .lands on menu.jsp..
>>> > > > > 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)}
>>> > > > >
>>> > > > > 2nd session:
>>> > > > > lands on index.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)}
>>> > > > >
>>> > > > > lands on 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),
>>> LOGIN_ATTEMPT=yes,
>>> > > > > page=login.jsp}
>>> > > > >
>>> > > > > .lands on welcome.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),
>>> page=welcome.jsp}
>>> > > > >
>>> > > > > Saludos Cordiales!
>>> > > > > Martin
>>> > > > > ----- Original Message ----- From: "Juan Pablo Pizarro"
>>> > > > > <juanpablo.pizarro@(protected)>
>>> > > > > To: "Struts Users Mailing List" <user@(protected)>
>>> > > > > Sent: Wednesday, May 28, 2008 4:11 PM
>>> > > > > Subject: Are sessions confused?
>>> > > > >
>>> > > > >
>>> > > > > >
>>> > > > > > The problem:
>>> > > > > > I'm using two browsers into separate machines, so, I loged as "1"
>>> > > > in
>>> > > > > > a browser and when a login with user "2" in other browser (and
>>> > > > > > separate machine), I see logged es "1", then I press ctrl+f5 and
>>> > > > > > change to user "2", but if I don't press that, the session is > >
>>> > wrong.
>>> > > > > >
>>> > > > > > The following are my logs.
>>> > > > > >
>>> > > > > > ...
>>> > > > > > 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),
>>> LOGIN_ATTEMPT=yes,
>>> > > > > > 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),
>>> page=welcome.jsp}
>>> > > > > > ...
>>> > > > > > 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)}
>>> > > > > >
>>> > > > > > Steps:
>>> > > > > > 1.- The first 2 are the login with the user "1".
>>> > > > > > 2.- The next 2 are the login with user "2".
>>> > > > > > 3.- The next log is a operation with user "1" but it keeps the
>>> > > > > > session of user "2"!!!.
>>> > > > > > 4.- The last is the CTRL+F5 in the browser (in a separate PC) of >
>>> > > user
>>> > > > > > "1" and then, the http session is right.
>>> > > > > >
>>> > > > > > My hard:
>>> > > > > > - The project is running in a hp proliant 1100.
>>> > > > > > - 2 PC's 1 laptop. From thats, I open web browsers (IE6, FIREFOX).
>>> > > > > >
>>> > > > > > Soft:
>>> > > > > > - tomcat 6.0.16 running on w2003 server.
>>> > > > > > - strts2 2.0.11.
>>> > > > > > - I use spring and hibernate to get domain objects, but not
>>> > > > > > integrated with struts in a conf.
>>> > > > > >
>>> > > > > > Conf:
>>> > > > > > <interceptors>
>>> > > > > > <interceptor name="login"
>>> > > > > >
>>> class="org.gblx.interceptor.common.LoginInterceptor" />
>>> > > > > >
>>> > > > > > <interceptor-stack name="defaultLoginStack">
>>> > > > > > <interceptor-ref name="servlet-config" />
>>> > > > > > <interceptor-ref name="params" />
>>> > > > > > <interceptor-ref name="login" />
>>> > > > > > <interceptor-ref name="prepare" />
>>> > > > > > <interceptor-ref name="chain" />
>>> > > > > > <interceptor-ref name="model-driven" />
>>> > > > > > <interceptor-ref name="fileUpload" />
>>> > > > > > <interceptor-ref name="static-params" />
>>> > > > > > <interceptor-ref name="params" />
>>> > > > > > <interceptor-ref name="conversionError" />
>>> > > > > > <interceptor-ref name="validation" />
>>> > > > > > <interceptor-ref name="workflow" />
>>> > > > > > </interceptor-stack>
>>> > > > > >
>>> > > > > > <interceptor-stack name="defaultInsecureStack">
>>> > > > > > <interceptor-ref name="servlet-config" />
>>> > > > > > <interceptor-ref name="params" />
>>> > > > > > <interceptor-ref name="prepare" />
>>> > > > > > <interceptor-ref name="chain" />
>>> > > > > > <interceptor-ref name="model-driven" />
>>> > > > > > <interceptor-ref name="fileUpload" />
>>> > > > > > <interceptor-ref name="static-params" />
>>> > > > > > <interceptor-ref name="params" />
>>> > > > > > <interceptor-ref name="conversionError" />
>>> > > > > > <interceptor-ref name="validation" />
>>> > > > > > <interceptor-ref name="workflow" />
>>> > > > > > </interceptor-stack>
>>> > > > > > </interceptors>
>>> > > > > >
>>> > > > > > <default-interceptor-ref name="defaultLoginStack" />
>>> > > > > >
>>> > > > > >
>>> > > > > >
>>> > > > > > Code:
>>> > > > > > I've a class called CommonAction. All Actions extends from it.
>>> > > > > >
>>> > > > > > public class CommonAction extends ActionSupport implements > > >
>>> SessionAware,
>>> > > > > > ParameterAware {
>>> > > > > >
>>> > > > > > private static final long serialVersionUID = 1L;
>>> > > > > > private static Logger logger =
>>> > > > > Logger.getLogger(CommonAction.class);
>>> > > > > > private Map session;
>>> > > > > > private Map parameters;
>>> > > > > >
>>> > > > > > public void setSession(Map session) {
>>> > > > > > HttpServletRequest request = (HttpServletRequest)
>>> > > > > >
>>> > > > >
>>> ActionContext.getContext().get(
org.apache.struts2.StrutsStatics.HTTP_REQUEST);
>>> > > > > >
>>> > > > > > logger.info("SET_HTTP_SESSION: " + request.getSession().getId());
>>> > > > > > logger.info("SET_SESSION: " + session);
>>> > > > > > this.session = session;
>>> > > > > > }
>>> > > > > >
>>> > > > > > public Map getSession() {
>>> > > > > > HttpServletRequest request = (HttpServletRequest)
>>> > > > > >
>>> > > > >
>>> ActionContext.getContext().get(
org.apache.struts2.StrutsStatics.HTTP_REQUEST);
>>> > > > > > logger.info("GET_HTTP_SESSION: " + request.getSession().getId());
>>> > > > > > logger.info("GET_SESSION: " + session);
>>> > > > > > return session;
>>> > > > > > }
>>> > > > > > public void setParameters(Map parameters) {
>>> > > > > > this.parameters = parameters;
>>> > > > > > }
>>> > > > > > public Map getParameters() {
>>> > > > > > return parameters;
>>> > > > > > }
>>> > > > > > }
>>> > > > > >
>>> > > > > >
>>> > > > > > I use two forms to modify the session. Through this.getSession() >
>>> > > and using
>>> > > > > >
>>> > > > > >
>>> > > > >
>>> ServletActionContext.getRequest().getSession().setAttribute("message",
>>> > > > > > getText("message_user_exists"));
>>> > > > > >
>>> > > > > >
>>> > > > > > I'm traied several things, but nothing. Any idea?
>>> > > > > >
>>> > > > > > Regards,
>>> > > > > >
>>> > > > > > JP
>>> > > > > >
>>> > > > > >
>>> > > > >
>>> ---------------------------------------------------------------------
>>> > > > > > To unsubscribe, e-mail:
>>> > > > > user-unsubscribe@(protected)
>>> > > > > > For additional commands, e-mail: user-help@(protected)
>>> > > > > >
>>> > > > > >
>>> > > > > >
>>> > > > >
>>> > > > >
>>> > > >
>>> > >
>>> > >
>>> >
>>> >
>>>
>>>
>>
>