blob: b96dbdaf1f7c4b24dae28070e70e32fea71ef863 [file] [log] [blame]
package org.apache.struts.helloworld.action;
import org.apache.struts.helloworld.model.MessageStore;
import com.opensymphony.xwork2.ActionSupport;
/**
* Acts as a Struts 2 controller that responds
* to a user action by setting the value
* of the Message model class, and returns a String
* result.
* @author Bruce Phillips
*
*/
public class HelloWorldAction extends ActionSupport {
private static final long serialVersionUID = 1L;
/**
* The model class that stores the message
* to display in the view.
*/
private MessageStore messageStore;
/*
* Creates the MessageStore model object and
* returns success. The MessageStore model
* object will be available to the view.
* (non-Javadoc)
* @see com.opensymphony.xwork2.ActionSupport#execute()
*/
public String execute() throws Exception {
messageStore = new MessageStore() ;
return SUCCESS;
}
public MessageStore getMessageStore() {
return messageStore;
}
public void setMessageStore(MessageStore messageStore) {
this.messageStore = messageStore;
}
}