jquery - How to show selected value in dropdown list -
After submitting the JSP page request, the servlet goes to the form text fields and dropdown lists to fill an item on the JSP page I need to send an object like servlet needs.
The user will enter the ID value in the form and we will have to get it from the data
Initially when the JSP page is loaded Then the dropdown list value should be derived from the database Problem: After submission, show how the value derived from the database in the dropdown list box. Because it is conflicting with the previous scenario (get the value dynamically from the database on load) !! * / The problem This value is showing values in the checkbox as it should be, but after submitting the form < / P> The page that selects the value in the checkbox is not showing. / core "prefix =" c "%> at the top of jsp, present form such as to show the selected value in the dropdown list :
/ * & lt; Sql: setDataSource driver = "sun.jdbc.odbc.JdbcOdbcDriver" url = "jdbc: odbc: lab" var = "local source" /> & Lt; sql: query data source = "$ {local resource}" select sql = "cate_id, category" var = "result" /> to cate_desc & lt; Select name = "cate_id"> & Lt; C: forEach item = "$ {result.rows}" var = "r" & gt; & Lt; C: Select & gt; & Lt; C: when test = "$ {r.cate_id eq a}" & gt; // I received a price from the request .getattribute & lt; Option value = "$ {r.cate_id}" selected = "selected" & gt; $ {R.cate_desc} & lt; / Options & gt; & Lt; / C: When & gt; & Lt; C: otherwise & gt; & Lt; Option value = "$ {r.cate_id}" & gt; $ {R.cate_desc} & lt; / Options & gt; & Lt; / c: Otherwise & gt; & Lt; / c: Select & gt; & Lt; / C: foreach & gt; & Lt; / Select & gt;
and <.sun.com / jsp / jstl to submit the form using jsp: jsp:
Comments
Post a Comment