Does your class implement Preparable interface? Do you have the interceptor in your interceptor stack? Also, check the syntax of the preparable method - it should be void like this
public class TestAction extends SomeClass implements Preparable { ... public void prepare() { log.debug("This should be called"); } ... } http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html On 8/6/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote: > > Hi, could you give me an actual example, because I added a method called > Prepare() in my class, but it never gets called. Here's my code: > > public String Prepare() { > log.debug("Populating form fields if a SMIG was selected"); > > // ... > > return SUCCESS; > } > > Nothing gets logged when the form is displayed. Is there something else > that needs to be setup in the jsp? > > Thanks, > Session > > > > Hi, > > > > Implement the prepare method in your action class and add the code in > that > > method. > > > > Thanks, > > > > Nuwan > > > > > > Session A Mwamufiya wrote: > >> Hi, > >> > >> I have a page with input fields, and would like my action to populate > >> those fields before they get displayed. This page is handled by a > >> certain action, but it is the result page from a different action (I > >> click on a button in the previous action form, and this one gets called > >> up). I put some logging in my code, and see that the execute() method > >> never gets called before the page is displayed. > >> > >> This is what my form looks like: <s:form action="SMIGCreation" > >> target="SMIGEditor"> <s:textfield name="smigVersion" > >> label="%{getText('smigVersion')}" /> <s:textfield name="smigDesc" > >> label="%{getText('smigDesc')}" /> <s:submit key="saveButton" > >> method="saveButtonPressed" /> </s:form> > >> > >> Any ideas? > >> > >> Thanks, Session > >> > >> > >> --------------------------------------------------------------------- > To > >> unsubscribe, e-mail: [EMAIL PROTECTED] For additional > >> commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > > --------------------------------------------------------------------- To > > unsubscribe, e-mail: [EMAIL PROTECTED] For additional > > commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >