- 博客(16)
- 收藏
- 关注
原创 JAVAEE解决页面中文乱码问题
1.首先jsp页面的pageEncoding以及contentType编码都改成UTF-82.解决get请求中文乱码:在tomcat的Servers项目中打开server.xml文件,在该行添加URIEncoding="UTF-8"3.解决post请求中文乱码 在web.xml中添加如下配置 <filter> <filter-name&g...
2019-03-05 11:18:26
3268
原创 easyui实现输入格式校验功能
首先保证easyui环境配置好之后,在需要校验输入的jsp页面定义如下的function://扩展校验规则 $(function(){ var reg = /^1[3|4|5|7|8|9][0-9]{9}$/; //正则表达式 $.extend($.fn.validatebox.defaults.rules, { phonenumber: {...
2018-12-19 09:08:59
1245
原创 使用Hibernate命名查询,来实现通用更新方法
Hibernate命名查询,就是把HQL或者SQL语句配置在实体类的hbm映射文件中,然后通过getNamedQuery()方法执行该HQL或者SQL语句Dao Service层: 这里实现了只需要输入新密码和user的id即可修改密码如果想要实现不同的修改功能只需要在实体类的映射文件添加HQL语句,然后添加新的service方法,修改调用excuteUpd...
2018-12-18 16:44:03
480
原创 jQuery AJAX应用的一个小案例
可以在jsp页面调用$.post()方法来简单地实现ajax请求 其中三个参数,url为请求的地址,第二个参数为传递的值,第三个参数为回调方法这里为url赋值为:这样一来,action中的model模型对象的password属性会被自动赋值为v1从而我们可以在action中这样获得jsp页面传过来的值:...
2018-12-18 16:17:41
307
原创 struts2自定义登陆拦截器
自定义登陆拦截器,实现功能为:对于Session域中未存在用户信息时(即未登录时),用户访问其他action时,强行跳转到login页面进行登陆。拦截器代码如下:public class BOSLoginInterceptor extends MethodFilterInterceptor{ @Override protected String doIntercept(Action...
2018-12-17 10:42:22
202
原创 struts2国际化页面信息
需求:不改动源代码,只改动配置文件的内容就能使页面显示不同的语言1.首先在项目中创建message.properties(可以放在config文件夹中),然后写入字符串信息的键值对,例如其中 key为代码中的引用,后面的值根据需要显示的内容进行更改2.在struts.xml文件中配置如下其中message为配置文件名3.代码中引用方式如下通过getText()方...
2018-12-14 18:01:31
184
原创 HDU1459 Power Network 【多源多汇最大流】
对于多源多汇问题,解决方法是建立一个超级源点只连接所有源点,建立一个超级汇点只连接所有汇点这一题节点从0到n-1,可以让节点的值+1,然后让0作为超级源点,让n+1作为超级汇点对于Init()函数,改变参数让s=0,让t=n+1即可#include<cstdio>#include<cstring>#include<queue>using n...
2017-11-13 17:36:25
434
原创 Gym 101606E 【贪心+sort】
#include<stdio.h>#include<string.h>#include<math.h>#include<algorithm>#include<iostream>#define INF 0x3fffffffconst int maxn=5000+10; using namespace std;typedef...
2017-11-13 16:58:09
481
原创 POJ1273 Drainage Ditches【dinic算法】
#include<cstdio>#include<cstring>#include<queue>using namespace std;const int INF=1e9;const int maxn=200+10; const int maxm=400+10;struct Edge{ Edge(){} Edge(int fr...
2017-11-13 16:33:19
254
原创 Codevs4189 字典
#include<iostream>#include<cstring>#include<cstdio>#include<algorithm>using namespace std;int trie[1600001][26],len,root,tot,sum[1600001]; char s[11];//这里的s设为全局变量,插入和查询都...
2017-11-11 11:36:14
246
原创 HDU1251 统计难题
第一次见到 以输入空行结束 学到了#include<iostream>#include<cstring>#include<cstdio>#include<algorithm>using namespace std;int trie[400001][26],len,root,tot,sum[400001]; char s[11];//...
2017-11-11 11:09:46
230
原创 HDU1166 敌兵布阵 单点更新+区间求和
对于同样的单点更新和区间求和功能,树状数组空间上优于线段树,且代码更简便。 #include<cstdio>#include<cstring>using namespace std;int N,c[50005];int lowbit (int i){ return i&(-i);}//让点i值加value void add(int i...
2017-11-10 15:26:42
221
原创 HDU3549 Flow Problem
#include<stdio.h>#include<string.h>#include<math.h>#include<algorithm>#include<iostream>#include<queue>#define inf 0x3fffffffconst int maxn=20; using names...
2017-11-10 15:16:16
304
原创 POJ3468 A Simple Problem with Integers 区间更新
#include<cstdio>#include<istream>using namespace std;typedef long long ll;const int MAX=1e5+10;//#define lson l,m,rt<<1//#define rson m+1,r,rt<<1|1ll sum[MAX<<...
2017-11-10 13:44:44
223
原创 NYOJ116 士兵杀敌(二) 单点更新+区间求和
#include<bits/stdc++.h>using namespace std;const int MAXNODE=4000000+100;const int MAXN=2e6+10;struct NODE{ //int value; //value表示单点值 int grade; //grade表示掌控区间的最大值 int left,right;}...
2017-11-10 13:41:20
206
原创 HDU1754 I Hate It 单点更新+区间求最值
//线段树模版#include<bits/stdc++.h>using namespace std;const int MAXNODE=1<<19;const int MAXN=2e6+10;struct NODE{ int value; //这里的value表示单点值,取左右儿子的最大值 int left,right;}node[MAXNODE];...
2017-11-10 13:37:54
175
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人