response.encodeURL not working

2000-04-12 Thread Khoo Swee Chin

Hi
I need help on this one. My response.encodeURL not working. Here are my
codes, what did i do wrong this time?



<% String link="cuba2.jsp?Name=Khoo Swee Chin";%>
<%=link%>

...

When i try to display Name parameter i only get Khoo, where are the rest??
Please help. :)

===
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: response.encodeURL not working

2000-04-12 Thread Hans Bergsten

Khoo Swee Chin wrote:
>
> Hi
> I need help on this one. My response.encodeURL not working. Here are my
> codes, what did i do wrong this time?
>
> 
> 
> <% String link="cuba2.jsp?Name=Khoo Swee Chin";%>
> <%=link%>
> 
> ...
>
> When i try to display Name parameter i only get Khoo, where are the rest??
> Please help. :)

The name encodeURL() is actually a bit misleading, since this method
is used for "URL rewriting" (adding session ID info to a URL) as opposed
to "URL encoding" (encoding special characters in URL parameters).
If you want both URL encoding and URL rewriting, you need to do something
like this:

  <%
String link="cuba2.jsp?Name=" +
  java.net.URLEncoder.encode("Khoo Swee Chin");
  %>
  <%=link%>

In your example using the URLEncoder is overkill, since it's a static
parameter value that can as easily be encoded manually:

  <% String link="cuba2.jsp?Name=Khoo+Swee+Chin"; %>
  <%=link%>

If the parameter value is actually a variable, using the URLEncoder
makes more sense.

Hans
--
Hans Bergsten   [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com

===
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: response.encodeURL not working

2000-04-12 Thread Komaravolu Vasudha

hi
U just try giving

<% String link="cuba2.jsp?Name="+Khoo Swee Chin;%>

-Original Message-
From: Khoo Swee Chin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 13, 2000 9:30 AM
To: [EMAIL PROTECTED]
Subject: response.encodeURL not working


Hi
I need help on this one. My response.encodeURL not working. Here are my
codes, what did i do wrong this time?



<% String link="cuba2.jsp?Name=Khoo Swee Chin";%>
<%=link%>

...

When i try to display Name parameter i only get Khoo, where are the rest??
Please help. :)

===
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: response.encodeURL not working

2000-04-12 Thread Komaravolu Vasudha

hi
i think the + shold not be given that like that
we have to give
<% String link="Khoo"+"swee"+"chin"%>
-Original Message-
From: Khoo Swee Chin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 13, 2000 10:26 AM
To: [EMAIL PROTECTED]
Subject: Re: response.encodeURL not working


Hey thanks for ur response, but still cannot work. seems like i need to
replace the spaces with "+" to make it work in Netscape. Like the code
below.


<% String link="Khoo+Swee+Chin";%>
<%=link%>

This is what response.encodeURL suppose to do right?

===
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: response.encodeURL not working

2000-04-12 Thread Khoo Swee Chin

Hey thanks for ur response, but still cannot work. seems like i need to
replace the spaces with "+" to make it work in Netscape. Like the code
below.


<% String link="Khoo+Swee+Chin";%>
<%=link%>

This is what response.encodeURL suppose to do right?

===
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: response.encodeURL not working

2000-04-12 Thread Khoo Swee Chin

hey it works... thanks :)

===
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: response.encodeURL not working

2000-04-12 Thread Komaravolu Vasudha

U R well come

-Original Message-
From: Khoo Swee Chin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 13, 2000 10:33 AM
To: [EMAIL PROTECTED]
Subject: Re: response.encodeURL not working


hey it works... thanks :)

===
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: response.encodeURL not working

2000-04-13 Thread Donald E. Vandenbeld

I think you have to encode the parameters that you intend to tack on.  That
means substituting +'s for spaces:

<% String link="cuba2.jsp?Name=Khoo+Swee+Chin";%>
<%=link%>

Donald

- Original Message -
From: "Khoo Swee Chin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 12, 2000 9:59 PM
Subject: response.encodeURL not working


>
>
> Hi
> I need help on this one. My response.encodeURL not working. Here are my
> codes, what did i do wrong this time?
>
> 
> 
> <% String link="cuba2.jsp?Name=Khoo Swee Chin";%>
> <%=link%>
> 
> ...
>
> When i try to display Name parameter i only get Khoo, where are the rest??
> Please help. :)
>
>
===
> 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: response.encodeURL not working

2000-04-13 Thread Arun Thomas

response.encodeURL does not encode in the manner that you suggest.  (This is
a rather confusing issue)  response.encodeURL is responsible for
rewriting the URL in order to add a parameter for identifying a particular
session.

java.net.URLEncoder.encode(String) is responsible for doing as you suggest,
turning spaces into '+' and representing special chars with the %XX format.

-AMT

> -Original Message-
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Donald E. Vandenbeld
> Sent: Thursday, April 13, 2000 8:03 AM
> To: [EMAIL PROTECTED]
> Subject: Re: response.encodeURL not working
>
>
> I think you have to encode the parameters that you intend to tack
> on.  That
> means substituting +'s for spaces:
>
> <% String link="cuba2.jsp?Name=Khoo+Swee+Chin";%>
> <%=link%>
>
> Donald
>
> - Original Message -
> From: "Khoo Swee Chin" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 12, 2000 9:59 PM
> Subject: response.encodeURL not working
>
>
> >
> >
> > Hi
> > I need help on this one. My response.encodeURL not working. Here are my
> > codes, what did i do wrong this time?
> >
> > 
> > 
> > <% String link="cuba2.jsp?Name=Khoo Swee Chin";%>
> > <%=link%>
> > 
> > ...
> >
> > When i try to display Name parameter i only get Khoo, where are
> the rest??
> > Please help. :)
> >
> >
> ==
> =
> > 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
>

===
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