开发者

how to insert checkbox values especially image url to mysql using jsp

开发者_StackOverflow

how to insert checkbox values especially image url to mysql using jsp


Give all checkboxes the same name but a different value.

<input type="checkbox" name="checkbox" value="foo">
<input type="checkbox" name="checkbox" value="bar">
<input type="checkbox" name="checkbox" value="baz">

Then you can obtain them in the servlet using HttpServletRequest#getParameterValues().

String[] checked = request.getParameterValues("checkbox");


You have to connect to the database, either directly via JDBC or via an ORM like Hibernate.

Then you simply issue a query or create an persist an object which stores your data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜