html - Dropdown default values return null? -


i have html in jsp ask simple questions, having drop-down boxes users select responses. set default responses incase decide hit next null returned. jsp:

<div id="startqrtquestion" align="left">1) when did first arrive here?</div>         <div id="startqrtresponse" align="left">             <select name="quarterstart">                 <option value="summer">summer quarter</option>                 <option value="fall" selected="selected">fall quarter</option>             </select>          </div>         <div id="programquestion" align="left">2) program taking?</div>         <div id="programresponse" align="left">             <select name="programselect">                 <option value="bscs" selected="selected">bscs</option>                 <option value="bstm">bstm</option>                 <option value="bsgd">bsgd</option>                 <option value="bswd">bswd</option>             </select>         </div>         <div id="extendedquestion" align="left">3) staying quarters?</div>         <div id="extendedresponse" align="left">                <div name="extendedstayresponses">                    <input type="checkbox" name="extendedstay" id="extendedstay"/>yes                </div></br>                <div id="extendedfulltime" style="display:none">                    full time:<select name="extrafullquarters">                        <option value="0" selected="selected">0</option>                        <option value="1">1</option>                        <option value="2">2</option>                        <option value="3">3</option>                        <option value="4">4</option>                        <option value="5">5</option>                        <option value="6">6</option>                        <option value="7">7</option>                        <option value="8">8</option>                        <option value="9">9</option>                        <option value="10">10</option>                    </select>(taking 12 credits or more)                </div></br>                <div id="extendedparttime" style="display:none">                    part time:<select name="extrapartquarters">                        <option value="0" selected="selected">0</option>                        <option value="1">1</option>                        <option value="2">2</option>                        <option value="3">3</option>                        <option value="4">4</option>                        <option value="5">5</option>                        <option value="6">6</option>                        <option value="7">7</option>                        <option value="8">8</option>                        <option value="9">9</option>                        <option value="10">10</option>                    </select>                </div>         </div> 

this wrapped in form call post method in servlet. when retrieve values so:

    string startquarter = request.getparameter("quarterstart");     string programselect = request.getparameter("programselect");     string extendedstay = request.getparameter("extendedstay"); 

i null pointer exceptions. value not automatically set have default selected option?

am not accessing these inputs correctly?

i found out wasn't of code. set of code in group's project.

it turned out session attribute that's suppose set, isn't.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -