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. 以下示 ...
随机推荐
- Python基础-简单输出
很好的一个博客地址:http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/0014316 ...
- 风云CM - 算法分析 & genkey实现
// 风云CM分析 // 计算用户名 00402D8A |> \8D45 F8 LEA EAX, [LOCAL.2] 00402D8D |. 50 PUSH EAX 00402D8E |. E8 ...
- setTimeout、clearTimeout、setInterval,clearInterval ——小小计时器
先看下效果 话不多说上代码~ <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Typ ...
- Contiki学习入门之概览
Contiki是专为物联网领域而设计的开源操作系统,适用于联网嵌入式系统和无线传感器网络.由瑞典计算机科学学院的Adam Dunkels团队开发.它有以下几个特点. 1. 网络标准 contiki提供 ...
- centos6.5安装配置zabbix3.0.3
1.首先要准备LAMP环境. (1)安装php Zabbix 3.0对PHP的要求最低为5.4,而CentOS6默认为5.3.3,完全不满足要求,故需要利用第三方源,将PHP升级到5.4以上 rpm ...
- SublimeText更换皮肤
SublimeText是一款非常好用的文本编辑工具,官方网址http://www.sublimetext.com/. 这里介绍一下手动安装SublimeText皮肤的方法. (1)首先找一款你喜欢的皮 ...
- 【NetOffice Excel】Excel合并单元格【原】
CSharp操作Excel采用开源的原生.NET程序集NetOffice,格式兼容性更好. 在操作Excel的时候有时候需要合并单元格 using ExcelOffice = NetOffice.Ex ...
- aix用命令查监听端口对应的进程
--aix$netstat -an|grep LISTEN|grep 7867tcp4 0 0 *.7867 *.* LISTEN$netstat -Aan|grep 7867f1000e00029f ...
- C++ 编写 CorelDRAW CPG 插件例子(2)—ClearFill
这是另一个例子: 贴上主要代码: #include "stdafx.h" #include <tchar.h> #import "libid:95E23C91 ...
- Spark Streaming揭秘 Day23 启动关闭源码图解
Spark Streaming揭秘 Day23 启动关闭源码图解 今天主要分析一下SparkStreaming的启动和关闭过程. 从Demo程序出发,主要聚焦在两段代码: 启动代码: 关闭代码: 启动 ...