HOW get 2 parameter ?

hi

In my jsp i hv <a href="www.xx.com?name=rocky&status=good bad">

when I do request.getParameter("status") I only get value as "good" INSTEAD of "good bad"

thx,
PH
princehyderabadAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
enachemcConnect With a Mentor Commented:
<a href=Category.jsp?cname=<%=type%>&name='<%=java.net.URLEncoder.encode(subcategory)%>'><%=java.net.URLEncoder.encode(subcategory)%></a>
0
 
enachemcCommented:
that href is incorrect. No spaces are allowes in a href. Replace the spaces by "+" or "%20".
0
 
princehyderabadAuthor Commented:
String subcategory = rs1.getString("description");
       String type = rs1.getString("subtype");  
<a href=Category.jsp?cname=<%=type%>&name='<%=subcategory%>'><%=subcategory%></a>

Assuming subcategory value  = "Hello World", with the above code I'm only getting "Hello

How can I GET COMPLETE : Hello World
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
enachemcCommented:
use URLEncoder.encode("your string here");
0
 
enachemcCommented:
you should not use the category name, but instead the category ID in your link, though it is possible.
0
 
princehyderabadAuthor Commented:
caN u PLZ WRITE THE CODE LINE.... im doing silly mistake...
0
 
princehyderabadAuthor Commented:
I used this: error:  Undefined variable or class name: URLEncoder

...
String subcategory = rs1.getString("description");
String deco = URLEncoder.encode(subcategory);      
            %>
            <a href=Category.jsp?cname=<%=type%>&name='<%=deco%>'><%=subcategory%>
        <%       }
...
0
All Courses

From novice to tech pro — start learning today.