• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

servlet Not able to fetch value from html file

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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








 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

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.
 
Greenhorn
Posts: 4
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sauris,

I found a problem in your HTML page. Please close the Input tag properly.
<input type="SUBMIT" />

It should work after that. Also, you have unclosed tags at the below locations.

Regards,
Vivek

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unclosed tags are fine in HTML. In fact, it's technically incorrect to close them!

Unclosed tags are not the problem!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic