anilkumar patil

Greenhorn
+ Follow
since Jul 14, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by anilkumar patil

Can you please also provide the test case details ? the code from where you are refering to this servlet.
9 years ago
Its the container's job to send the response in the HttpResponse object. The server then send this to the client (web browser) via HTTP with the header and the body part. The web browser understands the HTTP. now it is the responsibility of the web browser to render the page with the given info.

The header part of the response has the specifics about the body . It contains the length and type of the data like Test/Html, Application/PDF which we call the mime type. The browser reads the header info and gets the reuired editors to read the data or render the page.

Andrew , there are lot of issues in this code.
1. I assume ma is of type String and if this is String then you should not do ma =="ALL". ma and "ALL" will never be same as in case of Strings == will check for the object reference and not the value.
2. You are not considering the case when ma does not contain 'fire' and ma is not equal to "ALL", so that means the variable S will never be set to 1 and even if the for loop ends after some pre defined iterations you are again starting the for loop as the S is still 0 and as you are ierating over the same previous data set which does not match your condition this will keep looping.

Please modify your conditions to consider all the scenarios and ideally you should always have a else for the if condition dont just end with else if.

thanks
9 years ago
I did a google search and found that there are many links which will provide the info on this message. Below is one of them

http://www.mail-archive.com/users@tomcat.apache.org/msg43103.html
9 years ago
you need to add the entry of the servlet to your web.xml .

<servlet>
<servlet-name>threeparam</servlet-name>
<servlet-class>Threeparam</servlet-class>
</servlet>

<servlet-class> - fully qualified class name. No package is mentioned as you said your servlet does not reside in any package.I feel you should add your servlet to a package and add the full package name to this parameter. Keeping your servlets in WEB-INF is not a good practise.

you then need to have a servlet mapping , similar to the one given below.
.
.
<servlet-mapping>
<servlet-name>threeparam</servlet-name>
<url-pattern>/threeparam</url-pattern>
</servlet-mapping>

<url-pattern> - This is what the html file should refer to .

You also need to make a change to you html file. Please change ACTION="/servlet/threeparam" to ACTION="threeparam" .

tks

9 years ago