Solved

HOW get 2 parameter  ?

Posted on 2006-11-29
7
207 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
Fisheye tool 2 116
gZip compression filter 2 174
Getting NoSuchMethodError on accessing a spring mvc project 3 169
Use tracing facilities in your browser steps 2 122
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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