Hi,
In your action class you have to return null after you write the
response for eg:-
public String ajax() throws Exception {
respone.getWriter().println("hello");
respone.getWriter().close();
return null;
}
and also i dont think you need to specify the full URL
Man oh man that is going to fry the algorithms in my poor JSP editor, even if it
could cope with the stuff I force-feed it at the moment (which it doesn't).
Isn't there a non-OGNL way?
thanks
Adam
Zarar Siddiqi on 08/09/07 18:25, wrote:
Zarar
On 9/6/07, Adam Hardy <[EMAIL PROTECTED]> wro
Hi,
I am using a very basic AJAX code snippet with struts. No it's not
dojo.
req = new XMLHttpRequest();
var url='http://localhost:8084/StrutsAjax/example/SearchAJAX.action';
req.open("POST",url,true);
req.onreadystatechange=searchResults;
req.send(null);
in searchResults() function I
Some other things you can use:
${myActionProperty.subProperty!}
Prints nothing if subProperty doesn't exist or is null
${myActionProperty.subProperty?default("default value")
Prints "default value" if subProperty doesn't exist or is null
The first expression (ending with !) is most similar in
Zarar
On 9/6/07, Adam Hardy <[EMAIL PROTECTED]> wrote:
> I am using struts tags for the first time in a JSP with S2 and I haven't found
> what I'm looking for so I guess it's not available, but could I just check for
> certain?
>
> I want to put a string into a button using an i18n bundle. I tr
Freemarker considers null references errors. When
myActionProperty.subProperty is referenced in the Struts tag, it is
printed regardless of its value. However, when Freemarker encounters
${myActionProperty.subProperty}, it will give you an error if
subProperty is null. When trying to print Freem
Another option is to subclass the Struts 2 FilterDispatcher to perform
initializations:
public class YourAppDispatcher extends FilterDispatcher {
public void init(FilterConfig filterConfig) throws ServletException {
super.init(filterConfig);
// your initialization code here...
}
}
Gab
You can do the same with an application scope bean using spring . Create
a simple pojo that initializes values on the constructor. Then add an
entry to the applicationContext.xml file :
Then in your java action file that you wish to have access declare :
private MyComponent myComp;
and
8 matches
Mail list logo