Re: Struts2 with AJAX

2007-09-08 Thread Nuwan Chandrasoma
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

Re: [S2] struts tags

2007-09-08 Thread Adam Hardy
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

Struts2 with AJAX

2007-09-08 Thread animesh saxena
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

Re: Simple Question about FreeMarker + Struts 2

2007-09-08 Thread Jim Cushing
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

Re: [S2] struts tags

2007-09-08 Thread Zarar Siddiqi
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

Re: Simple Question about FreeMarker + Struts 2

2007-09-08 Thread Zarar Siddiqi
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

Re: Struts 2 : application-wide values initialization.

2007-09-08 Thread Gabriel Belingueres
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

Re: Struts 2 : application-wide values initialization.

2007-09-08 Thread Leonidas Papadakis
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