Author Login
Post Reply
user Digest 8 Aug 2008 12:15:21 -0000 Issue 8185
Topics (messages 189828 through 189853):
Re: ApplicationResources.properties and JavaScript
189828 by: nauke.
189830 by: Owen Berry
189831 by: nauke.
189832 by: Dave Newton
189834 by: nauke.
189837 by: Dave Newton
189839 by: Wes Wannemacher
Re: More OGNL Woes
189829 by: Becky.L.O'Sullivan.mhn.com
189833 by: Zoran Avtarovski
189836 by: Dave Newton
struts2 map of maps
189835 by: JeffShelley
189838 by: Dave Newton
189844 by: JeffShelley
Popup window
189840 by: mujoko mujoko
189842 by: Frans Thamura
Re: Tree Control events problem..
189841 by: Narayana S
Re: Struts 2 select tag
189843 by: srini vasan
Re: configuration doc for struts 1.3,tiles with Rad 7.5
189845 by: Antonio Petrelli
Re: <s:action/> redirect does not work with Tiles.
189846 by: Antonio Petrelli
189852 by: Jeromy Evans
problem with <s:text>
189847 by: Muralidhar Y
189849 by: Dave Newton
Re: struts2 select onchange to trigger ajax call
189848 by: Markus Doring
action-param
189850 by: Hrvoje Ban
Re: yikes! : net.sf.json.JSONException: There is a cycle in the hierarchy!
189851 by: Jeromy Evans
prepare called before "setId"
189853 by: Torsten Krah
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_189828.ezm (zipped)Thanks for that.
I think that only works if the javascript is within the JSP file right?
My javascript functions are in it's on .js file ...
On Thu, Aug 7, 2008 at 8:23 PM, Balwinder <balwinderk@(protected):
> nauke. wrote:
>
>> Hi all,
>>
>> Is there a way to access values in ApplicationResources.properties in
>> Javascript functions?
>> I've found a way where I can just pass a value from the app resource file
>> as
>> a parameter, but discovered that I return alerts with different messages
>> based on some criteria.
>>
>> Any ideas?
>>
>> Thanks heaps
>>
>>
>>
> Try this
> <script>
> var someVar = '<bean:message key="app.mykey" bundle="MESSAGE">';
> </script>
>
>
> hope this will serve the purpose.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189830.ezm (zipped)In your jsp code set a variable to be the value you want, as shown
earlier in this thread by Balwinder, and then read that variable in
your Javascript code. If you're using OO javascript, you can make it
nice and tidy by passing the parameter in your "constructor", or set
it in a method. Example:
var obj = new FancyObject('<bean:message key="app.mykey" bundle="MESSAGE">');
// -- or --
obj.setSomeValue('<bean:message key="app.mykey" bundle="MESSAGE">');
Make sense?
On Thu, Aug 7, 2008 at 7:03 PM, nauke. <nauke0@(protected):
> Thanks for that.
> I think that only works if the javascript is within the JSP file right?
> My javascript functions are in it's on .js file ...
>
> On Thu, Aug 7, 2008 at 8:23 PM, Balwinder <balwinderk@(protected):
>
>> nauke. wrote:
>>
>>> Hi all,
>>>
>>> Is there a way to access values in ApplicationResources.properties in
>>> Javascript functions?
>>> I've found a way where I can just pass a value from the app resource file
>>> as
>>> a parameter, but discovered that I return alerts with different messages
>>> based on some criteria.
>>>
>>> Any ideas?
>>>
>>> Thanks heaps
>>>
>>>
>>>
>> Try this
>> <script>
>> var someVar = '<bean:message key="app.mykey" bundle="MESSAGE">';
>> </script>
>>
>>
>> hope this will serve the purpose.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment:
user_189831.ezm (zipped)Hi Owen,
Thanks for your reply.
I think I did try that.
The only solution I have found to work was to do this:
Application.properties:
my.message=Hi There!
myJSPFile.jsp:
<input type="hidden" name="myMessage" value="my.message"/>
myJSFile.js
var msg = document.myform.myMessage.value;
alert(msg);
The deadline is today so I'll have to do what works so far :(((
Thanks heaps to all for trying to help.
There must be a more elegant solution than this!
Cheers
On Fri, Aug 8, 2008 at 8:58 AM, Owen Berry <owen.berry@(protected):
> In your jsp code set a variable to be the value you want, as shown
> earlier in this thread by Balwinder, and then read that variable in
> your Javascript code. If you're using OO javascript, you can make it
> nice and tidy by passing the parameter in your "constructor", or set
> it in a method. Example:
>
> var obj = new FancyObject('<bean:message key="app.mykey"
> bundle="MESSAGE">');
> // -- or --
> obj.setSomeValue('<bean:message key="app.mykey" bundle="MESSAGE">');
>
> Make sense?
>
> On Thu, Aug 7, 2008 at 7:03 PM, nauke. <nauke0@(protected):
> > Thanks for that.
> > I think that only works if the javascript is within the JSP file right?
> > My javascript functions are in it's on .js file ...
> >
> > On Thu, Aug 7, 2008 at 8:23 PM, Balwinder <balwinderk@(protected):
> >
> >> nauke. wrote:
> >>
> >>> Hi all,
> >>>
> >>> Is there a way to access values in ApplicationResources.properties in
> >>> Javascript functions?
> >>> I've found a way where I can just pass a value from the app resource
> file
> >>> as
> >>> a parameter, but discovered that I return alerts with different
> messages
> >>> based on some criteria.
> >>>
> >>> Any ideas?
> >>>
> >>> Thanks heaps
> >>>
> >>>
> >>>
> >> Try this
> >> <script>
> >> var someVar = '<bean:message key="app.mykey" bundle="MESSAGE">';
> >> </script>
> >>
> >>
> >> hope this will serve the purpose.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189832.ezm (zipped)--- On Thu, 8/7/08, nauke wrote:
> There must be a more elegant solution than this!
Not really: you're trying to access server-side resources from the client side. If you're not going to run your JavaScript through the JSP processor your options are limited, for obvious reasons.
One solution was already given to you: deal with server-side resources in the JSP, use them as arguments to JavaScript functions contained in an external JavaScript file, by using custom tags, scriptlets, etc. to set parameter values.
You can also generate JavaScript on the server-side by means other than a JSP (FreeMarker, servlet, etc.), or generate JavaScript during the build process, or generate the JavaScript at application startup, or use something like DWR to access a Java object that loads resources at runtime, or... ad nauseum.
The underlying issue won't go away; there's client-side resources, and there's server-side resources. That's one of the many unfortunate natures of web applications, AFAICT.
Dave

Attachment:
user_189834.ezm (zipped)Hi Dave,
Thanks for replying.
Yeah I declared variables in my JSP file and tried to parse them through as
arguments to the JavaScript function like mentioned.
No matter how I tried to pass those values in as parameters, my JavaScript
function kept treating it as literal text hehe!
Like:
<%=String aString = "Hi There!"%>
onclick="return myFunc('<%=aString%>');"
myFunc would print out "<%=aString%>" rather than "Hi There!".
Also tried:
myFunc(<%=aString%>);
i.e. without the single quotes.
Also tried:
myFunc('msg')
etc etc.
Funny because I've done this in other JSPs.
Yes that underlying fact with client and server side resources.
Ah well ... Thanks again.
Nicole
On Fri, Aug 8, 2008 at 9:27 AM, Dave Newton <newton.dave@(protected):
> --- On Thu, 8/7/08, nauke wrote:
> > There must be a more elegant solution than this!
>
> Not really: you're trying to access server-side resources from the client
> side. If you're not going to run your JavaScript through the JSP processor
> your options are limited, for obvious reasons.
>
> One solution was already given to you: deal with server-side resources in
> the JSP, use them as arguments to JavaScript functions contained in an
> external JavaScript file, by using custom tags, scriptlets, etc. to set
> parameter values.
>
> You can also generate JavaScript on the server-side by means other than a
> JSP (FreeMarker, servlet, etc.), or generate JavaScript during the build
> process, or generate the JavaScript at application startup, or use something
> like DWR to access a Java object that loads resources at runtime, or... ad
> nauseum.
>
> The underlying issue won't go away; there's client-side resources, and
> there's server-side resources. That's one of the many unfortunate natures of
> web applications, AFAICT.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189837.ezm (zipped)--- On Thu, 8/7/08, nauke. <nauke0@(protected):
> No matter how I tried to pass those values in as
> parameters, my JavaScript function kept treating
> it as literal text
>
> Like:
>
> <%=String aString = "Hi There!"%>
That's most likely not what you wanted, you mean:
<% String aString = "Hi There!"; %>
Hopefully that was typos.
> onclick="return myFunc('<%=aString%>');"
Do you have scriptlets enabled?
> myFunc('msg')
Er, if *that* doesn't work, then you've done something horribly wrong, because that's just calling a JavaScript function with a literal string.
Dave

Attachment:
user_189839.ezm (zipped)On Thu, 2008-08-07 at 17:43 -0700, Dave Newton wrote:
> --- On Thu, 8/7/08, nauke. <nauke0@(protected):
> > No matter how I tried to pass those values in as
> > parameters, my JavaScript function kept treating
> > it as literal text
> >
> > Like:
> >
> > <%=String aString = "Hi There!"%>
Periodically, I run into this problem and find out that I don't have
*.js files mapped to the JSP servlet in Tomcat. It may not be your
problem, but if you are running javascript that comes from a separate
file with a .js file extension, tags and scriptlets don't work unless
you have mapped them to the JSP servlet.
I've had this problem when using tags in both JS and CSS files. It's
easy enough to fix, but it's a mistake I make with every project I start
from scratch and always takes me an hour or more to figure out :)
-Wes
PS - Dave, I caught myself this time, I almost sent this only to you
again!

Attachment:
user_189829.ezm (zipped)I had the same problem, and someone pointed out to me that it does say in
the s:include reference page
(http://struts.apache.org/2.x/docs/include.html) that parameters passedvia
s:include are not available on the stack. Well...it doesn't phrase it that
way, but that's basically it.
Yes, it's silly......but what to do about it?
I kludged it by using JSTL to insert that parameter into the page context.
Put this in your included page:
<c:set var="myParam" value="${param.myParam}"/>
Then #attr.myParam will work.
-B
PS: Your email was funny but I almost deleted it b/c it took four
paragraphs just to get to your issue.... :)
Zoran Avtarovski
<zoran@(protected)
ive.com> To
Struts Users Mailing List
08/07/2008 12:28 <user@(protected)>
PM cc
Subject
Please respond to More OGNL Woes
"Struts Users
Mailing List"
<user@(protected)
he.org>
I¹m really starting to develop a love-hate (and fear) relationship with
OGNL. Please bear with my long winded explanation, it' therapeutic (for me
at least). And, please, I really do need help.
I'm finding using OGNL like dating a supermodel, who also suffers from
multiple personality disorder and Turrets. At first it's hello OGNL, your
having breakfast at some uptown café, expensive glossy mags littered around
the place, ordering eggs on some exotic bread and coffee that monkeys
excrete. You know the feeling. You're interacting with stack, calling
methods, the odd lambda expression. Your on top of the world. It's a case
of
JSP - who, expression language - what?
Next thing you know, BAM!! You're wearing your breakfast, feeling the pain
of 300 pages of last month's Italian Vogue across the back of your head and
longing for the security of a bagel and filtered coffee with JSP.
Take my current problem. A simple task of passing a parameter to an
included
page.
<s:include value="myPage.jsp>
<s:param name="myParam">2</s:param>
</s:include>
And in myPage.jsp I have
<s:property value="#parameters.myParam/>
BAM!! There's that Italian Vogue again.
So I try:
<s:property value="#parameters['myParam']/>
and
<s:property value="%{#parameters.myParam}/>
and
<s:property value="myParam/>
and
<s:property value=%{myParam}/>
Now I'm reaching for the Ibuprofen. You also see where the Turrets comes
in.
If I now look at my once loved, then hated, now missed JSP:
<c:import url="myPage.jsp">
<c:param name=myParam">2</c:param>
</c:import>
And in myPage.jsp I have ${params.myParam}. Bingo! Bagel and coffee.
Please somebody please point out my error as I know it must be MY ERROR,
but
I just can't see it.
I've read the stuff on the struts wiki which indicates that my example
should be working. The OGNL site is too generic to be of much use here.
As an aside, if any budding author wants to produce an InfoQ style guide to
OGNL and struts I'd happily spring for it.
I'm not asking a lot. We all have flaws. I'd just like to settle into a
little monogamy for a while - until the next supermodel at least.
Z.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.
---------------------------------------------------------------------

Attachment:
user_189833.ezm (zipped)Thanks to everybody who replied. But what I¹m hearing is that the OGNL
implementation in Struts2 is half arsed.
Musachy, if you look at the docs
http://struts.apache.org/2.x/docs/ognl-basics.html it tells me that
parameters is a named object. I tend to believe you, but how I would I know.
And in this case it doesn¹t work either way.
Andre, thanks for the workaround but I already had one. My issue was that
something this simple shouldn¹t need a work-around.
Becky, you think it¹s silly, but I think it¹s ridiculous. You pass
parameters to a page with a S2 tag but can¹t retrieve them when on that
page, WTF. Why bother allowing it in the first place.
# rant warning #
This is the sort of stuff that drives new developers to other frameworks. I
know in our case the decision was made to move from Struts to Struts 2
without a lot of input. Constant crap like this results in pressure from
younger developers to go to wicket or some other framework. These guys
aren¹t idiots either, they are putting together compelling arguments like
ease-of-use and short ramp up periods.
I notice from reading the developer list that Musachy is a leading advocate
of casting aside dead weight. I couldn¹t agree more especially at this early
stage of the frameworks lifecycle. I think that before 2.1 becomes an
official release crap like this issue and the useless ajax plugin should be
cast aside. Nobody is expecting 2.1 to be a drop in for 2.
# end of rant #
Again thank for your help and I¹m sorry the we couldn¹t get a better
resolution.
Z.

Attachment:
user_189836.ezm (zipped)--- On Thu, 8/7/08, Zoran Avtarovski wrote:
> You pass parameters to a page with a S2 tag but can¹t
> retrieve them when on that page, WTF. Why bother allowing
> it in the first place.
You *can* retrieve them, just not in the way you want. They're added as request parameters and available via JSP EL like so:
${param.foo}
I'm a bit fuzzy on the details but I don't believe the action tag goes through the normal request process but instead invokes the action through a proxy--that may short-circuit the interceptor stack and so on, but I'd rather someone with a bit more knowledge tackled that question.
Personally I think the action tag has more serious issues than this relatively minor one.
> I notice from reading the developer list that Musachy is a
> leading advocate of casting aside dead weight. I couldn¹t
> agree more especially at this early stage of the frameworks
> lifecycle.
Not all that early, really.
> I think that before 2.1 becomes an official release crap like
> this issue and the useless ajax plugin should be cast aside.
Since you follow struts-dev you know that issues like this are discussed frequently. Also bear in mind that *your* useless may not be somebody else's. And, as with all volunteer efforts, the things that matter most to the committers are the ones that tend to get dealt with first, and that time is often quite limited.
If you have a particular itch to scratch patches are always welcome--feel free to contribute a fix (or more) to the action tag so it exhibits the behavior you want (or a completely new tag); it'll most likely be reviewed and evaluated.
Dave

Attachment:
user_189835.ezm (zipped)
I'm trying to set a whole hierarchy (from a TON of checkboxes) coming in to a
request and not having much luck. I'm using the spring object factory.
I don't know whether the problem is in xwork, Spring, Struts or me. Is what
I'm trying even possible?
Thanks!
--Jeff
------------EXAMPLE-------------------
Here's a simple case of what I'd like to do:
http://localhost:8080/picsWeb2/Test.action?data[12][5][hi]=true
Here's the error I'm getting: ERROR - ParametersInterceptor -
[setParameters]: Unexpected Exception caught setting 'data[12][5][hi]' on
'class TestAction: Error setting expression 'data[12][5][hi]' with value
'[Ljava.lang.String;@(protected)'
And here's the code:
public class TestAction extends ActionSupport {
protected Map<Integer, Map<Integer, Map<String, Boolean>>> data = null;
public String execute()
{
return SUCCESS;
}
public Map<Integer, Map<Integer, Map<String, Boolean>>> getData() {
return data;
}
public void setData(Map<Integer, Map<Integer, Map<String, Boolean>>> data)
{
this.data = data;
}
}
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189838.ezm (zipped)--- On Thu, 8/7/08, JeffShelley <jshelley@(protected):
> I'm trying to set a whole hierarchy (from a TON of checkboxes) coming
> in to a request and not having much luck. I'm using the spring
> object factory.
Well at first glance, I'm pretty sure that "[hi]" isn't going to work, since the "hi" isn't enclosed in quotes, so will make a crappy string.
> I don't know whether the problem is in xwork, Spring,
> Struts or me. Is what I'm trying even possible?
I've used a slightly different, but similar, hierarchy without issues.
Not sure what Spring has to do with anything here.
Dave
> ------------EXAMPLE-------------------
>
> Here's a simple case of what I'd like to do:
>
> http://localhost:8080/picsWeb2/Test.action?data[12][5][hi]=true
>
> Here's the error I'm getting: ERROR -
> ParametersInterceptor -
> [setParameters]: Unexpected Exception caught setting
> 'data[12][5][hi]' on
> 'class TestAction: Error setting expression
> 'data[12][5][hi]' with value
> '[Ljava.lang.String;@(protected)'
>
>
> And here's the code:
> public class TestAction extends ActionSupport {
>
> protected Map<Integer, Map<Integer, Map<String,
> Boolean>>> data = null;
>
> public String execute()
> {
> return SUCCESS;
> }
>
> public Map<Integer, Map<Integer, Map<String,
> Boolean>>> getData() {
> return data;
> }
>
> public void setData(Map<Integer, Map<Integer,
> Map<String, Boolean>>> data)
> {
> this.data = data;
> }
> }
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/struts2-map-of-maps-tp18882730p18882730.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)

Attachment:
user_189844.ezm (zipped)
Thanks Dave. It actually looks like adding the ticks doesn't work (though
I'll confirm that IS a reason why it wouldn't work).
It's good to know someone's gotten something similar working, though... I'll
keep tinkering with it.
Is there any word on getting a more verbose error message than this?
ParametersInterceptor - [setParameters]: Unexpected Exception caught setting
'data[12][5][hi]' on 'class TestAction: Error setting expression
'data[12][5][hi]' with value '[Ljava.lang.String;@(protected)'
Thanks again!
newton.dave wrote:
>
> --- On Thu, 8/7/08, JeffShelley <jshelley@(protected):
>> I'm trying to set a whole hierarchy (from a TON of checkboxes) coming
>> in to a request and not having much luck. I'm using the spring
>> object factory.
>
> Well at first glance, I'm pretty sure that "[hi]" isn't going to work,
> since the "hi" isn't enclosed in quotes, so will make a crappy string.
>
>> I don't know whether the problem is in xwork, Spring,
>> Struts or me. Is what I'm trying even possible?
>
> I've used a slightly different, but similar, hierarchy without issues.
>
> Not sure what Spring has to do with anything here.
>
> Dave
>
>> ------------EXAMPLE-------------------
>>
>> Here's a simple case of what I'd like to do:
>>
>> http://localhost:8080/picsWeb2/Test.action?data[12][5][hi]=true
>>
>> Here's the error I'm getting: ERROR -
>> ParametersInterceptor -
>> [setParameters]: Unexpected Exception caught setting
>> 'data[12][5][hi]' on
>> 'class TestAction: Error setting expression
>> 'data[12][5][hi]' with value
>> '[Ljava.lang.String;@(protected)'
>>
>>
>> And here's the code:
>> public class TestAction extends ActionSupport {
>>
>> protected Map<Integer, Map<Integer, Map<String,
>> Boolean>>> data = null;
>>
>> public String execute()
>> {
>> return SUCCESS;
>> }
>>
>> public Map<Integer, Map<Integer, Map<String,
>> Boolean>>> getData() {
>> return data;
>> }
>>
>> public void setData(Map<Integer, Map<Integer,
>> Map<String, Boolean>>> data)
>> {
>> this.data = data;
>> }
>> }
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/struts2-map-of-maps-tp18882730p18882730.html
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail:
>> user-help@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189840.ezm (zipped)Dear Struts 2 users
I'm trying to create poup window in struts 2,
Could you please to give sample code for this task in struts 2?
regard
--
Mujoko

Attachment:
user_189842.ezm (zipped)On Fri, Aug 8, 2008 at 9:08 AM, mujoko mujoko <mujoko.mujoko@(protected):
> Dear Struts 2 users
>
>
> I'm trying to create poup window in struts 2,
> Could you please to give sample code for this task in struts 2?
>
>
taka a look our cimande project
http://www.sf.net/projects/cimande
we use a lot of popup reference there
F

Attachment:
user_189841.ezm (zipped)Did any one see this mail ? :(
On Thu, Aug 7, 2008 at 12:52 PM, Narayana S <narayanasgs1@(protected):
> Hi,
>
> in my project i need to use a tree control, i have started looking
> at tree tag of struts, but though i wrote some event handle, it is not at
> all executing any events. he is the part of code...
>
> <head>
> <title>Showcase - UI Tag Example - Tree Example (Static)</title>
> <s:head theme="ajax" debug="true" />
> </head>
> <body>
> *<script>
> function treeNodeSelected(nodeId) {
> alert("Hi");
> }
> dojo.event.topic.subscribe("treeSelected", this, "treeNodeSelected");
> </script>*
>
>
> <div style="float:left; margin-right: 50px;">
> <s:tree label="parent" id="parentId" theme="ajax"
> treeSelectedTopic="treeSelected">
> <s:treenode theme="ajax" label="child1" id="child1Id">
> <s:treenode theme="ajax" label="grandchild1" id="grandchild1Id"/>
> <s:treenode theme="ajax" label="grandchild2" id="grandchild2Id"/>
> <s:treenode theme="ajax" label="grandchild3" id="grandchild3Id"/>
> </s:treenode>
> <s:treenode theme="ajax" label="child2" id="child2Id"/>
> <s:treenode theme="ajax" label="child3" id="child3Id"/>
> <s:treenode theme="ajax" label="child4" id="child4Id"/>
> ----
> -----
>
> can you please suggest some solution to this? i am using struts
> 2.0.11
>

Attachment:
user_189843.ezm (zipped)Hi,
If you are trying to retrieve the arraylist data assigned in the action u
need to do the following.
If this is ur problem try the below code
For ex :
private ArrayList aldata;//ArrayList declaration
and in jsp u need to add it as
<s:select label="names" list="aldata"/>
On Mon, Jul 28, 2008 at 11:43 PM, Deepika Appana
<deepika.appana@(protected):
> Hi,
>
> I am a newbie to struts 2. I have a question about the struts 2 select tag.
>
> When I try to use a property defined in package.properties for the "list",
> For Eg:
>
> <s:select label="Names" list="project.names"/>
>
> (project.names is defined in the package.properties)
> i get an exception that states that the project.names is not a enumeration
> or map. I am wondering why it does not evaluate to the list that I have
> defined in the properties file.
>
> Thanks,
>
> D
>

Attachment:
user_189845.ezm (zipped)2008/8/7 sam thothi <samthothi@(protected)>:
> If i change it to 1.3 , then i get the following error in the tiles plugin
What error? Is there a stack trace? If yes, post it here.
Antonio

Attachment:
user_189846.ezm (zipped)2008/8/7 Griffith, Michael * <Michael.Griffith@(protected)>:
> I cannot make <s:action/> result go to a new page. Chaining the result
> does work, but the response shows my entire tile set showing up in the
> inside tile, which is not what I want either.
Version of Struts and Tiles?
Antonio

Attachment:
user_189852.ezm (zipped)Griffith, Michael * wrote:
> Hello All,
>
>
>
> I cannot make <s:action/> result go to a new page. Chaining the result
> does work, but the response shows my entire tile set showing up in the
> inside tile, which is not what I want either.
>
>
Assuming Struts2, the s:action tag can only execute an action and
execute where that result can be included within the current
outputstream (eg. including a JSP fragment).
I redirect result makes no sense in this context as the output stream is
already open and written to.
I can confirm that a Tiles result (Struts2 result of type tiles) does
not work in this context either as it throws an exception that the
outputstream has already been opened (or something like that; I can't
recall exactly but it's in JIRA somewhere under the Tiles2 plugin).
In cases where I've needed this behaviour I've referenced the JSP
instead of a Tile.
Hope that helps,
Jeromy Evans

Attachment:
user_189847.ezm (zipped)Hi Friends, when I use
<head>
<title><s:text name="P_Search_Page" /></title>
</head>
it is taking the value from the properties file and showing title on the
browser window. Until this it is fine but it also adding a header in the
body tag like
div class="header">
<h1>search page</h1>
</div>
In the <body> tag. I don't want this to happen. I just want to take the
value from the properties file and display in the title. Nothing should be
added in the body when rendered as an html file Did any body faced the same
problem?
Thanks in advance.
Warm regards,
Muralidhar Y
muralidhary@(protected)
US Main: 877 KENSIUM (536.7486)
India Main: +91 9949495511
India Fax: +91 9949495522
Kensium
200 S Wacker Dr, Suite 3100
Chicago, IL 60606
Confidentiality Note:
-----------------------------
The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.
If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.
_____

Attachment:
user_189849.ezm (zipped)--- On Fri, 8/8/08, Muralidhar Y <muralidhary@(protected):
> when I use
> <head>
> <title><s:text name="P_Search_Page" /></title>
> </head>
>
> it also adding a header in the body tag like
>
> <div class="header">
> <h1>search page</h1>
> </div>
I find it unlikely that the <s:text.../> tag is adding an element to your body element. AFAIK the text tag has no ability to do this. I'd suggest posting more information about the source JSP, your configuration, etc.
Dave

Attachment:
user_189848.ezm (zipped)
Thanks Dave, that works!
I finally also found a working example here:
http://javachamp.blogspot.com/2008/06/struts-2-ajax-drop-down-example.html
You can actually get rid of any javascript functions and just publish the
topic in the onchange and use die struts div tag to do the rest:
<s:form id="regionClassForm" theme="ajax" action="occResourceStatsByRegion"
namespace="/ajax">
<s:hidden name="resource_id" value="%{resource_id}" />
<s:select name="region" list="regionClasses" value="region"
onchange="dojo.event.topic.publish('imgByRegion_topic');return false;"
theme="ajax"/>
</s:form>
<s:url id="imgByRegionUrl" action="occResourceStatsByRegion"
namespace="/ajax" includeParams="none"/>
<s:div id="imgByRegion" href="%{imgByRegionUrl}" formId="regionClassForm"
listenTopics="imgByRegion_topic" theme="ajax"></s:div>
pretty nice.
Markus
newton.dave wrote:
>
> Did you try publishing a topic onchange and having the div have that topic
> in its listenTopics?
>
> Dave
>
>
> --- On Thu, 8/7/08, Markus Doring <mdoering@(protected):
>
>> From: Markus Doring <mdoering@(protected)>
>> Subject: struts2 select onchange to trigger ajax call
>> To: user@(protected)
>> Date: Thursday, August 7, 2008, 3:37 PM
>> I would like to have an onchange event from a select element
>> to trigger an
>> AJAX call that replaces a div.
>>
>> I was trying to use the struts 2.0.11 ajax theme, but I
>> cant find a why to
>> bind the select element to my div. In struts 2.1 I should
>> be able to use
>> sx:bind, but that is not available in 2.0.11 unfortunately.
>>
>> If I use a simple s:a anchor to trigger the call all works
>> well:
>>
>> <s:form id="regionClassForm"
>> theme="ajax" action="statsByTaxon"
>> namespace="/ajax">
>> <s:select id="rank" name="rank"
>> list="ranks" value="rank"
>> theme="ajax"/>
>> <s:a id ="myBelovedAnchor"
>> targets="imgByTaxon" theme="ajax">
>> </s:a>
>> </s:form>
>> <s:div id="imgByTaxon">
>> <s:action name="statsByTaxon"
>> namespace="/ajax"
>> executeResult="true"/>
>> </s:div>
>>
>>
>> Any ideas how I can bind the select onChange() event to...
>> well, to what
>> really?
>> I also tried to use dojo.connect() to bind the onchange to
>> the onclick of
>> the anchor like this without success:
>>
>> function init() {
>> var sel = dojo.byId("rank");
>> var anch = dojo.byId("myBelovedTrigger");
>> dojo.event.connect(sel, "onChange", anch,
>> "onClick");
>> }
>>
>>
>> thanks,
>> Markus
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/struts2-select-onchange-to-trigger-ajax-call-tp18878122p18878122.html
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail:
>> user-help@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189850.ezm (zipped)<action name="*">
<param name="something">something</param>
</action>
What is the use of param here? I thought it would call
setSomething("something") on my action, but it won't.

Attachment:
user_189851.ezm (zipped)John Moose wrote:
> Anyone know what this means?? How can I change the pre-configured STRICT
> strategy :
> net.sf.json.util.CycleDetectionStrategy$StrictCycleDetectionStrategy to
> LENIENT ?? and will that even help me here?
> Using Hibernate 3.1 with Struts 2.1.3 and the REST plugin. XML serializaion
> works fine after changing Hiberbate lazy loading to FALSE...
>
> Stacktraces *net.sf.json.JSONException: There is a cycle in the hierarchy!*
>
>
>
It means you have a bidirectional association between two of your
entities (common).
Change the CycleDetectionStrategy discussed at jsonlib
http://json-lib.sourceforge.net/usage.html
In struts2, substitute the default JSON ContentTypeHandler with one that
uses jsonlib with your customized settings.
Hope that helps.
Jeromy Evans

Attachment:
user_189853.ezm (zipped)Hi.
I am implementing Preparable Interface to prefill my form.
But prepare gets called before the setter with the id needed is called.
Paramaters should be set first (before prepare) call, shouldn't it?
Is this a known bug - or did i missed something (using struts 2.0.11.2).
--
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html
Really, I'm not out to destroy Microsoft. That will just be a
completely unintentional side effect."
-- Linus Torvalds

Attachment:
smime.p7s (zipped)