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. 以下示 ...
随机推荐
- Emmet的高级功能与使用技巧
Emmet系列教程 前端开发利器Emmet的介绍 Emmet快速编写HTML代码 Emmet快速编写CSS样式 Emmet快速编写CSS样式 编写好HTML和CSS代码时,我们也需要修改或添加一些内容 ...
- 用sinopia搭建npm私服
需求(这段话是摘抄参考文档的,因为作者也想这么说): 公司出于自身隐私保护需要,不想把自己的代码开源到包管理区,但是又急需一套完整包管工具,来管理越来越多的组件.模块和项目.对于前端,最熟悉的莫过于n ...
- 个人站长如何使用svn发布到服务器不遗漏文件
作为个人站长,最最头疼的一件事情就是在本地开发好代码之后,上传的时候要去服务器上一个一个文件进行覆盖,添加操作:是人难免出错,避免这种情况的方法: 开发者最好是在本地有一个代码库,创建好代码库之后,至 ...
- C语言函数参数既做出参又做入参的代表
//使用fcntl对文件进行加锁 #include "stdio.h"#include "unistd.h"#include "fcntl.h&quo ...
- ngx_cdecl
ngx_cdecl 作为跨平台用,现在理解有限,以后补充 _cdecl 是C Declaration的缩写(declaration,声明),表示C语言默认的函数调用方法:所有参数从右到左依次入栈,这些 ...
- selector的理解
对于nio这块最近几年一直就有关注,知道非阻塞,线程池,缓冲池,io的模式select,poll,epoll,甚至epoll中的et,lt. 但是最近才有时间实际看了看netty的源码,才发现原来se ...
- 排序,求几个最值问题,输入n个整数,输出其中最小的k个元素。
看完两个求最大值算法之后的一些感想. 如果想直接看算法的可以跳过.但是我觉得我这些想法还是比较有用的,至少对我将来的算法设计是这样的. 算法的功能越强大,必然意味着速度慢,因为根据丛林法则,那种慢又功 ...
- apache、php隐藏头信息的方法
本文介绍下,在apache与php中隐藏头部信息的方法,有需要的朋友参考下. 一.apache隐藏头部信息 apache 的 httpd.conf 有两个配置可以控制是否显示服务器信息给用户.Serv ...
- 《PHP与MySQL WEB开发》读书笔记
<PHP与MySQL WEB开发>读书笔记 作者:[美]Luke Welling PHP输出的HereDoc语法: echo <<<theEnd line 1 line ...
- 一个汉字的ASCII编码 
一个汉字的ASCII编码: