but,it is giving exception in log 14:51:03,558 WARN [OgnlUtil] Caught OgnlException while setting property 'serviceid' on type 'org.apache.struts2.dispatcher.ServletRedirectResult'. ognl.NoSuchPropertyException: org.apache.struts2.dispatcher.ServletRedirectResult.service
Do i know what it tries to set ? Thanks. Ted Husted wrote: > > There doesn't appear to be anything wrong with the script. You might > try it from another workstation. > > As to the underlying use case, it appears that we would like to open a > PHP page form a Struts Action. Another way to do that in Struts 2 > would be to redirect with parameters. Something like this might work: > > <action name="secureResponse" class="..."> > <result name="secureResponseResult" type="redirect"> > http://24.practice.jad/www_new/merchantRespo.php > ${serviceId} > ${customerId} > </result> > </action> > > Or using annotation > > @Result ( > name = "secureResponseResult", > value = "http://24.practice.jad/www_new/merchantRespo.php", > type = ServletRedirectResult.class, > params = {"serviceId", ${serviceId},"customerid", ${customerId} > ) > > -- HTH, Ted > * <http://www.StrutsMentor.com/> > > > On Dec 7, 2007 12:25 AM, jignesh(india) <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> I want to submit my <form automatically from resulted jsp in struts2 >> using >> javascript at the time of page loaded. >> I have tried ordinary javascript but it is not working..like >> document.frmname.submit(),document.forms[0].submit(); >> >> Can anyone help me why it isn't working. >> >> My code:- >> >> <body> >> <form name="secureResponsefrm" method="post" >> action="http://24.practice.jad/www_new/merchantRespo.php" id="frmid"> >> <s:hidden name="serviceid"/> >> <s:hidden name="customerid"/> >> <s:submit name="submit" value="Submit" id="submit"/> >> </form> >> </body> >> >> <script type="text/javascript"><!-- >> document.forms[0].submit(); >> //--></script> >> >> >> Each time page loaded it calls the script but giving javascript error >> message- >> >> Error:- >> document.forms[0].submit is not a function >> //--></script> >> >> Thanks in advanced. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Automatic-form-submission-using-javascript-in-struts2-tp14207071p14312586.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]