how to make form:checkboxes in JSP
retransmitTable.jsp file:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/retransmit_style.css"/>
<div>
<form:form modelAttribute="retrans" method="POST" action="/doRetransmition">
<fieldset>
<span>
<form:checkboxes items="${retransmitValues}" path="description" element="span class='label_check1'"/>
</span>
<input type="submit" name="Submit" id="Submit" value="Submit" class="button" />
</fieldset>
</form:form>
</div>
retransmit_style.css file:
fieldset { border: 0; padding-bottom: 9px; }
label
.radios {padding-top: 18px; background: url(divider.png) repeat-x 0 0; }
.label_check1{display: block; cursor: pointer; line-height: 20px; padding-bottom: 9px;}
.label_radio { margin-right: 5px; }
BgChechkController.java:
@RequestMapping(value = "/getRetransmitionTable", method = RequestMethod.GET)
public ModelAndView processSubmit(@ModelAttribute("retrans") Retransmition greeting, BindingResult result){
System.out.println("lei::getRetransmitionTable");
// FiscUser user = (FiscUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
// boolean showRetransmit = user.getUserDetails().hasRight(AccessRight.Code.VIEW_BGCHECK_DETAILS.name());
ModelAndView mav = new ModelAndView();
List<Retransmition> list = bgCheckDao.getAllRetransmit();
for(int i = 0; i < list.size(); i ++){
System.out.println(list.get(i).getDescription());
}
mav.addObject("retransmitValues", bgCheckDao.getAllRetransmit());
mav.addObject("retransmittable", greeting);
mav.setViewName("retransmitTable");
return mav;
}
@RequestMapping(value = "/doRetransmition", method = RequestMethod.POST)
public void doRetransmition(){
System.out.println("helloworld");
}
Retransmition.java:
package com.birdiinc.fisc.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@EntityListeners({BaseEntityListener.class})
@Table(name = "RETRANSMIT_RIGHT")
public class Retransmition implements Serializable {
private String description;
@Id
@Column(name = "DESCRIPTION", nullable = false)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
return this.getDescription();
}
}
how to make form:checkboxes in JSP的更多相关文章
- spring <form:checkboxes> tag and css class
I have issue with: <form:checkboxes path="roles" cssClass="checkbox" items=&q ...
- form:checkboxes radiobutton select用法
<form:checkboxes path="subjects" items="${requestScope.subjects}" element=&qu ...
- Spring MVC-表单(Form)标签-复选框集合(Checkboxes)示例(转载实践)
以下内容翻译自:https://www.tutorialspoint.com/springmvc/springmvc_checkboxes.htm 说明:示例基于Spring MVC 4.1.6. 以 ...
- Jsp实现form的file和text传递(multipart/form-data)
Jsp实现form的file和text传递(multipart/form-data) 首先是form部分,因为要有<input type="file" />的类型,所以 ...
- JavaBean+jsp开发模式 --结合form表单 实例
1.创建form表单 <%@ page language="java" contentType="text/html; charset=UTF-8" pa ...
- Spring MVC Checkbox And Checkboxes Example
In Spring MVC, <form:checkbox /> is used to render a HTML checkbox field, the checkbox values ...
- [转]SpringMVC<from:form>表单标签和<input>表单标签简介
原文地址:https://blog.csdn.net/hp_yangpeng/article/details/51906654 在使用SpringMVC的时候我们可以使用Spring封装的一系列表单标 ...
- Spring MVC-表单(Form)标签-列表框(Listbox)示例(转载实践)
以下内容翻译自:https://www.tutorialspoint.com/springmvc/springmvc_listbox.htm 说明:示例基于Spring MVC 4.1.6. 以下示例 ...
- Spring MVC-表单(Form)标签-下拉框(Dropdown)示例(转载实践)
以下内容翻译自:https://www.tutorialspoint.com/springmvc/springmvc_dropdown.htm 说明:示例基于Spring MVC 4.1.6. 以下示 ...
随机推荐
- JSP之初识2
<与%之间不可有空格,但是后面可以有空格 <%@ page language="java" import="java.util.*" pageEnc ...
- Swift静态方法
与静态属性类似,Swift中还定义了静态方法,也称为类型方法,所谓“类型”是指枚举.结构体和类.静态方法定义的方法也是与静态属性类似的,枚举和结构体的静态方法使用的关键字是static,类的静态方法使 ...
- C#判断Textbox是否为数字
第一种方法: try { ) { //操作代码 } else { MessageBox.Show("必须是正整数"); } } catch (FormatException) { ...
- 3月3日(2) Search Insert Position
这题...有点简单吧,为什么只有34%的通过率? 题目意思简单说就是查找index,或者按升序插入的未知,WA一次,罪过,下次要特别注意程序里变量的变化,提交前用样例检查. 简单的我有点不好意思贴代码 ...
- Percona-Server-5.5.33-31.1安装
一.下载 http://www.percona.com/downloads/Percona-Server-5.5/ Percona-Server-5.5.33-31.1 选择 binary 选择lin ...
- 简单的MySQLDB类
<?php error_reporting(E_ALL ^ E_DEPRECATED); //数据库操作类 class MySQLDB{ //属性--必要的信息 private $_host; ...
- JS传参出现乱码(转载)
问题说明:在进行网站开发时,将表单的提交功能交给JS来传递,但是在传递中文的过程中出现类似于繁体字的乱码. 解决方案:为了解决这个问题,首先从底层的C#代码审查,重新设置页面传值进行模拟,但是几经测试 ...
- javaScript创建无边框iframe兼容ie
<script>var m_iframe=document.createElement("iframe");m_iframe.scrolling="no&qu ...
- mac OS X下PhpStorm+MAMP PRO+Xdebug+FireFox集成开发和断点调试环境配置
一.环境及软件 1.macbook pro 2.Phpstorm 3.MAMP PRO 4.FireFox 二.环境搭建 1.PhpStorm导入项目 下载PhpStorm并安装,网上随便找个注册码即 ...
- laravel方法汇总详解
1.whereRaw() 用原生的SQL语句来查询,whereRaw('select * from user') 就和 User::all()方法是一样的效果 2.whereBetween() 查询时 ...