Writing to an HTTPRequest object in Java through an HTML form

Kingmadee

New Member
Quick question; I'm looking to write a request gathered from a simple HTML form to an HTTPRequest object in Java. Essentially, I'm looking to reload a page to print out different data based on the selections the user makes from a form, without relying on a servlet. The Java code portion of the JSP looks something like this:\[code\]if (request.getAttribute("month") == "January") { getSomeData;}else { getSomeOtherData;}\[/code\]The actual HTML code looks something like this:\[code\]<form name="month" method="post"><select name="monthField" <option value="http://stackoverflow.com/questions/14035203/January">January</option> <option value="http://stackoverflow.com/questions/14035203/February">February</option></select><input type="submit" value="http://stackoverflow.com/questions/14035203/Submit"></form>SHOWSOMEDATA\[/code\]I omitted the action field, which reloads the page just fine, but it doesn't seem to be writing to the request; the original code (can't post it - it's for work) has a more complex if/show test, and the page loads with the '"month"==null' case every time, so it obviously isn't posting right. Any thoughts?
 
Back
Top