I am using struts2 with Prototype api. I am trying to call an action class from Ajax.updater. Following is the actual code function save_customer_details(){ new Ajax.Updater(''my_div'', ''/jobs/saveCustomerDetails.action'',{ parameters: $(''cust_save'').serialize(), onCreate: saving(''customer_submit''), onComplete: function (){ Effect.Fade(''cust_status'', {from: 1.0, to: 0.0}); } }); } But when FilterDispatcher calls request.getRequestURI(), it gets the jsp uri from which i have called the save_customer_details script.... I am not getting. Any one who experienced such problem please help me Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I''m a little confused here. Are you experiencing a JavaScript error or is the Ajax post going to the wrong URL or are you getting an exception from your server? -justin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks justin. No it is not javascript error... let me describe the situation.. I have one jsp page /user/new.jsp. This jsp page contains one form element named cust_save. <form action="" onsubmit="return save_customer_details();" name="cust_save" id="cust_save"> </form> My script is function save_customer_details(){ new Ajax.Updater(''my_div'', ''/jobs/saveCustomerDetails.action'',{ parameters: $ (''cust_save'').serialize(), onCreate: saving(''customer_submit''), onComplete: function (){ Effect.Fade(''cust_status'', {from: 1.0, to: 0.0}); } }); } It generates a request object and send the request. But when struts2''s frontcontroller fetch the request.getRequestURI() to find out the action class, the getRequestURI() method returns /user/new.jsp. On Mar 12, 12:18 pm, "Justin Perkins" <justinperk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m a little confused here. Are you experiencing a JavaScript error or > is the Ajax post going to the wrong URL or are you getting an > exception from your server? > > -justin--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
If you are trying to do an Ajax submit of your form, and block the traditional form submit, your function needs to return false, or you can use this technique: <form action="/some/action/" onsubmit="saveCustomerDetails();return false;"> ... </form> Note that in the case when JavaScript is not present, you need to specify an action attribute to your form to allow for those clients to still submit the form (unless you are telling your users that Javascript is mandatory to use your application). I won''t be able to offer any help with your server-side problems. -justin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---