•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 426,809 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,886 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1021 | Replies: 3
![]() |
•
•
Join Date: Dec 2007
Posts: 11
Reputation:
Rep Power: 1
Solved Threads: 0
Dear sir
In my project i have to pass variables when a user click on the link i.e there is full address
of a client which is getting from a table,when user click on this link all information is displayed,but the problem is if there is a space in the address as(united state) variables,only null value is displayed.
Please help
In my project i have to pass variables when a user click on the link i.e there is full address
of a client which is getting from a table,when user click on this link all information is displayed,but the problem is if there is a space in the address as(united state) variables,only null value is displayed.
Please help
•
•
Join Date: Jan 2008
Posts: 35
Reputation:
Rep Power: 1
Solved Threads: 5
Spaces are not acceptible Url characters. Use the Url equivalent, %20, whenever you need a space in the information transferred to get the best results. Or better yet, use a built-in Url Encoding method, like URLEncoder.encode(), to encode the entire Url before it is processed and take care of all non-Url-acceptible characters.
~ mellamokb
~ mellamokb
•
•
Join Date: Dec 2007
Posts: 11
Reputation:
Rep Power: 1
Solved Threads: 0
Thanks for the reply,but my problem is i m getting value from table as given in the code below
out.println(" <TD style=\"font-family:Verdana; font-size:11px; font-style:normal; font-weight:normal; vertical-align:middle; color:#3366FF;\"align=\"center\"><a href=report.jsp?address="+rs.getString("address")+">"+rs.getString("address") +"</a></td>");
In the address client has to submit his address,but if there space in the address value as (united state) then mycode is not working
Please Help
out.println(" <TD style=\"font-family:Verdana; font-size:11px; font-style:normal; font-weight:normal; vertical-align:middle; color:#3366FF;\"align=\"center\"><a href=report.jsp?address="+rs.getString("address")+">"+rs.getString("address") +"</a></td>");
In the address client has to submit his address,but if there space in the address value as (united state) then mycode is not working
Please Help
You have been given your answer.
A URI can't contain any spaces and some other special characters, and if they do, they need to be encoded. With the way you are currently doing things, when the country name with spaces is encountered, the URI becomes
Using scriptlets in your JSP file is a bad practice not to mention that accessing a database from the JSP file is disastrous.
A URI can't contain any spaces and some other special characters, and if they do, they need to be encoded. With the way you are currently doing things, when the country name with spaces is encountered, the URI becomes
report.jsp?address=some address when it should have been report.jsp?address=some%20address .Using scriptlets in your JSP file is a bad practice not to mention that accessing a database from the JSP file is disastrous.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- fstream Tutorial (C++)
- Pointers (archived tutorial) (C++)
- Passing VBscript varibales to batch file.. (Visual Basic 4 / 5 / 6)
- What relation does **indirection operator have with Multidimensional Arrays (C++)
- Help with Pointer and While loop Please (C)
- Pop3 Mail Watcher (Part 1) (Visual Basic 4 / 5 / 6)
- Help Writing Fuction to Read Fractions From User (C++)
- I need special stuff in my project like system("cls") (C++)
- How do I create a program using an Array ? (C++)
- Error Linking KeyLogger.exe (C++)
Other Threads in the JSP Forum
- Previous Thread: resultset from drop down box
- Next Thread: code to hide the url using servlet filter



Linear Mode