导航

2018年4月3日

摘要: 1、使用**匹配任意Url: 2、使用.+匹配任意字符: {path:.+}表示匹配任意字符,但是由于Spring MVC默认将/作为Url分隔符,所以需要更改一下配置: 阅读全文

posted @ 2018-04-03 10:50 yjss 阅读(999) 评论(0) 推荐(0) 编辑

2017年11月8日

摘要: // 使用unicode 编码 function encodeUnicode(str) { var res = []; for (var i = 0; i < str.length; i++) { res[i] = "&#" + str.charCodeAt(i).toString(10); } return res.join(""); } ... 阅读全文

posted @ 2017-11-08 10:28 yjss 阅读(1410) 评论(0) 推荐(0) 编辑

2017年9月19日

摘要: 将shiro中的DefaultAdvisorAutoProxyCreator删除即可 使用了以下代码无需再配置DefaultAdvisorAutoProxyCreator 阅读全文

posted @ 2017-09-19 17:40 yjss 阅读(3086) 评论(1) 推荐(0) 编辑

摘要: Signature signature = joinPoint.getSignature(); MethodSignature methodSignature = (MethodSignature)signature; Method targetMethod = methodSignature.getMethod(); 阅读全文

posted @ 2017-09-19 17:30 yjss 阅读(2256) 评论(0) 推荐(0) 编辑

2017年8月23日

摘要: function hexToRgba(hex, opacity) { return "rgba(" + parseInt("0x" + hex.slice(1, 3)) + "," + parseInt("0x" + hex.slice(3, 5)) + "," + parseInt("0x" + hex.slice(5, 7)) + "," + opacity + ")"; } ... 阅读全文

posted @ 2017-08-23 09:19 yjss 阅读(2321) 评论(0) 推荐(0) 编辑

2017年5月3日

摘要: 获取ApplicationContext 1、WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext(); 2、WebApplicationContextUtils.get 阅读全文

posted @ 2017-05-03 11:06 yjss 阅读(94) 评论(0) 推荐(0) 编辑

2017年3月1日

摘要: public static String filterEmoji(String source) { if (source != null) { Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]|[\ue001-\ue537]"... 阅读全文

posted @ 2017-03-01 16:14 yjss 阅读(154) 评论(0) 推荐(0) 编辑

2013年3月14日

摘要: 1、固定位置.fixed-top /* 头部固定 */{position:fixed;bottom:auto;top:0px;}.fixed-bottom /* 底部固定 */{position:fixed;bottom:0px;top:auto;}.fixed-left /* 左侧固定 */{position:fixed;right:auto;left:0px;}.fixed-right /* 右侧固定 */{position:fixed;right:0px;left:auto;}/* 上面的是除了IE6的主流浏览器通用的方法 */* html,* html body /* 修正IE6振动b 阅读全文

posted @ 2013-03-14 11:50 yjss 阅读(160) 评论(0) 推荐(0) 编辑

2012年5月30日

摘要: <script type="text/javascript"> lastScrollY = 0; function FloatScroll() { var diffY; if (document.documentElement && document.documentElement.scrollTop) { diffY = document.documentElement.scrollTop; } else if (document.body) { ... 阅读全文

posted @ 2012-05-30 16:14 yjss 阅读(393) 评论(0) 推荐(0) 编辑

2012年5月14日

摘要: System.Web.Routing.RouteTable.Routes.GetVirtualPath(Request.RequestContext, new System.Web.Routing.RouteValueDictionary(new { action = "Index", id = 999 }));可用此方法在Controller层生成链接地址,避免硬编码带来重复修改 阅读全文

posted @ 2012-05-14 22:21 yjss 阅读(410) 评论(0) 推荐(0) 编辑

摘要: 在Global.asax中加入如下代码 protected void Application_AuthenticateRequest(Object sender, EventArgs e) { if (HttpContext.Current.User != null) { if (HttpContext.Current.User.Identity.IsAuthenticated) { if (HttpContext.Curre... 阅读全文

posted @ 2012-05-14 21:14 yjss 阅读(517) 评论(1) 推荐(0) 编辑

2012年4月26日

摘要: public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Response.Clear(); var webClient = new System.Net.WebClient() { Encoding = System.Text.Encoding.UTF8 }; Response.Write(webClient.DownloadStr... 阅读全文

posted @ 2012-04-26 17:41 yjss 阅读(314) 评论(0) 推荐(0) 编辑

摘要: protected void Page_Load(object sender, EventArgs e) { Response.Clear(); Response.Status = "301 Moved Permanently"; Response.AddHeader("Location", "http://www.baidu.com/"); Response.End(); } 阅读全文

posted @ 2012-04-26 17:33 yjss 阅读(141) 评论(0) 推荐(0) 编辑

2012年3月12日

摘要: 在web站点中经常要用到session对象保存一些数据,然而由于各种原因经常会造成session丢失,下面是常用的三种模式,可根据需要进行配置InProc 模式,此模式将会话状态存储在 Web 服务器上的内存中。 这是默认值。StateServer 模式,此模式将会话状态存储在一个名为 ASP.NET 状态服务的单独进程中。 这确保了在重新启动 Web 应用程序时会保留会话状态,并让会话状态可用于网络场中的多个 Web 服务器。SQLServer 模式将会话状态存储到一个 SQL Server 数据库中。 这确保了在重新启动 Web 应用程序时会保留会话状态,并让会话状态可用于网络场中的多个 阅读全文

posted @ 2012-03-12 22:46 yjss 阅读(1564) 评论(0) 推荐(0) 编辑

2011年10月22日

摘要: 让iis允许下载指定扩展名的文件在iis网站上右键->属性->HTTP头->MIME类型->添加:扩展名填写: .XXX MIME类型填写: application/octet-stream现在, 可以下载指定类型的文件了 阅读全文

posted @ 2011-10-22 10:38 yjss 阅读(621) 评论(0) 推荐(0) 编辑

2011年8月3日

摘要: declare @max integer,@id integerdeclare cur_rows cursor local for select id,count(*) from 表名 group by id having count(*) > 1open cur_rowsfetch cur_rows into @id,@maxwhile @@fetch_status=0beginselect @max = @max -1set rowcount @maxdelete from 表名 where id = @idfetch cur_rows into @id,@maxendclose c 阅读全文

posted @ 2011-08-03 09:19 yjss 阅读(132) 评论(0) 推荐(0) 编辑

2011年7月30日

摘要: javascript省市弹出层选择框下载地址 阅读全文

posted @ 2011-07-30 14:17 yjss 阅读(524) 评论(0) 推荐(0) 编辑

摘要: sqlite是一个类似sqlce和access微型数据库主要应用于移动设备和网站,相比较而言,access是桌面数据库不太适合用于程序中(性能和支持缺陷),sqlce还不太成熟不过随着4.0的发布已有很大提高,但是只能应用在.net4的环境下首先去http://www.sqlite.org/download.html下载适用与.net 的提供程序,安装后就可以在vs的服务器资源管理器中连接sqlce数据库了,并提供了基本的编辑功能,并且可在ef中使用它生成对象模型。sqliteexpert是一个可视化sqlite设计器,有免费版和收费版,收费版只是多了些数据导入类的功能,下载地址:http:/ 阅读全文

posted @ 2011-07-30 13:33 yjss 阅读(885) 评论(0) 推荐(0) 编辑

2011年7月29日

摘要: /// <SUMMARY> /// 文件操作基类提供操作文件和文件夹的方法 /// </SUMMARY> public class FileHelper { #region 格式化输出文件大小 enum Unit { B, KB, MB, GB, ER } /// <summary> /// 计算文件大小 /// </summary> /// <param name="bytes">要计算的字节数</param> /// <param name="_compactFormat" 阅读全文

posted @ 2011-07-29 09:09 yjss 阅读(423) 评论(0) 推荐(0) 编辑

2011年7月14日

摘要: javascript中有个mouseout事件,但在鼠标尚未离开对象如div,只是进入了它内部的元素中去,也会触发mouseout带来麻烦,可使用jquery的mouseleave事件替换 阅读全文

posted @ 2011-07-14 13:39 yjss 阅读(112) 评论(0) 推荐(0) 编辑