Author Login
Post Reply
user Digest 6 Aug 2008 13:50:59 -0000 Issue 8181
Topics (messages 189740 through 189769):
Re: HowTo: transfer parameter between actions?
189740 by: Greg Lindholm
Re: [S2] Ajax DIV Question
189741 by: Hoying, Ken
189750 by: Jeromy Evans
189761 by: Hoying, Ken
189762 by: Dave Newton
189764 by: Jeromy Evans
189765 by: Jeromy Evans
189767 by: Hoying, Ken
Re: Struts2 with JSON.
189742 by: sharath karnati
189743 by: Musachy Barroso
Struts 2 AJAX
189744 by: stanlick.gmail.com
189745 by: Dave Newton
189746 by: Piero Sartini
189757 by: stanlick.gmail.com
189759 by: Dave Newton
Re: Create multiple struts configuration file problem
189747 by: angelwei
189758 by: Engr. Jherald Gerome Lacambra
Re: Issue with Url mapping with struts-action-extension=""
189748 by: Jeromy Evans
Re: Treenode, expanded onload
189749 by: Jeromy Evans
struts 2 login issue
189751 by: nauke.
189753 by: Al Sutton
Re: [S2] Refactoring Action classes
189752 by: Jeromy Evans
189768 by: Milan Milanovic
189769 by: Dave Newton
Re: 2 Validation questions
189754 by: Jeromy Evans
189756 by: Gundersen, Richard
OGNL Help
189755 by: Zoran Avtarovski
189760 by: Jeromy Evans
189763 by: Zoran Avtarovski
189766 by: Zoran Avtarovski
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_189740.ezm (zipped)
Sorry, my response got munged by nabble, the param tags disappeared.
So pretend I have angle brackets where you see square brackets below:
[result type="redirectAction"]
[param name="actionName"]PrepareDictionary[/param]
[param name="namespace"]/admin[/param]
[param name="dictionaryId"]${dictionaryId}[/param]
[/result]
Greg Lindholm wrote:
>
> You can pass parameters on a redirectAction, I do it all the time
>
>
> <result type="redirectAction">
> PrepareDictionary
> /admin
> ${dictionaryId}
> </result>
>
>
>
> holod wrote:
>>
>> 1.I have action PrepareDictionaryAction
>> it has field String dictionaryId and appropriate getter and setter.
>> dictionaryid comes from previous jsp. (enter.jsp)
>> action sends user to dictionary.jsp
>>
>> 2.dictionary jsp has hidden field <s:hidden name="dictionaryId"/>. So I
>> will not be lost.
>> 3.then through form submit user goes to WorkWithDictionaryAction.
>> This action reads hidden field dictionaryId.
>>
>> I want on result="success" send user to PrepareDictionaryAction and I
>> don't want to loose dictionaryId
>>
>> This is struts.xml for "WorkWithDictionary:
>> <action name="WorkWithDictionary"
>> class="ibs.parliament.action.admin.WorkWithDictionaryAction">
>> <result name="success" type="redirect-action">
>> PrepareDictionary
>> /admin
>> </result>
>> <result name="input">/admin/dictionary.jsp</result>
>> </action>
>>
>> As you can see on "success" user will go to PrepareDictionary. This
>> action needs dictionaryId, but I is lost on WorkWithDictionary action,
>> this parameter doesn't go forward.
>>
>> I would'nt like to use session, I would like to use something else. Does
>> struts2 has special interceptor or result type for such tasks?
>>
>>
>>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189741.ezm (zipped) I was able to update the href and formId via JavaScript and DOJO as
follows:
dojo.widget.byId('divId').href = 'myUrl';
dojo.widget.byId('divId').formId = 'myFormId';
This works fine as long as the form itself was not loaded infot the DIV
(divId). However, if myFormId is located in divId and was loaded into
the div via the initial ajax call, then it does not work.
Any ideas?
Thanks in advance,
Ken
-----Original Message-----
From: Hoying, Ken [mailto:Ken_Hoying@(protected)]
Sent: Monday, August 04, 2008 10:48 AM
To: user@(protected)
Subject: [S2] Ajax DIV Question
I have a tabbed panel. I would like to refresh the contents of this tab
and am able to do so by publishing to the proper topic. However, I
really need to take it a step further and be able to dynamically specify
the formid and href attributes of the Ajax DIV in my JavaScript, before
refreshing it. Is there a way to do this?
If I cannot do this, then I guess my next option would be to use
multiple nested Ajax DIVs. I believe that this would work okay if I
could specify that these DIVs not preload. However, it appears that
this is functionality was not added until 2.1 and I am using 2.0.11.
Would there be another way to accomplish this?
Thanks in advance,
Ken
-----------------------------------------
***Note:The information contained in this message may be privileged and
confidential and protected from disclosure. If the reader of this
message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you
are hereby notified that any dissemination, distribution or copying of
this communication is strictly prohibited. If you have received this
communication in error, please notify the Sender immediately by replying
to the message and deleting it from your computer. Thank you. Premier
Inc.

Attachment:
user_189750.ezm (zipped)Hoying, Ken wrote:
> I was able to update the href and formId via JavaScript and DOJO as
> follows:
>
> dojo.widget.byId('divId').href = 'myUrl';
> dojo.widget.byId('divId').formId = 'myFormId';
>
> This works fine as long as the form itself was not loaded infot the DIV
> (divId). However, if myFormId is located in divId and was loaded into
> the div via the initial ajax call, then it does not work.
>
> Any ideas?
>
Set showLoadingText=false on the relevant tags/widgets.
It's a bug in Dojo in IE where it overwites the form with the loading
text prior to reading the values from the request.

Attachment:
user_189761.ezm (zipped)THANK YOU!!!
That fixed the problem. Thank you for taking the time to share.
I hate not having a message for the users there though. Does anyone
know of a fix for this?
Thanks in advance!
-----Original Message-----
From: Jeromy Evans [mailto:jeromy.evans@(protected)]
Sent: Wednesday, August 06, 2008 2:06 AM
To: Struts Users Mailing List
Subject: Re: [S2] Ajax DIV Question
Hoying, Ken wrote:
> I was able to update the href and formId via JavaScript and DOJO as
> follows:
>
> dojo.widget.byId('divId').href = 'myUrl';
> dojo.widget.byId('divId').formId = 'myFormId';
>
> This works fine as long as the form itself was not loaded infot the
> DIV (divId). However, if myFormId is located in divId and was loaded
> into the div via the initial ajax call, then it does not work.
>
> Any ideas?
>
Set showLoadingText=false on the relevant tags/widgets.
It's a bug in Dojo in IE where it overwites the form with the loading
text prior to reading the values from the request.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.

Attachment:
user_189762.ezm (zipped)http://struts.apache.org/2.x/docs/dojo-submit.html
Put the notification message in a different div?
Dave
--- On Wed, 8/6/08, Hoying, Ken <Ken_Hoying@(protected):
> From: Hoying, Ken <Ken_Hoying@(protected)>
> Subject: RE: [S2] Ajax DIV Question
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Wednesday, August 6, 2008, 8:25 AM
> THANK YOU!!!
>
> That fixed the problem. Thank you for taking the time to
> share.
>
> I hate not having a message for the users there though.
> Does anyone
> know of a fix for this?
>
> Thanks in advance!
>
>
> -----Original Message-----
> From: Jeromy Evans
> [mailto:jeromy.evans@(protected)]
> Sent: Wednesday, August 06, 2008 2:06 AM
> To: Struts Users Mailing List
> Subject: Re: [S2] Ajax DIV Question
>
> Hoying, Ken wrote:
> > I was able to update the href and formId via
> JavaScript and DOJO as
> > follows:
> >
> > dojo.widget.byId('divId').href =
> 'myUrl';
> > dojo.widget.byId('divId').formId =
> 'myFormId';
> >
> > This works fine as long as the form itself was not
> loaded infot the
> > DIV (divId). However, if myFormId is located in divId
> and was loaded
> > into the div via the initial ajax call, then it does
> not work.
> >
> > Any ideas?
> >
> Set showLoadingText=false on the relevant tags/widgets.
> It's a bug in Dojo in IE where it overwites the form
> with the loading
> text prior to reading the values from the request.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)
>
> -----------------------------------------
> ***Note:The information contained in this message may be
> privileged
> and confidential and protected from disclosure. If the
> reader of
> this message is not the intended recipient, or an employee
> or agent
> responsible for delivering this message to the intended
> recipient,
> you are hereby notified that any dissemination,
> distribution or
> copying of this communication is strictly prohibited. If
> you have
> received this communication in error, please notify the
> Sender
> immediately by replying to the message and deleting it from
> your
> computer. Thank you. Premier Inc.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment:
user_189764.ezm (zipped)
Dave Newton wrote:
> http://struts.apache.org/2.x/docs/dojo-submit.html
>
> Put the notification message in a different div?
>
> Dave
>
Yeah, use the indicator attribute to show/hide an image as show at the
top of that page. It looks better too.

Attachment:
user_189765.ezm (zipped)
Dave Newton wrote:
> http://struts.apache.org/2.x/docs/dojo-submit.html
>
> Put the notification message in a different div?
>
> Dave
>
Yeah, use the indicator attribute to show/hide an image as per the
example at the top of that page. It looks better too.

Attachment:
user_189767.ezm (zipped)Thanks! I saw the indicator property right after I sent the email.
Works like a charm.
Thank you!
-----Original Message-----
From: Jeromy Evans [mailto:jeromy.evans@(protected)]
Sent: Wednesday, August 06, 2008 8:52 AM
To: Struts Users Mailing List
Subject: Re: [S2] Ajax DIV Question
Dave Newton wrote:
> http://struts.apache.org/2.x/docs/dojo-submit.html
>
> Put the notification message in a different div?
>
> Dave
>
Yeah, use the indicator attribute to show/hide an image as per the
example at the top of that page. It looks better too.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.

Attachment:
user_189742.ezm (zipped)Hi All,
I'm getting below value in req.responseText
{"list":{"com.beans.ComplaintDO":{"first__name":"Sharath","last__name":"Karnati"}}}
which I'm passing for JSON
jsonObject=eval( "("+ req.responseText +")" );
How to read 'first__name' value from jsonObject?
Thanks,
Sharath.
--- On Mon, 8/4/08, sharath karnati <karnatis@(protected):
From: sharath karnati <karnatis@(protected)>
Subject: Struts2 with JSON.
To: user@(protected)
Date: Monday, August 4, 2008, 10:25 AM
Hi All,
Using JSON, I'm getting below response from action
{"list":{"com.beans.ComplaintDO":{"user__complaint__number":"08-C00000153","user__complaint__key":"08-C00000153-1","form__type":"2000B","first__name":"Sharath","last__name":"Karnati"}}}
In this response, 'com.beans.ComplaintDO' is a javabean.
'list' is a java arraylist and it may contain multiple
'com.beans.ComplaintDO' javabeans.
I'd like to know how to read this response in java script, I tried below
way but getting java script error(jsonObject has no properties)
function onReadyState()
{
alert('In onReadyState');
var ready=req.readyState;
var jsonObject=null;
if ( ready == READY_STATE_COMPLETE )
{
jsonObject=eval( req.responseText );
var searchresults = jsonObject.ComplaintDO.entry;
alert('In searchresults:'+searchresults.length);
}
}
Please let me know how to read these values from json object.
Thanks,
Sharath.

Attachment:
user_189743.ezm (zipped)jsonObject.list["com.beans.ComplaintDO"]["first__name"]
Not related to struts in anyway btw.
musachy
On Tue, Aug 5, 2008 at 5:09 PM, sharath karnati <karnatis@(protected):
> Hi All,
>
> I'm getting below value in req.responseText
>
> {"list":{"com.beans.ComplaintDO":{"first__name":"Sharath","last__name":"Karnati"}}}
>
> which I'm passing for JSON
>
> jsonObject=eval( "("+ req.responseText +")" );
>
> How to read 'first__name' value from jsonObject?
>
> Thanks,
> Sharath.
>
> --- On Mon, 8/4/08, sharath karnati <karnatis@(protected):
>
> From: sharath karnati <karnatis@(protected)>
> Subject: Struts2 with JSON.
> To: user@(protected)
> Date: Monday, August 4, 2008, 10:25 AM
>
> Hi All,
>
> Using JSON, I'm getting below response from action
>
>
> {"list":{"com.beans.ComplaintDO":{"user__complaint__number":"08-C00000153","user__complaint__key":"08-C00000153-1","form__type":"2000B","first__name":"Sharath","last__name":"Karnati"}}}
>
> In this response, 'com.beans.ComplaintDO' is a javabean.
> 'list' is a java arraylist and it may contain multiple
> 'com.beans.ComplaintDO' javabeans.
>
> I'd like to know how to read this response in java script, I tried below
> way but getting java script error(jsonObject has no properties)
>
> function onReadyState()
> {
> alert('In onReadyState');
> var ready=req.readyState;
> var jsonObject=null;
>
> if ( ready == READY_STATE_COMPLETE )
> {
> jsonObject=eval( req.responseText );
> var searchresults = jsonObject.ComplaintDO.entry;
> alert('In searchresults:'+searchresults.length);
> }
> }
>
> Please let me know how to read these values from json object.
>
> Thanks,
> Sharath.
>
>
>
>
>
>
>
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_189744.ezm (zipped)Is Struts 2.1.x still bound to DOJO?

Attachment:
user_189745.ezm (zipped)--- On Tue, 8/5/08, stanlick@(protected):
> Is Struts 2.1.x still bound to DOJO?
S2 Ajax/Dojo is a plugin.
Dave

Attachment:
user_189746.ezm (zipped)> Is Struts 2.1.x still bound to DOJO?
It isn't - DOJO is available as a plugin since 2.1.x
But there is no possibility to use the AJAX theme without DOJO right now.
There was an interesting discussion at struts-devel:
->
http://www.nabble.com/-PROPOSAL--Deprecate-or-remove-Dojo-plugin-td18573704.html
Piero

Attachment:
user_189757.ezm (zipped)Is any other js library compatible to be "plugged" in?
On Tue, Aug 5, 2008 at 7:45 PM, Dave Newton <newton.dave@(protected):
> --- On Tue, 8/5/08, stanlick@(protected):
> > Is Struts 2.1.x still bound to DOJO?
>
> S2 Ajax/Dojo is a plugin.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189759.ezm (zipped)--- On Wed, 8/6/08, stanlick@(protected):
> On Tue, Aug 5, 2008 at 7:45 PM, Dave Newton wrote:
> > --- On Tue, 8/5/08, stanlick@(protected):
> > > Is Struts 2.1.x still bound to DOJO?
> > S2[.1] Ajax/Dojo is a plugin.
> Is any other js library compatible to be "plugged" in?
To the existing tags? Not even sure how that would work; JavaScript libraries are all pretty different.
As someone else mentioned there's talk on the dev list regarding future options. I have a (largely abandoned) Google Code project to build a jQuery plugin, but with the new talk I'm even less likely to continue working on it. There were, at one point, at least two other people who were pursuing jQuery plugins, but I don't know the status of those projects.
Dave

Attachment:
user_189747.ezm (zipped)
ya, i want to know how to create different module. this is because my current
work need to do that.
can anybody tell me how to create multiple struts configuration file??
Thanks.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189758.ezm (zipped)try this on web.xml:
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet</
servlet-class>
- <#> <init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml,
/WEB-INF/struts-config-product.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
2008/8/6 angelwei <goocheewei@(protected)>:
>
> ya, i want to know how to create different module. this is because my
> current
> work need to do that.
> can anybody tell me how to create multiple struts configuration file??
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/Create-multiple-struts-configuration-file-problem-tp18748135p18842655.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)
>
>
--
Jherald Gerome Lacambra

Attachment:
user_189748.ezm (zipped)Haulyn R. Jason wrote:
>
>> > In case it is a, I would try the following settings:
>> >
>> > struts.action.extension=,,action
>> >
>>
>>
> 2.If I use Evans' way, it looks worked well but just need a "."..Struts
> do not have a solution for these?
>
> Thanks
>
>
I thought this was supported by this version of Struts 2 but I never use
the DefaultActionMapper so I maybe a problem does exist there.
To fix:
1 create a custom action mapper copied from DefaultActionMapper.java
[link below]
2. enable it in struts.properties or struts.xml : ie.
struts.mapper.class = com.PatchedDefaultActionMapper
3. Apply a patch to the dropExtension method that accepts blank
extensions. Here is the updated method:
/**
* Drops the extension from the action name
*
* @param name
* The action name
* @return The action name without its extension
*/
String dropExtension(String name) {
if (extensions == null) {
return name;
}
Iterator it = extensions.iterator();
while (it.hasNext()) {
String value = (String) it.next();
if (value.length() > 0) {
String extension = "." + value;
if (name.endsWith(extension)) {
name = name.substring(0, name.length() - extension.length());
return name;
}
} else {
// allow a blank extension
if (!name.contains(".")) {
return name;
}
}
}
return null;
}
regards,
Jeromy Evans
[source]
http://svn.apache.org/viewvc/struts/struts2/tags/STRUTS_2_0_11_1/core/src/main/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.java?view=markup

Attachment:
user_189749.ezm (zipped)Jack Stuard wrote:
> Hi, I've searched but maybe I don't have used the right term to this, I'd to
> know if is possible to show a Tree, with some specific treenodes already
> opened (or expanded) onload of a page in Struts 2 (stable version).
>
> Thanks in advance.
> Jack Stuard
>
>
>
Use a client-side library with a good Tree widget. Google javascript
tree widget treeview.
I mostly use this: http://developer.yahoo.com/yui/treeview/
The built-in struts2 tree tag isn't very good.

Attachment:
user_189751.ezm (zipped)Hi,
I'm not sure if this is a struts problem or something else.
I log into my app, when my session times out, I try to do something else.
I get presented with the login page, which is correct, but it fails with the
following error:
Connection Interrupted,
The connection to the server was reset while the page was loading.
The network link was interrupted while negotiating a connection. Please try
again.
(button "Try Again")
The URL in my address bar says:
http://localhost:8080/myapp/j_security_check
Any ideas anyone?
Cheers

Attachment:
user_189753.ezm (zipped)I'm pretty sure it's something else (unless your struts app is coded badly).
Try disabling any Anti-Virus/Firewall/etc. software before running the
test. Failing that look at your app server and memory usage.
Al.
nauke. wrote:
> Hi,
>
> I'm not sure if this is a struts problem or something else.
>
> I log into my app, when my session times out, I try to do something else.
> I get presented with the login page, which is correct, but it fails with the
> following error:
>
> Connection Interrupted,
> The connection to the server was reset while the page was loading.
> The network link was interrupted while negotiating a connection. Please try
> again.
>
> (button "Try Again")
>
> The URL in my address bar says:
>
> http://localhost:8080/myapp/j_security_check
>
> Any ideas anyone?
>
> Cheers
>
>
--
--
Al Sutton
W: www.alsutton.com
T: twitter.com/alsutton

Attachment:
user_189752.ezm (zipped)Milan Milanovic wrote:
> Dear Al and Dave,
>
> I tried to fix that error with session variable all weekend and I didn't
> managed to fix it. When action is defined as redirect action to another
> namespace, and when that action is called, another action called method
> doesn't see my session variables. I just changed this redirect action to
> that another namespace, as standard action (not redirect) and I now see my
> variables! I don't have any idea why it doesn't work with redirect action,
> but I'm SURE that there is some problem.
>
Out of interest, which container and browser are you testing with and
how is the browser sending the JSessionID to your container?
Within the browser you can determine whether you are using the same
JSessionID or a new one by monitoring the raw requests. If the Session
was lost, you'd have a new JSessionID.
A redirect result and a redirectAction result are the same as far as the
browser is concerned. They both return a 30x http status with a location
header providing the next URL to GET. In the case of redirectAction,
the result calculates the URL based on the name of the action. In the
redirect case, the result uses the location value directly. In both
cases, the URL performs a GET to the new URL, including the JSessionID
if appropriate (if it's in a cookie, or included in the URL)
It is feasible that your JSessionID is indeed reset as the result of a
redirect if cookies are disabled and JSessionID is not automatically
appended to the new location by the container/struts2.
regards,
Jeromy Evans

Attachment:
user_189768.ezm (zipped)
Dear Jeromy,
Jeromy Evans - Blue Sky Minds wrote:
>
> Out of interest, which container and browser are you testing with and
> how is the browser sending the JSessionID to your container?
> Within the browser you can determine whether you are using the same
> JSessionID or a new one by monitoring the raw requests. If the Session
> was lost, you'd have a new JSessionID.
>
I'm using Tomcat 5.5.23 and I tried with Internet Explorer 7.0 and Firefox
3.0.
Yes, I can do that, to monitor the raw http requests in Eclipse.
Jeromy Evans - Blue Sky Minds wrote:
>
> A redirect result and a redirectAction result are the same as far as the
> browser is concerned. They both return a 30x http status with a location
> header providing the next URL to GET. In the case of redirectAction,
> the result calculates the URL based on the name of the action. In the
> redirect case, the result uses the location value directly. In both
> cases, the URL performs a GET to the new URL, including the JSessionID
> if appropriate (if it's in a cookie, or included in the URL)
>
O.K.
Jeromy Evans - Blue Sky Minds wrote:
>
> It is feasible that your JSessionID is indeed reset as the result of a
> redirect if cookies are disabled and JSessionID is not automatically
> appended to the new location by the container/struts2.
>
No, my cookies are enabled all the time. But if my JSessionID is not
automatically
appended to the new location by container/struts2 in case of redirect
action, why ?
--
Best regards, Milan
Jeromy Evans - Blue Sky Minds wrote:
>
> Milan Milanovic wrote:
>> Dear Al and Dave,
>>
>> I tried to fix that error with session variable all weekend and I didn't
>> managed to fix it. When action is defined as redirect action to another
>> namespace, and when that action is called, another action called method
>> doesn't see my session variables. I just changed this redirect action to
>> that another namespace, as standard action (not redirect) and I now see
>> my
>> variables! I don't have any idea why it doesn't work with redirect
>> action,
>> but I'm SURE that there is some problem.
>>
>
> Out of interest, which container and browser are you testing with and
> how is the browser sending the JSessionID to your container?
> Within the browser you can determine whether you are using the same
> JSessionID or a new one by monitoring the raw requests. If the Session
> was lost, you'd have a new JSessionID.
>
> A redirect result and a redirectAction result are the same as far as the
> browser is concerned. They both return a 30x http status with a location
> header providing the next URL to GET. In the case of redirectAction,
> the result calculates the URL based on the name of the action. In the
> redirect case, the result uses the location value directly. In both
> cases, the URL performs a GET to the new URL, including the JSessionID
> if appropriate (if it's in a cookie, or included in the URL)
>
> It is feasible that your JSessionID is indeed reset as the result of a
> redirect if cookies are disabled and JSessionID is not automatically
> appended to the new location by the container/struts2.
>
> regards,
> Jeromy Evans
>
> ---------------------------------------------------------------------
> 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_189769.ezm (zipped)--- On Wed, 8/6/08, Milan Milanovic <milanmilanovich@(protected):
> No, my cookies are enabled all the time. But if my JSessionID is not
> automatically appended to the new location by container/struts2 in
> case of redirect action, why ?
Probably because cookies are enabled all the time.
Dave

Attachment:
user_189754.ezm (zipped)Gundersen, Richard wrote:
> Hi
>
> Basic question sorry (looked all over but can't find the answer)
>
> 1) When validation fails for my 'username' textfield, the error message
> is displayed ABOVE the text box.
>
> Is it possible to have more fine-grained control over how to position
> the error message. Ideally I would like it below (and in line with) the
> text box.
>
> 2) If I enter an invalid value twice, the original message is still
> there, so I have two 'username is invalid' messages on the screen now. I
> know this is done by the javascript so I want to know the recommended
> way of overriding this behaviour.
>
> Thanks
>
I presume you're referring purely to client-side validation.
Struts2 includes a javascript file validation.js that includes most of
the logic. It contains a simple for-loop that searches for the location
to insert each validation message relative to the input. I think you'll
need to create your own version of validation.js that changes this
search algorithm.
The templates for the tags dictate the location of the validation
messages (divs or table cells). The controlHeader.ftl file imported by
all tags will need to be updated to the structure you prefer (ie. to
include the relevant div after the input). See the struts2 documents on
creating a custom template.
You may also need to edit the form.ftl file, or whatever, to make it
import your validation.js file instead of the default.
#2 sounds like a bug in validation.js. I recall there is logic in there
to detect if a validation message is already present and not show it
again. It was buggy and may only be fixed in 2.1.x.
If you're referring to server side validation, the repeated message
indicates the list of errors is not being cleared between invocations of
the same each, which implies to action is validated twice for the same
request or a new instance is not being created for each request (which
is bad, and only possible if you're using spring and have incorrect
spring config).
Hope that helps,
Jeromy Evans

Attachment:
user_189756.ezm (zipped)Thanks for the reply Jeromy, appreciate all the extra info you've given
me. It's the client side validation by the way, so I'll go down the
controlHeader.ftl route and see how I get on.
Someone else (Gabriel) mentioned a Javascript bug, so I think you're
right. I'll check out the relevant code when I get chance
Thanks again
Richard Gundersen
Java Developer
Email: richard.gundersen@(protected)
Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS
-----Original Message-----
From: Jeromy Evans [mailto:jeromy.evans@(protected)]
Sent: Wednesday, August 06, 2008 8:28 AM
To: Struts Users Mailing List
Subject: Re: 2 Validation questions
Gundersen, Richard wrote:
> Hi
>
> Basic question sorry (looked all over but can't find the answer)
>
> 1) When validation fails for my 'username' textfield, the error
message
> is displayed ABOVE the text box.
>
> Is it possible to have more fine-grained control over how to position
> the error message. Ideally I would like it below (and in line with)
the
> text box.
>
> 2) If I enter an invalid value twice, the original message is still
> there, so I have two 'username is invalid' messages on the screen now.
I
> know this is done by the javascript so I want to know the recommended
> way of overriding this behaviour.
>
> Thanks
>
I presume you're referring purely to client-side validation.
Struts2 includes a javascript file validation.js that includes most of
the logic. It contains a simple for-loop that searches for the location
to insert each validation message relative to the input. I think you'll
need to create your own version of validation.js that changes this
search algorithm.
The templates for the tags dictate the location of the validation
messages (divs or table cells). The controlHeader.ftl file imported by
all tags will need to be updated to the structure you prefer (ie. to
include the relevant div after the input). See the struts2 documents on
creating a custom template.
You may also need to edit the form.ftl file, or whatever, to make it
import your validation.js file instead of the default.
#2 sounds like a bug in validation.js. I recall there is logic in there
to detect if a validation message is already present and not show it
again. It was buggy and may only be fixed in 2.1.x.
If you're referring to server side validation, the repeated message
indicates the list of errors is not being cleared between invocations of
the same each, which implies to action is validated twice for the same
request or a new instance is not being created for each request (which
is bad, and only possible if you're using spring and have incorrect
spring config).
Hope that helps,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environment before printing this email.
*** Disclaimer ***
This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group.
If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@(protected).
We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication.
Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority.
London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 973008 England.
Subsidiary Companies:-
London Scottish Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 233259 England.
London Scottish Broking Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 230110 England.
London Scottish Invoice Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 2643766 England.
Robinson Way & Company Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 885896 England.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.

Attachment:
user_189755.ezm (zipped)I¹m trying to achieve something with OGNL and I¹d like to know if it¹s
possible and if so how to do it.
In my action I have an object called surveyResult with setter/getter. I also
have another object called questions with setter/getter.
The question object has a string element called questionEntity which is in
this case equal to surveyResult.initialvalue¹
What I want to be able to do is use the value from the surveyEntity to get a
value from the survey object.
I¹ve tried <s:property value="%{questionEntity}"/> which just gives me
surveyResult.intialvalue¹. Is there any way I can actually call
surveyResult.intialvalue and get the stored value in surveyResult?
Z.

Attachment:
user_189760.ezm (zipped)Zoran Avtarovski wrote:
> I¹m trying to achieve something with OGNL and I¹d like to know if it¹s
> possible and if so how to do it.
>
> In my action I have an object called surveyResult with setter/getter. I also
> have another object called questions with setter/getter.
>
> The question object has a string element called questionEntity which is in
> this case equal to ŒsurveyResult.initialvalue¹
>
> What I want to be able to do is use the value from the surveyEntity to get a
> value from the survey object.
>
> I¹ve tried <s:property value="%{questionEntity}"/> which just gives me
> ŒsurveyResult.intialvalue¹. Is there any way I can actually call
> surveyResult.intialvalue and get the stored value in surveyResult?
>
>
> Z.
>
>
>
So, I understand that:
surveyResult.questionEntity="surveyResult.initialValue" (a String)
and you want to perform a nested evaluation:
eg.
interimResult = evaluate("surveyResult.questionEntity");
finalResult = evaluate(interimResult);
The s:property tag does recognise nested expressions. My guess is this:
<s:property value="#root.%{surveyResult.questionEntity}/>
which reads: evaluate surveyResult.questionEntity, then get the property
with that name from the value stack.
**BUT, I can't remember if #root is right, or #stack, or #context.stack
#top or something like that; whatever it is that refers to the value
stack directly. This may be visible for the config browser.
The map notation may be clearer
<s:property value="#root[surveyResult.questionEntity]/>
In the worst case, you can invoke a method directly to get the stack.
Hope that helps a little,
Jeromy Evans
PS. I don't think this is a good idea as it is may be vulnerable to
injecting OGNL expressions depending on how surveyResult.questionEntity
is set.

Attachment:
user_189763.ezm (zipped)Hi Jeromy,
In short yes, I'm trying to do a nested evaluation. I screwed up the
description, but what you've described is what I'm trying to do. I tried all
the permutations you suggested plus more with still no joy. I've used the
reflection API as a backup but I'd prefer to use OGNL.
Any help from the OGNL gurus would be greatly appreciated.
Z.
> Zoran Avtarovski wrote:
>> I¹m trying to achieve something with OGNL and I¹d like to know if it¹s
>> possible and if so how to do it.
>>
>> In my action I have an object called surveyResult with setter/getter. I also
>> have another object called questions with setter/getter.
>>
>> The question object has a string element called questionEntity which is in
>> this case equal to ŒsurveyResult.initialvalue¹
>>
>> What I want to be able to do is use the value from the surveyEntity to get a
>> value from the survey object.
>>
>> I¹ve tried <s:property value="%{questionEntity}"/> which just gives me
>> ŒsurveyResult.intialvalue¹. Is there any way I can actually call
>> surveyResult.intialvalue and get the stored value in surveyResult?
>>
>>
>> Z.
>>
>>
>>
>
> So, I understand that:
> surveyResult.questionEntity="surveyResult.initialValue" (a String)
> and you want to perform a nested evaluation:
>
> eg.
> interimResult = evaluate("surveyResult.questionEntity");
> finalResult = evaluate(interimResult);
>
> The s:property tag does recognise nested expressions. My guess is this:
>
> <s:property value="#root.%{surveyResult.questionEntity}/>
>
> which reads: evaluate surveyResult.questionEntity, then get the property
> with that name from the value stack.
>
> **BUT, I can't remember if #root is right, or #stack, or #context.stack
> #top or something like that; whatever it is that refers to the value
> stack directly. This may be visible for the config browser.
>
> The map notation may be clearer
>
> <s:property value="#root[surveyResult.questionEntity]/>
>
> In the worst case, you can invoke a method directly to get the stack.
>
> Hope that helps a little,
> Jeromy Evans
>
> PS. I don't think this is a good idea as it is may be vulnerable to
> injecting OGNL expressions depending on how surveyResult.questionEntity
> is set.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment:
user_189766.ezm (zipped)Thanks Martin,
I understand that. But what I’m trying to do is take one parameter, evaluate
it and then evaluate the result.
For example:
I have a question bean with an surveyEntity attribute. The value is variable
and it may be 'surveyLong.initialValue'. I now want to evaluate this string
as an OGNL expression ie call getSurveyLong().getInitialValue();
I've done it using reflection, but reflection has a heavy performance
penalty and from what I've seen of OGNL, it doesn't.
Z.
>
> If surveyResult is a bean
> you can access initialvalue attribute with
>
> http://struts.apache.org/2.0.11.2/docs/tag-syntax.html
> ${surveyResult.initialvalue}
>
> HTH
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official business
> of Sender. This transmission is of a confidential nature and Sender does not
> endorse distribution to any party other than intended recipient. Sender does
> not necessarily endorse content contained within this transmission.
>
>
>> Date: Wed, 6 Aug 2008 22:49:09 +1000
>> Subject: Re: OGNL Help
>> From: zoran@(protected)
>> To: user@(protected)
>>
>> Hi Jeromy,
>>
>> In short yes, I'm trying to do a nested evaluation. I screwed up the
>> description, but what you've described is what I'm trying to do. I tried all
>> the permutations you suggested plus more with still no joy. I've used the
>> reflection API as a backup but I'd prefer to use OGNL.
>>
>> Any help from the OGNL gurus would be greatly appreciated.
>>
>> Z.
>>
>>
>>
>>> Zoran Avtarovski wrote:
>>>> I¹m trying to achieve something with OGNL and I¹d like to know if it¹s
>>>> possible and if so how to do it.
>>>>
>>>> In my action I have an object called surveyResult with setter/getter. I
>>>> also
>>>> have another object called questions with setter/getter.
>>>>
>>>> The questions object has a string element called questionEntity which is in
>>>> this case equal to ŒsurveyResult.initialvalue¹
>>>>
>>>> What I want to be able to do is use the value from the surveyEntity to get
>>>> a
>>>> value from the survey object.
>>>>
>>>> I¹ve tried <s:property value="%{questionEntity}"/> which just gives me
>>>> ŒsurveyResult.intialvalue¹. Is there any way I can actually call
>>>> surveyResult.intialvalue and get the stored value in surveyResult?
>>>>
>>>>
>>>> Z.
>>>>
>>>>
>>>>
>>>
>>> So, I understand that:
>>> surveyResult.questionEntity="surveyResult.initialValue" (a String)
>>> and you want to perform a nested evaluation:
>>>
>>> eg.
>>> interimResult = evaluate("surveyResult.questionEntity");
>>> finalResult = evaluate(interimResult);
>>>
>>> The s:property tag does recognise nested expressions. My guess is this:
>>>
>>> <s:property value="#root.%{surveyResult.questionEntity}/>
>>>
>>> which reads: evaluate surveyResult.questionEntity, then get the property
>>> with that name from the value stack.
>>>
>>> **BUT, I can't remember if #root is right, or #stack, or #context.stack
>>> #top or something like that; whatever it is that refers to the value
>>> stack directly. This may be visible for the config browser.
>>>
>>> The map notation may be clearer
>>>
>>> <s:property value="#root[surveyResult.questionEntity]/>
>>>
>>> In the worst case, you can invoke a method directly to get the stack.
>>>
>>> Hope that helps a little,
>>> Jeromy Evans
>>>
>>> PS. I don't think this is a good idea as it is may be vulnerable to
>>> injecting OGNL expressions depending on how surveyResult.questionEntity
>>> is set.
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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)
>>
>
>
> Get Windows Live and get whatever you need, wherever you are. Start here.
> <http://www.windowslive.com/default.html?ocid=TXT_TAGLM_WL_Home_082008>