Re: How to call a method passing a parameter inside jsp with struts 2
Apparently, you can only retrieve properties with the property tag (so it only allows you to call getName Methods with no parameters). However, I'm using the following workaround: s:push value=myMethod(myParameter) s:property value=top /s:push The push tag pushes a new object (the return value in this case) onto the value stack. It is this object I am refering to with top in my nested property tag. In my case, the object was a string, so I can directly use it. TonyD wrote: In a jsp page, I'am trying to call a method of my class passing a parameter and the method will return a string value. s:property value=#myClass.myMethod(myParameter) / or s:action name=myClass!myMethod executeResult=true s:param name=myParam value=%{myParam}/ /s:action but doesn't work. Could someone please help me! Thanks. -- View this message in context: http://www.nabble.com/How-to-call-a-method-passing-a-parameter-inside-jsp-with-struts-2-tp11779219p14301807.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Dojo] Pass topic parameters to action
Hi there, I'm using Struts 2.1.1 with the new dojo plugin library and I stumpled over the following problem for which I couldn't find any solution yet even after hours of searching the net. The application I'm building is a small calendar application that shows your absences in a monthly view. What I'd like to add is some kind of info bar that dynamically loads additional information as soon as the user hovers over an absence. At the moment, I'm using a parameterized url for each single absence (within an iterator): div id=userInfoBar/div s:url id=ajaxTest value=/AjaxInfo.action s:param name=uid value =userid/s:param /s:url sx:a href=%{ajaxTest} targets=userInfoBarShow Info/sx:a This now generates lots of ajax source code and it only works when I click on the link (but I want that it also works when I just move over the link with the mouse). From what I've seen this is possible with the bind tag and so I'd like to have is the following: s:a onmouseover=dojo.event.topic.publish('/request', userid)Show Info/sx:a sx:bind listenTopics=/request href=%{ajaxTest} targets=userInfoBar/ But how do I pass the userid object to my action? Every help is welcomed. Greetings, Matthias -- View this message in context: http://www.nabble.com/-Dojo--Pass-topic-parameters-to-action-tf4858767.html#a13904168 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]