You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kamholz, Keith (corp-staff) USX" <kk...@moog.com> on 2002/07/29 22:07:44 UTC

calling reset() method

Hey everyone,
  It's an issue that many people see to keep asking, but I'm having a
problem with the <html:checkbox ... /> tag.  I'll try to be descriptive, but
not make my post too long.  I've gotten my app to work using it by manually
reseting the boolean values to false before going to the jsp.  However, when
I do this, the checkboxes are always unchecked when the user reaches the
form, and it's annoying for the user to have to recheck the boxes every time
another change is made.  So now I'm trying to do thing the "proper struts
way".  I know the reset() method is supposed to be automatically called on
the action form when you click on link to an action.  However, I put a
System.out.println("Message") in my reset method to see if it's being
called, and it's not.  I don't know why it's not being called.  Could anyone
help me out with this?  Here are a few code snippets:

_______________________________
struts-config.xml:

<action	path="/HeaderForward"
		type="com.moog.us.eos.actions.HeaderAction"
		name="HeaderBean"
		validate="false"
		scope="session"
		input="EditHeader.jsp">
		<forward name="headerForm" path="EditHeader.jsp"/>
</action>
_______________________________
JSP page:

<html:link page="/HeaderForward.do?action=forward">EDIT</html:link>
_______________________________
HeaderAction.java:

String command = request.getParameter("action");
HeaderBean header = (HeaderBean) form;
if(command.equals("forward"))
{
	System.out.println("Forwarding to Header Form");
	return mapping.findForward("headerForm");
}
_______________________________
HeaderBean.java:

public void reset(ActionMapping mapping, javax.servlet.ServletRequest
request)
{
	System.out.println("Reseting Header Bean");
	revLevel = false;
	vendorUpdate = false;
	standards = false;
}
_______________________________

Does anyone notice anything wrong?  If it makes any difference, my
HeaderBean is stored in the session.  I'm hoping someone can help me out
here.  Sorry if the post was long, but I didn't want to post a stupid
message that just said "My app isn't work, what's wrong?" because that means
nothing to anyone.  (Hint hint, for those of you that provide no info about
what you're trying to do when asking a question).  Any help here would be
greatly appreciated.
Thanks in advance!

~ Keith
http://www.buffalo.edu/~kkamholz

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>