struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Narayana <>
Subject struts1 with Ajax using struts tags
Date Tue, 12 Nov 2013 03:35:27 GMT
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" %>

RegisterForm form = (RegisterForm)session.getAttribute("registerForm");
 String user = (form.getUsername() == null) ?"inr" :form.getUsername();
 String pass = form.getPassword().equals("")?"inr"  : form.getPassword();
 <html:form  action="/details">
<html:text property=&quot;username&quot; value=&quot;&lt;%=user %>"
></html:text>  </br> Login Success

<html:button property="VIEW" value = "VIEW"
onclick="retrieveURL('');" />


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;
                        return mapping.findForward("success");


View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message