Solved

HOW get 2 parameter  ?

Posted on 2006-11-29
7
204 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now