?
Solved

HOW get 2 parameter  ?

Posted on 2006-11-29
7
Medium Priority
?
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
In this article, WatchGuard's Director of Security Strategy and Research Teri Radichel, takes a look at insider threats, the risk they can pose to your organization, and the best ways to defend against them.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

718 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