java - Getting Null from post data from jsp -
<center> <form class="form-horizontal" action="${pagecontext.servletcontext.contextpath}/largelandmarklistget" method="post"> <div class="form-group"> <label class="control-label col-sm-2" for="sllrid">sllrid:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="sllrid" placeholder="enter sllrid..."> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-default">submit</button> </div> </div> </form> </center>
that particular definition of action in jsp.
string sllrid = request.getparameter("sllrid");
this how trying in servlet, within dopost method. however, sllrid null. i've tried can think of cannot return inputted value. however, if hardcode value, works perfectly, think there wrong when communicating between jsp , servlet.
what have tried:
changing name in
for
inlabel
definition,id
,for
named differentlyadding
id
valuebutton
hardcoding value verify servlet
trying
get
ratherpost
(though seemed wildly inappropriate)testing other servlets same jsp (this worked, though not particular submission id)
ensuring needed entries in web.xml had said entries made
the form sends data based on name
attribute. instead put: <input type="text" class="form-control" id="sllrid" name="sllrid" placeholder="enter sllrid...">
Comments
Post a Comment