Problem with request.getParameter
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Harshinie_Dayaratne
Posted On:   Tuesday, July 22, 2003 12:54 AM

I am running a web application using apache and tomact. there is variable called isAdd. isAdd value is set as request parameter. String isAdd = request.getParameter("isAdd"); The problem is when i deploy this application is one tomcat/apache server i get following results. when i call the page using following url test.jsp?isAdd=y it displays page with correct results. then again if i call the same page using just test.jsp without any parameters then also system displays same results that is displayed when isAdd is y. it does not consider isAdd is null. previous value is considered. I deploy same application another apache/tomcat server with same configuration. Then the sys   More>>

I am running a web application using apache and tomact.
there is variable called isAdd.
isAdd value is set as request parameter.
String isAdd = request.getParameter("isAdd");

The problem is when i deploy this application is one tomcat/apache server i get following results.
when i call the page using following url test.jsp?isAdd=y
it displays page with correct results.

then again if i call the same page using just test.jsp without any parameters then also system displays same results that is displayed when isAdd is y. it does not consider isAdd is null. previous value is considered.


I deploy same application another apache/tomcat server with same configuration. Then the system gives correct results.
That system displays correct results when page is called as test.jsp again. then isAdd is identified as null.

how shall i overcome this problem. is it due to tomcat configuration problem.

Please help me

Thank You

   <<Less

Re: Problem with request.getParameter

Posted By:   Matan_Amir  
Posted On:   Thursday, July 24, 2003 01:12 AM

Hi Harshinie,


I haven't seen the code so i don't know exactly why it isn't working, but why not add to your code a check to see if your parameter is an empty string. The server might be returning getParameter as "":



if ((isAdd != null) && (isAdd.trim().length() > 0))

......show results....



Hope that helps,

Matan
About | Sitemap | Contact