struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manuel Correa" <mcor...@itos.uga.edu>
Subject get properties action for theme ajax
Date Wed, 08 Aug 2007 20:04:19 GMT
How I get the properties (variable result) when the for is submit with
Ajax theme, look:

 

Form:

 

<s:div theme="ajax" id="success"

        loadingText="Loading information..." 

        errorText="Unable to contact server"

        href="${pageContext.request.contextPath}/success.jsp"

        listenTopics="/refresh" 

        > 

        

</s:div>

 

 

<s:form action="Person_save" id="person"  >

<s:textfield name="person.firstName" id="person.firstName"
label="FirstName"  />

<s:textfield name="person.lastName" id="person.lastName"
label="LastName"  />

<s:textfield name="person.age" id="person.age" label="age"  />   

<s:submit theme="ajax" notifyTopics=/save,/refresh"    />

</s:form>

 

The Person_save is a action that return success or error and set one var
names "msg" when some message to the user, I want to show that message,
if I don't use the Ajax Theme, everything is fine. 

 

public String save(){

      try{

 

            personDAO.persist(person);

            System.out.println("person->"+person.getId());

            msg = "The data was save in DB";

            return Action.SUCCESS;

            }catch(Exception e){

                  msg = "Error saving Data!!";

                  return Action.ERROR;

            }

    }

 

 

Manuel Correa.

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message