Solved

HOW get 2 parameter  ?

Posted on 2006-11-29
7
206 Views
Last Modified: 2010-04-01
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
0
Comment
Question by:princehyderabad
  • 4
  • 3
7 Comments
 
LVL 12

Expert Comment

by:enachemc
ID: 18043631
that href is incorrect. No spaces are allowes in a href. Replace the spaces by "+" or "%20".
0
 

Author Comment

by:princehyderabad
ID: 18043651
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
 
LVL 12

Expert Comment

by:enachemc
ID: 18043674
use URLEncoder.encode("your string here");
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 12

Expert Comment

by:enachemc
ID: 18043676
you should not use the category name, but instead the category ID in your link, though it is possible.
0
 

Author Comment

by:princehyderabad
ID: 18043692
caN u PLZ WRITE THE CODE LINE.... im doing silly mistake...
0
 

Author Comment

by:princehyderabad
ID: 18043704
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
 
LVL 12

Accepted Solution

by:
enachemc earned 50 total points
ID: 18043762
<a href=Category.jsp?cname=<%=type%>&name='<%=java.net.URLEncoder.encode(subcategory)%>'><%=java.net.URLEncoder.encode(subcategory)%></a>
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial shows how to create a greeting card by combining two image layers and a text layer on a PC using a free image editing app.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question