You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Leticia Golubov <lg...@micromuse.com> on 2004/01/12 17:24:38 UTC

Displaying same page after submiting a form

I'm using the following code to submit an action in a .jsp file
(config_toolbar.jsp):

<html:form method="post" action="/saveData" name="saveForm" type="text/html"
type="org.apache.struts.action.DynaActionForm" enctype="text/html">
    <td><a onClick="javascript:void(document.saveForm.submit());"

onMouseOver="javascript:SwapImage('save','../../images/button_toolbar_save_o
ver.png'); SetStatus('Save Configuration'); return true;"

onMouseOut="javascript:SwapImage('save','../../images/button_toolbar_save.pn
g'); SetStatus(''); return true;"

onMouseDown="javascript:SwapImage('save','../../images/button_toolbar_save_c
lick.png');"

onMouseUp="javascript:SwapImage('save','../../images/button_toolbar_save_ove
r.png');">
    <img name="save" src="../../images/button_toolbar_save.png" border="0"
width="26" height="26" alt="Save Configuration"></a></td>
 </html:form>

The action is found/executed, and, as a default I'm returning a
findforward("success") at the end of the ActionForward method in my
SaveAction.java class.

in struts_config.xml I have the following defined:
  <action path="/saveData"
        type="com.micromuse.precision.disco.action.SaveAction"
        name="saveDataForm"
        parameter="/pages/disco/config_toolbar.jsp"
        scope="session">
  </action>

In the hope that config_toolbar.jsp will still be displayed instead of the
blank page I get after I do a mouseClick on the button_toolbar_save.png
image.  I've tried setting the forward name to the config_toolbar.jsp, but
that caused strange side effect (all images were missing, the page didn't
display properly).

So, essentiall, I want the same page to be displayed after the saveData
action is executed.  Does anyone know how to do this?

p.s. I'm new to struts, so could (and I hope it is) be something very
simple.

regards

Leticia :)