This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
i had made a html page in which i have to select value from drop down list ,and as i click submit ,that selected value should be displayed with some text.
the servlet is displaying the static text but is not able to fetch the value from html file ...please help
Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.
Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
sauris kumar saurabh wrote:the servlet is displaying the static text but is not able to fetch the value from html file
Servlets do not fetch values from HTML files. A servlet has no idea where data comes from.
Rather, the browser submits a request with request parameters created from the information in the form. If the servlet isn't showing the data you expect, then most likely the request doesn't contain the data that you think it does.
I'd install a Firefox plugin such as HttpFox so that you can inspect the request to see if it contains the submitted data or not.
Well, maybe technically the description should be "it's not able to fetch the value that was submitted by the form in the HTML page".
I just copied your 3 listings to a web-project, ran it and it seemed OK, the message I got in the response page did mention the selected value (Got Beer Colorbrown), so the problem may be somewhere else than in the code.