I'm a
Struts newbie, trying to use Struts2 and DOJO. Here's my problem.
I want to call a Struts2 action from javascript so that there are parameters associated with it. This happens in DOJO in the TreeRPCController for loading data into a Tree widget, but it's a general question.
Now, suppose I have a URL link in javascript that's defined as 'DoSpiffyThings.action?data=ImportantStuffHere'. I'd like to be able to get that data parameter information in my action, via the ActionContext. Problem is I never see to get any parameter information, and the log shows me SEVERE errors with the ParametersInterceptor.
Now, I'm getting parameter information through a form I made with the Struts taglib. I see there's a <s:url> tag with the taglib, and it even takes parameters as a property or some such. I think I need to use this to make my URL in a Struts-happy way, so the ParametersInterceptor doesn't have problems, and I can access my parameters? Assuming this is true, it leads to two issues:
1. I can create this in the
JSP with something like:
<s:url value="DoSpiffyThings.action">
<s
aram name="data" value="ImportantStuffHere" />
</s:url>
But that's in the JSP taglib. What if I want to do this in Javascript?
2. Question 2: In the DOJO TreeRPCController implementation, you give it a base URL, and then it 'automagically' appends these two parameters to it when it calls that URL. That code is in the library, more or less untouchable. But I need it to attach parameters in such a way that it doesn't get the Struts2 ParametersInterceptor upset. How do I do this?