Hello there! I am new in using ajax for jsp so I am asking for your help in my problem. I have this code: Writer writer = response.getWriter(); response.setContentType("text/xml"); response.setHeader("Cache-Control", "no-cache"); writer.write("<message>hi</message>"); writer.flush(); which successfully writes an xml file andthe receiving jsp file successfully reads it by: var req; if (typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } req.responseXML.getElementsByTagName("message")[0]; However, does anyone know where it places the said xml and and the name of the said xml file? Thank you so much! --~--~---------~--~----~------------~-------~--~----~ 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 believe you are trying to start a download, and with this presumption i give you this: http://encosia.com/2007/02/23/ajax-file-downloads-and-iframes/ On Nov 20, 2007 9:11 PM, Paw <paw1523-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > Hello there! I am new in using ajax for jsp so I am asking for your > help in my problem. I have this code: > > Writer writer = response.getWriter(); > response.setContentType("text/xml"); > response.setHeader("Cache-Control", "no-cache"); > writer.write("<message>hi</message>"); > writer.flush(); > > which successfully writes an xml file andthe receiving jsp file > successfully reads it by: > > var req; > if (typeof XMLHttpRequest != "undefined") { > req = new XMLHttpRequest(); > } else if (window.ActiveXObject) { > req = new ActiveXObject("Microsoft.XMLHTTP"); > } > req.responseXML.getElementsByTagName("message")[0]; > > However, does anyone know where it places the said xml and and the > name of the said xml file? Thank you so much! > > >--~--~---------~--~----~------------~-------~--~----~ 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 for the suggestion but I am not trying to start a download. I just want to know where does the code: Writer writer = response.getWriter(); response.setContentType("text/xml"); response.setHeader("Cache-Control", "no-cache"); writer.write("<message>hi</message>"); writer.flush(); write the xml file and what is the name of the said excel file --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ok... i''m missing some kind of critical piece of information... what do you want to do with that file? parse it? open it with excel? upload it back to the server? On Nov 21, 2007 1:32 AM, Paw <paw1523-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > Thanks for the suggestion but I am not trying to start a download. I > just want to know where does the code: > > Writer writer = response.getWriter(); > response.setContentType("text/xml"); > response.setHeader("Cache-Control", "no-cache"); > writer.write("<message>hi</message>"); > writer.flush(); > > write the xml file and what is the name of the said excel file > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
see, the reason i posted the link and would like to know the desired end is because without knowing what that is, the only answer that *i* know is: it''s stuck in a cached browser file and that name is more than likely some random name that the OS decides to use. and that''s *if* the user hasn''t turned off their cache and with developers and some people who are power users and have broadband that''s probably becoming more common, granted it''s not like the browser share of IE6 but I do it to make develoment and debugging easier. I guess what I am trying to say is this: if you want the user to actually do something with that file, you''ll more than likely have to force a download, and as far as i know IE is the only one that will use excel in the browser; again *assuming* that the user has Excel installed and it''s configured to open an XML file or a csv file. On Nov 21, 2007 1:41 AM, Brian Williams <brianw1975-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> ok... i''m missing some kind of critical piece of information... what do > you want to do with that file? parse it? open it with excel? upload it back > to the server? > > > > > On Nov 21, 2007 1:32 AM, Paw < paw1523-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > > > Thanks for the suggestion but I am not trying to start a download. I > > just want to know where does the code: > > > > Writer writer = response.getWriter(); > > response.setContentType("text/xml"); > > response.setHeader("Cache-Control", "no-cache"); > > writer.write("<message>hi</message>"); > > writer.flush(); > > > > write the xml file and what is the name of the said excel file > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ah, I got your point. I have a javascript function which will create drop down menus and grids. Their data are retrieved form the xml i created using the code I posted. I need to know where it created the xml file and its name. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---