The Artima Developer Community
Sponsored Link

Java Answers Forum
Please help, urgent issue

9 replies on 1 page. Most recent reply: Dec 12, 2006 12:14 PM by Mark Twain

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 9 replies on 1 page
surekha mitnala

Posts: 6
Nickname: pulipaka
Registered: Oct, 2006

Please help, urgent issue Posted: Nov 15, 2006 4:51 AM
Reply to this message Reply
Advertisement
Hi All,

I have something like this in jsp and servlet.
JSP:
var url = "/appadmin/Control?request_type=controlcenter.servicedetails&nodeid="+nodeI d+"&serviceName="+servicename;
var win = open(url, 'mywin', 'width=600,height=400,scrollbars=yes',false);
win.focus();

In Servlet:
String serviceName = req.getParameter("serviceName");

Now the problem is:
One of the serviceName in the jsp consists of & as the value and this is not being passed to servlet.
Example:"Desktop machine & its functionality" something like this.
When I am trying to get the value in the servlet, from the logs I could find that only "Desktop machine " is being passed.

Please help me in this regard.
Regards,
Surekha.


Rajeev Mutalik

Posts: 57
Nickname: rajmutalik
Registered: Sep, 2002

Re: Please help, urgent issue Posted: Nov 15, 2006 5:51 AM
Reply to this message Reply
When sending this type of characters, u must check out how they are sent in iexplorer's address bar. In this case, whenever u find &, replace that char with %26. For example Deskto & Machine shud be sent as Desktop %26 Machine. Then ur server will be able to parse it as '&' character.

Rajeev

madala prashanth

Posts: 1
Nickname: prasanth02
Registered: Nov, 2006

Re: Please help, urgent issue Posted: Nov 15, 2006 6:44 AM
Reply to this message Reply
I think this will fix the probleam

if(!servicename.indexOf('&')==-1){
var indexOf&=indexOf('&');
servicename= servicename.replace('&','');
var url = "/appadmin/Control?request_type=controlcenter.servicedetails&nodeid="+nodeI d+"&serviceName="+servicename+"&index="+indexOf&;
}else
var url = "/appadmin/Control?request_type=controlcenter.servicedetails&nodeid="+nodeI d+"&serviceName="+servicename;

From Servlet side add '&' at that in index

surekha mitnala

Posts: 6
Nickname: pulipaka
Registered: Oct, 2006

Re: Please help, urgent issue Posted: Nov 15, 2006 10:17 PM
Reply to this message Reply
Hi,

Thanks a lot for the information. I have resolved the issue.
The line that I added in the JSP is

var Servicename = servicename.toString();
Servicename= Servicename.replace(/\&/gi,"%26");
var url = "/appadmin/Control?request_type=controlcenter.servicedetails&nodeid="+nodeI d+"&serviceName="+Servicename;

Thanks once again for the inputs. It is working fine now. :-))

flower flower

Posts: 1
Nickname: flower55
Registered: Nov, 2006

I love this forum Posted: Nov 16, 2006 1:35 AM
Reply to this message Reply
Hello friends i love this forum i want you to invite your friends to into it for them to share the joy of the site

Parag Shah

Posts: 24
Nickname: parags
Registered: Mar, 2003

Re: Please help, urgent issue Posted: Nov 16, 2006 9:14 AM
Reply to this message Reply
Surekha,

Replacing & will do the work, but the right way to do this is to encode the URL in the JSP and decode it in the Servlet. Replacing & is a temporary fix. The moment you have to use another character that has a special meaning in URL's you will run into the same problems.

--
Parag

surekha mitnala

Posts: 6
Nickname: pulipaka
Registered: Oct, 2006

Re: Please help, urgent issue Posted: Nov 21, 2006 1:04 AM
Reply to this message Reply
Hi Parag,

I tried with URLEncoder.encode(servicename), but this was not working. It says not able to identify URLEncoder.

Regards,
Surekha

Rajeev Mutalik

Posts: 57
Nickname: rajmutalik
Registered: Sep, 2002

Re: Please help, urgent issue Posted: Nov 22, 2006 3:30 AM
Reply to this message Reply
U need to import java.net.*. Have done this?

Rajeev

Alex Zuev

Posts: 1
Nickname: seofan
Registered: Nov, 2006

Re: Please help, urgent issue Posted: Nov 28, 2006 10:18 AM
Reply to this message Reply
Welcome to the cheapest discount cigarettes store ever. You can find here all the brands at a low price. Online cigarettes, cheap smokes. http://www.all-cigarettes-brands.com , http://www.cheap-cigarettes-brands.com , http://www.smoker-heaven.com


Cheap Drugs Online, the best online drug store with high quality products. Visit our online shop and you will not be disappointed. http://www.all-drugs-online.com , http://www.viagra-vitamins.com

http://www.onlinebusinessservices.net - BPO offshore company, outsource Email & Chat 24 website support services, news b2b outsourcing.

Our online cigarettes shop is the best choice for smokers.. You can find here Marlboro, Camel, Kent and other brands at a lowest price. Online discount cigarettes. http://www.cigbrand.com ,
http://www.cigarettes-market.com , http://www.smoke4sale.com , http://www.topcigshop.com

You can buy best cigarettes online now!!! Discount Marlboro, Davidoff, Parliament and other premium and generic brands from Europe at our Eshop only. Cheap cigarettes prices. http://www.topcigarettesonline.com , http://www.salecigarettesonline.com , http://www.shop-smoke.com , http://www.shop-cigarette.com

Cheap cigarettes from Europe!!! Visit our online cigarettes shop to order all the famous brands: Marlboro, Camel, Chesterfield, Kent at discount. Cheap prices, best quality you always imagined. Buy now and you will win!!!
http://www.cigarettes-blog.com , http://www.buy-euro-cigarettes.com , http://www.discount-euro-cigarettes.com

Mark Twain

Posts: 3
Nickname: marktwain
Registered: Dec, 2006

Re: Please help, urgent issue Posted: Dec 12, 2006 12:14 PM
Reply to this message Reply
Helo

I'm the store owner of www.cheap-discount-cigarettes.biz and www.cigarettes-online.biz .
I'm interested in link exchange, if anyone is interested please contaccte me PM, my information:
Url - http://www.cigarettes-online.biz
Keyword - Cigarettes online, buy cigarettes, cheap cigarettes
Description - Cigarettes Online. Cheap Marlboro 100's, Camel, Parliament cigarettes online, buy cheap smokes. In our online cigarettes store you can purchase cheap Marlboro, Camel 100's, Salem, Winston cigarette.

and

Url - http://www.cheap-discount-cigarettes.biz
Keyword - Cheap cigarettes, buy cigarettes, cheap marlboro cigarettes
Description - Buy cheap cigarettes online Marlboro, Camel, Winston at discount prices. Discount cigarettes online from $8.94 a carton. Discount Cheap Marlboro $12.90. Buy online discount cheap duty free cigarettes at our cigarettes store.

We sell good quality cigarettes at good prices.
also if you want to buy great cigarettes at good prices visit my online store: www.cigarettes-online.biz
Tax free cigarettes is your discount cigarette wholesale store selling premium low price cigarettes.

Have a nice day
Markus

Flat View: This topic has 9 replies on 1 page
Topic: Please help, urgent issue Previous Topic   Next Topic Topic: SWT :  creating new events

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use