Well, you *may* do that, but it's not a requirement; Ajax may return HTML etc.
On Tue, Nov 12, 2013 at 2:34 PM, Paul Benedict <pbened...@apache.org> wrote: > When you do AJAX in S1, you are always responding directly to the browser. > You need to write your data to the ServletOutputStream and return null. You > do not need to use any ActionForward. > > Paul > > > On Mon, Nov 11, 2013 at 9:35 PM, Narayana > <narayanareddy.inako...@gmail.com>wrote: > > > I have a problem/doubt and describing here.I am using struts1.1(no plain > > jsp's only struts tags) and needs to implement ajax in that.Q-1) With out > > giving "action" property can't we write ?. If no I am using ajax in that > > form(now my form having button to submit form data). Could any one please > > help how to add my response back to form variable in same page. > > > > <%@page import="app.RegisterForm"%> > > <%@ taglib uri="/xyz" prefix="html" %> > > <head> > > > > > > </head> > > <% > > RegisterForm form = (RegisterForm)session.getAttribute("registerForm"); > > > > String user = (form.getUsername() == null) ?"inr" :form.getUsername(); > > String pass = form.getPassword().equals("")?"inr" : form.getPassword(); > > > > //retrieveURL('example3GetCharacters.do'); > > %> > > <html:form action="/details"> > > > > <html:text property="username" value="<%=user %>" > > ></html:text> </br> Login Success > > > > <html:button property="VIEW" value = "VIEW" > > onclick="retrieveURL('details.do');" /> > > > > </html:form> > > > > > > > > > > my action class is > > > > > > package app; > > > > import javax.servlet.http.HttpServletRequest; > > import javax.servlet.http.HttpServletResponse; > > > > import org.apache.struts.action.Action; > > import org.apache.struts.action.ActionForm; > > import org.apache.struts.action.ActionForward; > > import org.apache.struts.action.ActionMapping; > > > > public class DetailsAction extends Action { > > > > public ActionForward execute(ActionMapping mapping,ActionForm > > > > form,HttpServletRequest > request,HttpServletResponse > > response)throws Exception > > > > { > > RegisterForm detailsForm = (RegisterForm)form; > > > > detailsForm.setUsername("Struts"); > > > > System.out.println("inr"+detailsForm.getUsername()); > > return mapping.findForward("success"); > > } > > > > > > } > > > > > > > > -- > > View this message in context: > > > http://struts.1045723.n5.nabble.com/struts1-with-Ajax-using-struts-tags-tp5714637.html > > Sent from the Struts - User mailing list archive at Nabble.com. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > > -- > Cheers, > Paul > -- e: davelnew...@gmail.com m: 908-380-8699 s: davelnewton_skype t: @dave_newton <https://twitter.com/dave_newton> b: Bucky Bits <http://buckybits.blogspot.com/> g: davelnewton <https://github.com/davelnewton> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>