endmsg系统调用,主要工作是将用户空间的消息头复制到内核空间中,对消息头进行检查。最后逐级调用发包接口发送数据。
https://www.cnblogs.com/wanpengcoder/p/11749313.html
send、sendto、sendmsg区别:
https://www.cnblogs.com/hnrainll/archive/2011/08/16/2141483.html
send只可用于基于连接的套接字,send 和 write唯一的不同点是标志的存在,当标志为0时,send等同于write。sendto 和 sendmsg既可用于无连接的套接字,也可用于基于连接的套接字。
SYSCALL_DEFINE3(sendmsg, int, fd, struct user_msghdr __user *, msg, unsigned int, flags)
E:\linux-4.1.45\linux-4.1.45\net\socket.c
SYSCALL_DEFINE3(sendmsg, int, fd, struct user_msghdr __user *, msg, unsigned int, flags)
{
if (flags & MSG_CMSG_COMPAT)
return -EINVAL;
return __sys_sendmsg(fd, msg, flags);
}
/*
* BSD sendmsg interface
*/
long __sys_sendmsg(int fd, struct user_msghdr __user *msg, unsigned flags)
{
int fput_needed, err;
struct msghdr msg_sys;
struct socket *sock;
sock=sockfd_lookup_light(fd, &err, &fput_needed);//根据fd找到对应socket
if (!sock)
goto out;
//发送数据
err=___sys_sendmsg(sock, msg, &msg_sys, flags, NULL);
fput_light(sock->file, fput_needed);
out:
return err;
}
static int ___sys_sendmsg(struct socket *sock, struct user_msghdr __user *msg,
struct msghdr *msg_sys, unsigned int flags,
struct used_address *used_address)
{
struct compat_msghdr __user *msg_compat=(struct compat_msghdr __user *)msg;
struct sockaddr_storage address;
struct iovec iovstack[UIO_FASTIOV], *iov=iovstack;
unsigned char ctl[sizeof(struct cmsghdr) + 20]
__attribute__ ((aligned(sizeof(__kernel_size_t))));
/* 20 is size of ipv6_pktinfo */
unsigned char *ctl_buf=ctl;
int ctl_len;
ssize_t err;
msg_sys->msg_name=&address;
if (MSG_CMSG_COMPAT & flags)
/* 从64位消息头拷贝数据到32位消息头 */
err=get_compat_msghdr(msg_sys, msg_compat, NULL, &iov);
else
err=copy_msghdr_from_user(msg_sys, msg, NULL, &iov);
if (err < 0)
return err;
err=-ENOBUFS;
/* 控制信息长度错误 */
if (msg_sys->msg_controllen > INT_MAX)
goto out_freeiov;
/* 拷贝控制信息 */
ctl_len=msg_sys->msg_controllen;
if ((MSG_CMSG_COMPAT & flags) && ctl_len) {
err=cmsghdr_from_user_compat_to_kern(msg_sys, sock->sk, ctl,
sizeof(ctl));
if (err)
goto out_freeiov;
ctl_buf=msg_sys->msg_control;
ctl_len=msg_sys->msg_controllen;
} else if (ctl_len) {
if (ctl_len > sizeof(ctl)) {
ctl_buf=sock_kmalloc(sock->sk, ctl_len, GFP_KERNEL);
if (ctl_buf==NULL)
goto out_freeiov;
}
err=-EFAULT;
/*
* Careful! Before this, msg_sys->msg_control contains a user pointer.
* Afterwards, it will be a kernel pointer. Thus the compiler-assisted
* checking falls down on this.
*/
if (copy_from_user(ctl_buf,
(void __user __force *)msg_sys->msg_control,
ctl_len))
goto out_freectl;
msg_sys->msg_control=ctl_buf;
}
/* 设置发送标记 */
msg_sys->msg_flags=flags;
/* 设置非阻塞标记 */
if (sock->file->f_flags & O_NONBLOCK)
msg_sys->msg_flags |=MSG_DONTWAIT;
/* 如果这次发送的地址跟上次成功发送的一致 */
/*
* If this is sendmmsg() and current destination address is same as
* previously succeeded address, omit asking LSM's decision.
* used_address->name_len is initialized to UINT_MAX so that the first
* destination address never matches.
*/
if (used_address && msg_sys->msg_name &&
used_address->name_len==msg_sys->msg_namelen &&
!memcmp(&used_address->name, msg_sys->msg_name,
used_address->name_len)) {
/* 无需进行检查,直接发送 */
err=sock_sendmsg_nosec(sock, msg_sys);
goto out_freectl;
}
/* 进行安全模块检查后发送 */
err=sock_sendmsg(sock, msg_sys);
/* 发送成功需要更新成功地址记录 */
/*
* If this is sendmmsg() and sending to current destination address was
* successful, remember it.
*/
if (used_address && err >=0) {
used_address->name_len=msg_sys->msg_namelen;
if (msg_sys->msg_name)
memcpy(&used_address->name, msg_sys->msg_name,
used_address->name_len);
}
out_freectl:
if (ctl_buf !=ctl)
sock_kfree_s(sock->sk, ctl_buf, ctl_len);
out_freeiov:
kfree(iov);
return err;
}
在项目中测试发现,没有定义CONFIG_COMPAT宏, 用的是#define compat_msghdr msghdr
E:\linux-4.1.45\linux-4.1.45\include\net\compat.h
#if defined(CONFIG_COMPAT)
#include <linux/compat.h>
struct compat_msghdr {
compat_uptr_t msg_name; /* void * */
compat_int_t msg_namelen;
compat_uptr_t msg_iov; /* struct compat_iovec * */
compat_size_t msg_iovlen;
compat_uptr_t msg_control; /* void * */
compat_size_t msg_controllen;
compat_uint_t msg_flags;
};
...
#else /* defined(CONFIG_COMPAT) */
/*
* To avoid compiler warnings:
*/
#define compat_msghdr msghdr
#define compat_mmsghdr mmsghdr
#endif /* defined(CONFIG_COMPAT) */
int sock_sendmsg(struct socket *sock, struct msghdr *msg)
{
int err=security_socket_sendmsg(sock, msg,
msg_data_left(msg));
return err ?: sock_sendmsg_nosec(sock, msg);
}
static inline int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg)
{
int ret=sock->ops->sendmsg(sock, msg, msg_data_left(msg));
BUG_ON(ret==-EIOCBQUEUED);
return ret;
}
对表单的验证,自己写大量的js毕竟不是一个明智的做法。不仅仅是代码很长而且不便于梳理。Validform就是一款开源的第三方验证js的控件,通过添加相应的js以及css能够有效的验证表单,维护起来也很方便。
1、js和css的引用:
这里引用官网下载中的一下css:
(文件里这个注释 "/*==========以下部分是Validform必须的===========*/" 之后的部分是必须的)
毕竟validform是基于jquery编写的,所以这个地方也需要引用Jquery脚本;
<script type="text/javascript" src="http://validform.rjboy.cn/wp-content/themes/validform/js/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="http://validform.rjboy.cn/Validform/v5.1/Validform_v5.1_min.js"></script>
2、表单元素的属性绑定:
表单元素的属性主要有:datatype、nullmsg、sucmsg、errormsg、ignore、recheck、tip、altercss、ajaxurl 和 plugin;
2.1:datatype:
内置基本的datatype类型有: * | *6-16 | n | n6-16 | s | s6-18 | p | m | e | url
*:检测是否有输入,可以输入任何字符,不留空即可通过验证;
*6-16:检测是否为6到16位任意字符;
n:数字类型;
n6-16:6到16位数字;
s:字符串类型;
s6-18:6到18位字符串;
p:验证是否为邮政编码;
m:手机号码格式;
e:email格式;
url:验证字符串是否为网址。
自定义datatype的名称,可以由字母、数字、下划线、中划线和*号组成。
形如"*6-16"的datatype,Validform会自动扩展,可以指定任意的数值范围。如内置基本类型有"*6-16",那么你绑定datatype="*4-12"就表示4到12位任意字符。如果你自定义了一个datatype="zh2-4",表示2到4位中文字符,那么datatype="zh2-6"就表示2到6位中文字符。
5.2版本之后,datatype支持规则累加或单选。用","分隔表示规则累加;用"|"分隔表示规则多选一,即只要符合其中一个规则就可以通过验证,绑定的规则会依次验证,只要验证通过,后面的规则就会忽略不再比较。如绑定datatype="m|e",表示既可以填写手机号码,也能填写邮箱地址,如果知道填入的是手机号码,那么就不会再检测他是不是邮箱地址;datatype="zh,s2-4",表示要符合自定义类型"zh",也要符合规则"s2-4"。
注:
5.2.1版本之后,datatype支持:
直接绑定正则:如可用这样写datatype="/\w{3,6}/i",要求是3到6位的字母,不区分大小写;
支持简单的逻辑运算:如datatype="m | e, *4-18 | /\w{3,6}/i | /^validform\.rjboy\.cn$/",
这个表达式的意思是:可以是手机号码;或者是邮箱地址,但字符长度必须在4到18位;或者是3到6位的字母,不区分大小写;或者输入validform.rjboy.cn,区分大小写。这里","分隔相当于逻辑运算里的"&&"; "|"分隔相当于逻辑运算里的"||";不支持括号运算。
2.2、nullmsg:
当表单元素值为空时的提示信息,不绑定,默认提示"请填入信息!"。如:nullmsg="请填写用户名!"
2.3、sucmsg :
当表单元素通过验证时的提示信息,不绑定,默认提示"通过信息验证!"。如:sucmsg="用户名还未被使用,可以注册!"
2.4、errormsg:
输入内容不能通过验证时的提示信息,默认提示"请输入正确信息!"。如:errormsg="用户名必须是2到4位中文字符!"
2.5、ignore:
绑定了ignore="ignore"的表单元素,在有输入时,会验证所填数据是否符合datatype所指定数据类型,没有填写内容时则会忽略对它的验证;
2.6、rechec:
表单里面经常需要检查两次密码输入是否一致,recheck就是用来指定需要比较的另外一个表单元素。如:recheck="password1",那么它就会拿当前元素的值跟该表单下,name为"password1"的元素比较。
2.7、tip:
表单里经常有些文本框需要默认就显示一个灰色的提示文字,当获得焦点时提示文字消失,失去焦点时提示文字显示。tip属性就是用来实现这个效果。它通常和altercss搭配使用。如<input type="text" value="默认提示文字" class="gray intxt" tip="默认提示文字" altercss="gray" />
2.8、altercss:
它需要和tip属性配合使用,altercss指定的样式名,会在文本框获得焦点时被删除,没有输入内容而失去焦点时重新加上。
2.9、ajaxurl:
指定ajax实时验证的后台文件的地址。后台页面如valid.php文件中可以用 $_POST["param"] 接收到值,Ajax中会POST过来变量param和name。param是文本框的值,name是文本框的name属性。
2.10、plugin:
指定需要使用的插件。5.3版开始,对于日期、swfupload和密码强度检测这三个插件,绑定了plugin属性即可以初始化对应的插件,可以不用在validform初始化时传入空的usePlugi了。
举例如下:
<!--ajax实时验证用户名--> <input type="text" value="" name="name" datatype="e" ajaxurl="valid.php?myparam1=value1&myparam2=value2" sucmsg="用户名验证通过!" nullmsg="请输入用户名!" errormsg="请用邮箱或手机号码注册!" /> <!--密码--> <input type="password" value="" name="userpassword" datatype="*6-15" errormsg="密码范围在6~15位之间!" /> <!--确认密码--> <input type="password" value="" name="userpassword2" datatype="*" recheck="userpassword" errormsg="您两次输入的账号密码不一致!" /> <!--默认提示文字--> <textarea tip="请在这里输入您的意见。" errormsg="很感谢您花费宝贵时间给我们提供反馈,请填写有效内容!" datatype="s" altercss="gray" class="gray" name="msg" value="">请在这里输入您的意见。</textarea> <!--使用swfupload插件--> <input type="text" plugin="swfupload" class="inputxt" disabled="disabled" value=""> <input type="hidden" value="" pluginhidden="swfupload"> <!--使用passwordStrength插件--> <input type="password" errormsg="密码至少6个字符,最多18个字符!" datatype="*6-18" plugin="passwordStrength" class="inputxt" name="password" value=""> <div class="passwordStrength" style="display:none;"><b>密码强度:</b> <span>弱</span><span>中</span><span class="last">强</span></div> <!--使用DatePicker插件--> <input type="text" plugin="datepicker" class="inputxt" name="birthday" value="">
初始化参数说明:
参数说明:【所有参数均为可选项】
tiptype:function(msg,o,cssctl){ //msg:提示信息; //o:{obj:*,type:*,curform:*}, //obj指向的是当前验证的表单元素(或表单对象,验证全部验证通过,提交表单时o.obj为该表单对象), //type指示提示的状态,值为1、2、3、4, 1:正在检测/提交数据,2:通过验证,3:验证失败,4:提示ignore状态, //curform为当前form对象; //cssctl:内置的提示信息样式控制函数,该函数需传入两个参数:显示提示信息的对象 和 当前提示的状态(既形参o中的type); } 具体参见demo页。
datatyp:{ "zh2-4":/^[\u4E00-\u9FA5\uf900-\ufa2d]{2,4}$/, "phone":function(gets,obj,curform,regxp){ //参数gets是获取到的表单元素值, //obj为当前表单元素, //curform为当前验证的表单, //regxp为内置的一些正则表达式的引用。 //return false表示验证出错,没有return或者return true表示验证通过。 } }
初始化举例代码如下:
$(".demoform").Validform({ btnSubmit:"#btn_sub", btnReset:".btn_reset", tiptype:1, ignoreHidden:false, dragonfly:false, tipSweep:true, label:".label", showAllError:false, postonce:true, ajaxPost:true, datatype:{ "*6-20": /^[^\s]{6,20}$/, "z2-4" : /^[\u4E00-\u9FA5\uf900-\ufa2d]{2,4}$/, "username":function(gets,obj,curform,regxp){ //参数gets是获取到的表单元素值,obj为当前表单元素,curform为当前验证的表单,regxp为内置的一些正则表达式的引用; var reg1=/^[\w\.]{4,16}$/, reg2=/^[\u4E00-\u9FA5\uf900-\ufa2d]{2,8}$/; if(reg1.test(gets)){return true;} if(reg2.test(gets)){return true;} return false; //注意return可以返回true 或 false 或 字符串文字,true表示验证通过,返回字符串表示验证失败,字符串作为错误提示显示,返回false则用errmsg或默认的错误提示; }, "phone":function(){ // 5.0 版本之后,要实现二选一的验证效果,datatype 的名称 不 需要以 "option_" 开头; } }, usePlugin:{ swfupload:{}, datepicker:{}, passwordstrength:{}, jqtransform:{ selector:"select,input" } }, beforeCheck:function(curform){ //在表单提交执行验证之前执行的函数,curform参数是当前表单对象。 //这里明确return false的话将不会继续执行验证操作; }, beforeSubmit:function(curform){ //在验证成功后,表单提交前执行的函数,curform参数是当前表单对象。 //这里明确return false的话表单将不会提交; }, callback:function(data){ //返回数据data是json对象,{"info":"demo info","status":"y"} //info: 输出提示信息; //status: 返回提交数据的状态,是否提交成功。如可以用"y"表示提交成功,"n"表示提交失败,在ajax_post.php文件返回数据里自定字符,主要用在callback函数里根据该值执行相应的回调操作; //你也可以在ajax_post.php文件返回更多信息在这里获取,进行相应操作; //ajax遇到服务端错误时也会执行回调,这时的data是{ status:**, statusText:**, readyState:**, responseText:** }; //这里执行回调操作; //注意:如果不是ajax方式提交表单,传入callback,这时data参数是当前表单对象,回调函数会在表单验证全部通过后执行,然后判断是否提交表单,如果callback里明确return false,则表单不会提交,如果return true或没有return,则会提交表单。 } });
Validform对象:
如示例 var demo=$(".formsub").Validform(),那么demo对象会有以下属性和方法可以调用:
tipmsg【object】
如:demo.tipmsg.s="error! no message inputed.";
通过该对象可以修改除 tit 以外的其他提示文字,这样可以实现同一个页面的不同表单使用不同的提示文字。
具体可修改的提示文字 $.Tipmsg={//默认提示文字; tit:"提示信息", w:{ "*":"不能为空!", "*6-16":"请填写6到16位任意字符!", "n":"请填写数字!", "n6-16":"请填写6到16位数字!", "s":"不能输入特殊字符!", "s6-18":"请填写6到18位字符!", "p":"请填写邮政编码!", "m":"请填写手机号码!", "e":"邮箱地址格式不对!", "url":"请填写网址!" }, def:"请填写正确信息!", undef:"datatype未定义!", reck:"两次输入的内容不一致!", r:"通过信息验证!", c:"正在检测信息…", s:"请{填写|选择}{0|信息}!", v:"所填信息没有经过验证,请稍后…", p:"正在提交数据…" };
要修改tit(弹出框的标题文字)的话,可以这样:$.Tipmsg.tit="Message Box",则弹出框的标题文字会换成"Message Box"
注:5.3.2+
$.Tipmsg.w里,形如"*6-16"的提示文字,里面的数字是会被替换的。如绑定datatype="*2-18",那它默认的出错信息就会是"请填写2到18位任意字符!",可以通过$.Tipmsg.w或Validform对象的tipmsg属性修改和扩展默认错误信息,如果你已经设置了"zh2-4"的提示信息是"2-4位中文",那么"zh2-8"出错的信息就自动会是:"2-8位中文"。对于自定义的datatype,在扩展默认信息时,注意错误信息的名字要跟datatype名字一样,如上面示例是:$.Tipmsg.w["zh2-4"]="2-4位中文"。对于多页面或一个页面多表单有相同datatype来说,在$.Tipmsg.w或Validform对象的tipmsg属性中扩展默认提示信息是个很好的选择。
5.3.1+
$.Tipmsg.s是用来指定在没有绑定nullmsg时的默认提示信息。"{0}"是会被找到的label参数指定的对象或Validform_label里的文字替换掉的,"{填写|选择}"里的文字在绑定了"recheck"属性的表单元素上检测时是会不显示的,当前验证对象是radio、checkbox或select时,会输出"选择",是其他类型的元素时会输出"填写"和后面的"信息"。
具体示例请参见demo页。
dataType【object】
获取内置的一些正则:
{ "match":/^(.+?)(\d+)-(\d+)$/, "*":/[\w\W]+/, "*6-16":/^[\w\W]{6,16}$/, "n":/^\d+$/, "n6-16":/^\d{6,16}$/, "s":/^[\u4E00-\u9FA5\uf900-\ufa2d\w\.\s]+$/, "s6-18":/^[\u4E00-\u9FA5\uf900-\ufa2d\w\.\s]{6,18}$/, "p":/^[0-9]{6}$/, "m":/^13[0-9]{9}$|14[0-9]{9}|15[0-9]{9}$|18[0-9]{9}$/, "e":/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/, "url":/^(\w+:\/\/)?\w+(\.\w+)+.*$/ }
addRule(rule)【返回值:Validform】
可以通过Validform对象的这个方法来给表单元素绑定验证规则,绑定验证类型中列出的附加属性都可以通过这个方法绑定。
demo.addRule([ { ele:"#name", datatype:"s6-18", ajaxurl:"valid.php", nullmsg:"请输入昵称!", errormsg:"昵称至少6个字符,最多18个字符!" }, { ele:"#userpassword", datatype:"*6-16", nullmsg:"请设置密码!", errormsg:"密码范围在6~16位之间!" }, { ele:"#userpassword2", datatype:"*", recheck:"userpassword", nullmsg:"请再输入一次密码!", errormsg:"您两次输入的账号密码不一致!" } ]);
其中ele是指定要绑定规则的对象,会在Validform对象下查找这些对象。
eq(n)【返回值:Validform】
获取Validform对象的第n个元素。
如你页面上有多个form的class都是formsub,执行上面的验证绑定,得到的demo对象就可以操作所有这些表单,如果你要对其中某个表单执行某些操作,那么就可以使用这个方法。
如demo.eq(0).resetForm(),重置第一个表单。
ajaxPost(flag,sync,url)【返回值:Validform】
以ajax方式提交表单。flag为true时,跳过验证直接提交,sync为true时将以同步的方式进行ajax提交。
参数url是5.3版新增,传入了url地址时,表单会提交到这个地址
如demo.ajaxPost(true),不做验证直接ajax提交表单。
abort()【返回值:Validform】
终止ajax的提交。
如执行上面的ajaxPost()之后,发现某些项填写不对,想取消表单提交,那么就可以执行这个操作:demo.abort()
submitForm(flag,url)【返回值:Validform】
以初始化时传入参数的设置方式提交表单,flag为true时,跳过验证直接提交。
参数url是5.3版新增,传入了url地址时,表单会提交到这个地址
如demo.submitForm(true),不做验证直接提交表单。
resetForm()【返回值:Validform】
重置表单。
如demo.resetForm(),重置表单到初始状态。
resetStatus()【返回值:Validform】
重置表单的提交状态。传入了postonce参数的话,表单成功提交后状态会设置为"posted",重置提交状态可以让表单继续可以提交。
如demo.resetStatus()
getStatus()【返回值:String】
获取表单的提交状态,normal:未提交,posting:正在提交,posted:已成功提交过。
如demo.getStatus()
setStatus(status)【返回值:Validform】
设置表单的提交状态,可以设置normal,posting,posted三种状态,不传参则设置状态为posting,这个状态表单可以验证,但不能提交。
如demo.setStatus("posted")
ignore(selector)【返回值:Validform】
忽略对所选择对象的验证,不传入selector则忽略所有表单元素。
如demo.ignore("select,textarea,#name"),忽略Validform对象下所有select,textarea及一个id为"name"元素的验证。
unignore(selector)【返回值:Validform】
将ignore方法所忽略验证的对象重新获取验证效果,不传入selector则恢复验证所有表单元素。
如demo.unignore("select,textarea,#name"),恢复Validform对象下所有select,textarea及一个id为"name"元素的验证。
check(bool,selector)【返回值:Boolean】
bool为true时则只验证不显示提示信息
对指定对象进行验证(默认验证当前整个表单),通过返回true,否则返回false(绑定实时验证的对象,格式符合要求时返回true,而不会等ajax的返回结果)
如demo.check(),验证当前整个表单,且只验证但不显示对错信息。
config(setup) 5.3+ 【返回值:Validform】
setup参数是一个对象。
介
JeeWeb是一款基于SpringBoot 2+Spring+Mybatis+Hibernate的敏捷开发系统;它是一款具有代码生成功能的智能快速开发平台;是以Spring Framework为核心容器,Spring MVC为模型视图控制器,Hibernate为数据访问层, Apache Shiro为权限授权层,Ehcahe对常用数据进行缓存,Disruptor作为并发框架,Bootstrap作为前端框架的优秀 开源 系统。
JeeWeb是一款 全开源开发平台 ,特别 代码生成器模块也采用开源模式 ,各位开发者可以根据自己的需要改造出更加适合自己的代码生成器,不管是做项目、学习、接私活它都将是你的最佳拍档;
JeeWeb主要定位于企业快速开发平台建设,已内置很多优秀的基础功能和高效的 代码生成 工具,包括:系统权限组件、数据权限组件、数据字典组件、核心工具组件、视图操作组件、代码生成、 UI模版标签 库等。前端界面风格采用了结构简单、性能优良、页面美观大气的Twitter Bootstrap页面展示框架。采用分层设计、提交数据安全编码、密码加密、访问验证、数据权限验证。使用Maven做项目管理,提高项目的易开发性、扩展性。
目前功能模块代码生成器、权限框架、数据字典、数据缓存、并发框架、数据监控、计划任务、多数据源管理、附件管理、类似mybatis动态SQL、UI模板标签、短信发送、邮件发送、统计功能等功能。
JeeWeb的开发方式采用( 代码生成器快速设计生成代码->手工完善逻辑->丰富模板标签快速前端开发 ),可以快速协助java开发人员解决60%的重复工作,让开发人员更多关注业务逻辑的实现,框架使用前端模板标签,解放JAVA开发人员的开发压力,提高开发效率,为企业节省项目研发成本,减少开发周期。
后台框架演示(支持两种前端样式自由切换)
论坛演示
前后端分离演示
JeeWeb 技术特点
JeeWeb使用目前流程的WEB开发架构技术,如 SpringBoot,Mybatis, Hibernate,Apache Shiro, Disruptor , ehcache, Jquery ,BootStrap等等,支持多种数据库MySQL, Oracle, sqlserver等。 分层设计:使用分层设计,分为dao,service,Controller,view层,层次清楚,低耦合,高内聚。
安全考虑:严格遵循了web安全的规范,前后台双重验证,参数编码传输,密码md5加密存储,shiro权限验证,从根本上避免了SQL注入,XSS攻击,CSRF攻击等常见的web攻击手段。
JeeWeb 功能特点
1、后端
2、前端
简单使用说明
平台目录结构说明
jeeweb ├─jeeweb-common 公共模块 │ ├─jeeweb-common-base 公用基础模块 │ │ │ ├─jeeweb-common-email 邮件基础模块 │ │ │ ├─jeeweb-common-hibernatemvc hibernate公用模块 │ │ │ ├─jeeweb-common-mybatismvc mybatis公用模块 │ │ │ ├─jeeweb-common-oss 数据存储公用模块 │ │ │ ├─jeeweb-common-quartz quartz公用模块 │ │ │ ├─jeeweb-common-query 查询封装模块 │ │ │ ├─jeeweb-common-security 安全公用模块 │ │ │ ├─jeeweb-common-sms 短信公用模块 │ │ │ └─jeeweb-common-utils 公用工具模块 │ ├─jeeweb-ui UI模块 │ ├─jeeweb-beetl-tag 基于beetl的类似spring form的模板标签 │ │ │ ├─jeeweb-ui-static 公用静态资源模块 │ │ │ └─jeeweb-ui-tag 基于静态资源模块的标签 │ ├─jeeweb-web 业务模块 │ ├─jeeweb-admin 后台案例模块 │ │ │ ├─jeeweb-bbs Jeeweb官方论坛代码模块 │ │ │ ├─jeeweb-vue 前后端分离后端模块 │ │ │ └─jeeweb-generator 代码生成器模块 │
代码示例
[1].GRID列表
<#grid:grid id="onlineGrid" datatype="local" datas="${onlineSessionList}" sortname="startTimestamp" sortorder="desc"> <#grid:column label="sys.common.key" hidden="true" name="id" width="100"/> <#grid:column label="用户" name="username" /> <#grid:column label="用户主机IP" name="host" /> <#grid:column label="系统主机IP" name="systemHost" /> <#grid:column label="登录时间" name="startTimestamp" width="140" queryMode="date" condition="between" /> <#grid:column label="最后访问时间" name="lastAccessTime" width="140"/> <#grid:column label="状态" name="status" dict="onlinestatus" /> <#grid:column label="User-Agent" name="userAgent" /> <#grid:column label="用户会话ID" name="id" /> <#grid:toolbar title="强制退出" btnclass="btn-danger" icon="fa-trash-o" function="toolbarSelectConfirm" url="${adminPath}/sys/online/forceLogout" tipMsg="您确定要强制退出这些信息么,请谨慎操作!"/> </#grid:grid>
[2].TREEGRID列表
<#grid:grid id="organizationGrid" async="true" treeGrid="true" expandColumn="name" url="${adminPath}/sys/organization/ajaxTreeList"> <#grid:column label="sys.common.key" hidden="true" name="id" width="100"/> <#grid:column label="sys.organization.name" name="name" query="true" condition="like" /> <#grid:column label="sys.organization.remarks" name="remarks" /> <#grid:column label="sys.common.opt" name="opt" formatter="button" width="100"/> <#grid:button groupname="opt" function="delete" /> <#grid:toolbar function="add"/> <#grid:toolbar function="update"/> <#grid:toolbar function="delete"/> <#grid:toolbar function="search"/> <#grid:toolbar function="reset"/> </#grid:grid>
[3].表单代码
<% layout('/layouts/form.html', {title: @MessageUtils.getMessage('sys.user.updateuser',''), formId: 'userForm', bodyClass: 'white-bg', libs: 'bootstrap-fileinput'}){ %> <#form:form id="userForm" modelAttribute="data" method="post" class="form-horizontal"> <#form:hidden path="id" /> <table class="table table-bordered table-condensed dataTables-example dataTable no-footer"> <tbody> <tr> <td class="width-15 active text-right"> <label>用户名:</label></td> <td class="width-35">${data.username}</td> <td class="width-15 active text-right"> <label> <font color="red">*</font>姓名:</label></td> <td class="width-35"> <#form:input path="realname" class="form-control " datatype="*" nullmsg="请输入姓名!" htmlEscape="false" /> <label class="Validform_checktip"></label> </td> </tr> <tr> <td class="width-15 active text-right"> <label> <font color="red">*</font>邮箱:</label></td> <td class="width-35"> <#form:input path="email" class="form-control" datatype="e" nullmsg="请输入姓名!" htmlEscape="false" /> <label class="Validform_checktip"></label> </td> <td class="width-15 active text-right"> <label> <font color="red">*</font>联系电话:</label></td> <td class="width-35"> <#form:input path="phone" class="form-control" htmlEscape="false" datatype="m" nullmsg="请输入用户名!" /> <label class="Validform_checktip"></label> </td> </tr> <tr> <td class="active"> <label class="pull-right"> <font color="red">*</font>用户角色:</label></td> <td colspan="3"> <#form:checkboxes path="roleIdList" nested="false" items="${allRoles}" defaultValue="${roleIdList}" itemLabel="name" itemValue="id" htmlEscape="false" cssClass="i-checks required" /></td> </tr> <tr> <td class="width-15 active"> <label class="pull-right">组织机构:</label></td> <td colspan="3"> <#form:treeselect title="请选择组织机构" path="organizationIds" nested="false" dataUrl="${adminPath}/sys/organization/treeData" chkboxType="" labelName="parentname" labelValue="${organizationNames}" multiselect="true" /></td> </tr> </tbody> </table> </#form:form> <% } %>
git地址:https://gitee.com/dataact/jeeweb
*请认真填写需求信息,我们会在24小时内与您取得联系。