Query String problem with Netscape
Hi EveryOne, I am facing very strange problem. When i passing a query string like http://localhost/t.jsp?name="pranav kumar" between two jsp pages using IE5 then it works fine but using NetScape 4.7 it shows me error Bad Request (400). Please help to sort out this problem. Thanks in advance. With Regards, Pranav === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Query String problem with Netscape
You cant have space in the query string when using NetScape, try using a '+' instead of the space Vera - Original Message - From: "pranav kumar" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 02, 2000 8:04 AM Subject: Query String problem with Netscape > Hi EveryOne, > I am facing very strange problem. When i passing a > query string like > http://localhost/t.jsp?name="pranav kumar" between two jsp pages using IE5 > then it works fine but using NetScape 4.7 it shows me error Bad Request > (400). > Please help to sort out this problem. > Thanks in advance. > With Regards, > Pranav > > === > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.html > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets > === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Query String problem with Netscape
Hi Pranav, If you are doing it as you have written, then first Encode your URL using URL.encode with your URL and then try it. - Ravi Sharma - Original Message - From: pranav kumar <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 02, 2000 11:34 AM Subject: Query String problem with Netscape > Hi EveryOne, > I am facing very strange problem. When i passing a > query string like > http://localhost/t.jsp?name="pranav kumar" between two jsp pages using IE5 > then it works fine but using NetScape 4.7 it shows me error Bad Request > (400). > Please help to sort out this problem. > Thanks in advance. > With Regards, > Pranav > > === > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.html > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets > === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Query String problem with Netscape
Try http://localhost/t.jsp?name=pranav%20kumar The value should always be URLEncoded. fribeiro - Original Message - From: "pranav kumar" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 02, 2000 3:04 AM Subject: Query String problem with Netscape > Hi EveryOne, > I am facing very strange problem. When i passing a > query string like > http://localhost/t.jsp?name="pranav kumar" between two jsp pages using IE5 > then it works fine but using NetScape 4.7 it shows me error Bad Request > (400). > Please help to sort out this problem. > Thanks in advance. > With Regards, > Pranav > > === > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.html > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets > === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Query String problem with Netscape
I encountered the same problem and wrote the following small Java application to take care of passing URL strings between JSPs that have spaces. You can call its static method from a JSP page. /*** *** * QueryString provides a single static method for going through a URL and * replacing all instances of the space character with %20. This was created * because Netscape does not automaticall make this conversion. */ public class QueryString { public static String replaceSpaces(String URL) { String returnURL = ""; int stringIndex = 0; try { for (; stringIndex < URL.length(); stringIndex++) { if (URL.charAt(stringIndex) == ' ') returnURL = returnURL + "%20"; else returnURL = returnURL + URL.charAt(stringIndex); } } catch (StringIndexOutOfBoundsException E) { System.out.println("The last available character is at position: " + (URL.length() - 1)); System.out.println("stringIndex tried to check position : " + stringIndex); } return returnURL; } } Thanks, P.J. === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Query String problem with Netscape
Or you could save a lot of time by just using the URLEncoder class Java provides. ex. url = URLEncoder.encode(url); cboyd -Original Message- From: P.J. Tenn [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 06, 2000 8:38 AM To: [EMAIL PROTECTED] Subject: Re: Query String problem with Netscape I encountered the same problem and wrote the following small Java application to take care of passing URL strings between JSPs that have spaces. You can call its static method from a JSP page. /*** *** * QueryString provides a single static method for going through a URL and * replacing all instances of the space character with %20. This was created * because Netscape does not automaticall make this conversion. */ public class QueryString { public static String replaceSpaces(String URL) { String returnURL = ""; int stringIndex = 0; try { for (; stringIndex < URL.length(); stringIndex++) { if (URL.charAt(stringIndex) == ' ') returnURL = returnURL + "%20"; else returnURL = returnURL + URL.charAt(stringIndex); } } catch (StringIndexOutOfBoundsException E) { System.out.println("The last available character is at position: " + (URL.length() - 1)); System.out.println("stringIndex tried to check position : " + stringIndex); } return returnURL; } } Thanks, P.J. === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets