springboot升级到2.2.4版本freemarker出现404

星期日, 2020-01-26 | Author: Lee | JAVA-and-J2EE | 没有评论 2,422 views

今天看到spring mvc 有漏洞提醒升级,就把spring boot从2.1.4版本升级到2.2.4版本

github警告 springmvc 5.0系列5.0.16以下 5.1系列5.1.13以下,5.2系列5.2.3以下,springboot 2.2.4以下都有安全漏洞

换了后没有发现编译错误,启动后试了下,发现页面都是404了,网上查了下,是FreeMarkerViewResolver的缺省配置文件

改了suffix 由原来的ftl 改成ftlh了,详情可以参见源码,现记下处理方式:

1.改原来的ftl文件扩展名ftl改成ftlh 可以解决(对于老工程不适合)

2.修改application.properties 文件

#spring
spring.freemarker.suffix=.ftl
 
更多其他配置:
spring.freemarker.cache=false
spring.freemarker.suffix=.ftl
spring.freemarker.templateLoaderPath=classpath:/templates/
spring.resources.static-locations=classpath:/static/

› 继续阅读

Tags: ,

centos8版本快速部署nginx,mysql安装

星期二, 2020-01-21 | Author: Lee | JAVA-and-J2EE, linux | 没有评论 1,804 views

0.centos8版本快速部署nginx,mysql安装

1.系统预检 查看版本

cat /etc/redhat-release

初始系统为8.0版本,执行更新后为8.1:

yum update
cat /etc/redhat-release

CentOS Linux release 8.1.1911 (Core)
› 继续阅读

Tags: , ,

css中的pointer-events样式像js一样控制绑定事件

星期二, 2020-01-14 | Author: Lee | html5 | 没有评论 1,792 views

1.今天处理了一个页面,有个按钮做了绑定事件,发现在其他页面都可以正常触发,有个页面就死活不行,

在印象中一直以为只有js才能控制点击等事件,排查了半天,最终还是把矛头指向了css上面,最终确认是pointer-events造成.

修改后搞定,也第一次认识了此css3下的pointer-events.

影响的代码如下:

[collectList] span i {
	pointer-events: none;
}

2.在css3中pointer-events(阻止hover、active、onclick触发事件)就像js一样

它能够:

阻止用户的点击动作产生任何效果

阻止缺省鼠标指针的显示

阻止CSS里的 hover 和 active 状态的变化触发事件

阻止JavaScript点击动作触发的事件

› 继续阅读

Tags:

springboot之使用tomcat部署脚本及环境设置

星期三, 2020-01-08 | Author: Lee | JAVA-and-J2EE, linux | 没有评论 1,512 views

1.部署脚本deploy.sh

cp /ia/apps/java/pomelolee-1.0.0-GA.war /usr/local/webserver/apache-tomcat-9/webapps/ROOT.war

2.启动脚本start.sh

/usr/local/webserver/apache-tomcat-9/bin/startup.sh

3.关闭脚本shut.sh

/usr/local/webserver/apache-tomcat-9/bin/shutdown.sh

4.配置指定tomcat容器加载springboot的启动配置文件

在/usr/local/webserver/apache-tomcat-9/bin 文件夹下设置setenv.sh文件指定文件加载配置,toncat启动时 会自动加载此配置

其他jvm的调优配置也都直接配置到此处,方便复用;启用配置中心的部分可以参考激活设置,此处不用做说明.

CATALINA_OPTS="$CATALINA_OPTS  -Dspring.config.location=/ia/config/pomelolee/application.properties"

Tags: ,

mac下多开微信操作

星期一, 2020-01-06 | Author: Lee | computer | 没有评论 1,067 views

1.记录一种算是最简单的呃方法吧

终端命令行:open -n /Applications/WeChat.app/Contents/MacOS/WeChat

打开后的终端不要关掉即可,其他和普通登录一样扫描登录

其他更全的方法可以参考:有三种方法:感觉都比较麻烦,感兴趣的可以去看下

Mac如何实现微信多开操作

Tags: ,

git提交文件时,遇到no changes added to commit

星期一, 2020-01-06 | Author: Lee | JAVA-and-J2EE, linux | 没有评论 1,971 views

1.删除了工程的两个文件夹,发现怎么也推送不上去,修复如下

2.git add . ##(请注意 add 后面要加 一个空格和一个点)

3.git push ## (将本地修改合并到远程)

后续再 git commit -m 及推送即可

Tags:

获取手机连接的wifi密码

星期三, 2019-12-25 | Author: Lee | computer | 没有评论 1,362 views

最近刚好休息一段时间,带着笔记本去图书馆,倒是很安静的,无奈没有直接公布可以用的wifi,算是小小遗憾吧.

但是现在基本上到处都是可以用的WIFI,从周边抓取一个信号强的来使用.

1.手机下载 WIFI万能钥匙

选取信号最好的那个免费连接即可,so easy.

2.手机WIFI选中 分享wifi二维码到微信

微信 二维码识别 P:后面即是密码,到;S前

完整信息示例:(123456789)为密码

WIFI:T:WPA;P:123456789;S:VIP;

Tags:

WordPress打赏插件之Admire基于改进自定义版

星期五, 2019-12-20 | Author: Lee | wordpress | 没有评论 1,836 views

打赏的一个功能一个插件而已

赞赏「admire」

首先感谢:有赏「You Shang」的作者:https://www.rifuyiri.net/t/4667

本人启用的时候不知道是新版本的原因还是插件有冲突,无法正常使用,然后自己重新改进之.

赞赏「admire」使用步骤

0.本地下载地址 https://www.pomelolee.com/admire/admire-v-1.0.0.zip

1.后台启用 赞赏「admire」插件


2.赞赏「admire」插件设置下自己的二维码地址,启用,默认是关闭展示的

3.需要自己手动在需要的地方调用函数即可代码如下

  <?php admire_show(); ?>

赞赏「admire」是一款能为WordPress便捷加入微信、支付宝,支付宝红包打赏/赞赏功能的插件。

改进地方:

1.移除了依赖jquery的信息

2.取消了拦截内容展示,改为手动自定义展示的地方

== Description ==

赞赏「admire」是一款能为WordPress便捷加入微信、支付宝,支付宝红包打赏/赞赏功能的插件。

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/admire` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the ‘Plugins’ screen in WordPress
3. Use the set screen to configure the plugin

== Screenshots ==

== Frequently Asked Questions ==

== Upgrade Notice ==

== Changelog ==

= 1.0.0 =

* only js no need jquery
* init
*<?php admire_show(); ?>

Tags: , , ,

git常用指令速查记录

星期五, 2019-12-13 | Author: Lee | JAVA-and-J2EE, linux | 没有评论 995 views

方便自己随时翻查

#查看远程分支

1.git branch -a

#查看本地分支

2.git branch

#创建切换分支

3.git checkout -b dev-lee origin/dev

#切换回master分支

4.git checkout master

› 继续阅读

Tags:

移除WordPress头部的window._wpemojiSettings代码及dns-prefetch

星期四, 2019-12-12 | Author: Lee | wordpress | 没有评论 1,912 views

升级到新版的wordpress的,看了下页面好多emojo的 js定义代码,对我也没有多大用,移除之.

头部还添加了dns-prefetch,从s.w.org预获取表情和头像,但s.w.org国内无法访问也是浪费.

在主题编辑 functions.php 文件中最后添加即可

//remove emoji
remove_action( 'admin_print_scripts', 'print_emoji_detection_script');
remove_action( 'admin_print_styles', 'print_emoji_styles');
remove_action( 'wp_head', 'print_emoji_detection_script', 7);
remove_action( 'wp_print_styles', 'print_emoji_styles');
remove_filter( 'the_content_feed', 'wp_staticize_emoji');
remove_filter( 'comment_text_rss', 'wp_staticize_emoji');
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email');
 
//remove dns-prefetch
remove_action( 'wp_head', 'wp_resource_hints', 2 );

刷新页面可以看到那一堆js消失了.

Tags: , ,

Search

文章分类

Meta