xwjie / plmcodetemplate Goto Github PK
View Code? Open in Web Editor NEW给部门制定的代码框架模板
Home Page: https://zhuanlan.zhihu.com/p/28705206
给部门制定的代码框架模板
Home Page: https://zhuanlan.zhihu.com/p/28705206
想导入到eclipse里学习一下,结果好多问题呢。
那几个自定异常里的代码几乎一样,这样不就造成了代码重复了吗,不能就写一个自定义异常类,通过一个标识去识别是哪一种异常吗?
帅哥,写的真不错,能提供pdf版本吗,
我是新手,看那个getAll返回 Collection,如果返回要加上total是不是要返回不好阅读的Map类型了?
package plm.common.utils;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.core.JVM;
import org.junit.Before;
import org.junit.Test;
import java.util.Iterator;
import static org.junit.Assert.assertEquals;
public class XMLConfigTest {
private static final StringBuilder BUFFER = new StringBuilder();
private XMLConfig xmlConfig;
@Before
public void setUp() {
xmlConfig = new XMLConfig();
}
@Test
public void testToBeanVulnerableToCVE_2017_7957() {
if (JVM.isVersion(7)) {
final String xml = ""
+ "<string class='javax.imageio.spi.FilterIterator'>\n"
+ " <iter class='java.util.ArrayList$Itr'>\n"
+ " <cursor>0</cursor>\n"
+ " <lastRet>1</lastRet>\n"
+ " <expectedModCount>1</expectedModCount>\n"
+ " <outer-class>\n"
+ " <com.thoughtworks.acceptance.SecurityVulnerabilityTest_-Exec/>\n"
+ " </outer-class>\n"
+ " </iter>\n"
+ " <filter class='javax.imageio.ImageIO$ContainsFilter'>\n"
+ " <method>\n"
+ " <class>com.thoughtworks.acceptance.SecurityVulnerabilityTest$Exec</class>\n"
+ " <name>exec</name>\n"
+ " <parameter-types/>\n"
+ " </method>\n"
+ " <name>exec</name>\n"
+ " </filter>\n"
+ " <next/>\n"
+ "</string>";
XStream xstream = new XStream();
xstream.allowTypes(new String[]{"javax.imageio.ImageIO$ContainsFilter"});
final Iterator iterator = (Iterator) xmlConfig.toBean(xml, Iterator.class);
assertEquals(0, BUFFER.length());
iterator.next();
assertEquals("Executed!", BUFFER.toString());
}
}
}
在使用中,这种ControllerAdvice看上去比较简单方便。
但是在src/main/java/plm/ControllerExceptionAdvice.java的注释里特别说明了这点,看了专栏里好像没有特别说明这种方法的不足,请问有没有相关的解释说明呢?
up主,问你一个奇葩问题,我是个新人,借你代码学习一下,我本地安装的jdk版本是1.7,然后导入这个项目到tomat运行后 Unsupported major.minor version 52.0 ,这个一场,是编译的jdk版本高于运行时的jdk版本,除了安装1.8的jdk没有别的处理办法了么
请问返回ResultBean的话,视图路径该如何指定。
默认是按url判断的话,那视图的路径比较复杂该怎么办?如何解决?
例如访问URL:/{username}/products get方式 视图路径是/user/product/list.jsp
如果不指定路径,按URL自动判断应该判断不出
比如HttpURLConnection用的不多,发现从网上弄的还挺多坑;
比如未设置超时时间;
未释放对象等等。。。。
pom下修改log4j的scope为compile正常了,为什么要使用runtime?
jdk 1.8 版本 idea 2018.2.3
重要的异常信息 SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer
引入的tomcat插件
org.apache.tomcat.maven
tomcat7-maven-plugin
2.0
8080
/
utf-8
maven启动配置 clean tomcat7:run
pom配置 只改了log4j依赖为1.2.17 并添加tomca插件配置
(用tomcat启动可以,但使用插件启动报错)
如何自定义错误返回码呢,有点不明白
少了get、set的方法。是我打开的方式不对吗?还是有其他地方设置的。
ServerCfg.java、ResultBean.java和另外几个
被切入的类应该是交由Spring容器管理,直接调用ResultBean并不能实现aop
请问,不通过上下文对象转具体实现类的方法。还有其他方法引入切面吗?我通过接口注入申明对象的方式,无法切面,怎么办?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.