lets-blade / blade Goto Github PK
View Code? Open in Web Editor NEW:rocket: Lightning fast and elegant mvc framework for Java8
Home Page: https://lets-blade.github.io
License: Apache License 2.0
:rocket: Lightning fast and elegant mvc framework for Java8
Home Page: https://lets-blade.github.io
License: Apache License 2.0
ie9 错误:
SEC7113: CSS 因 Mime 类型不匹配而被忽略
main.min.css?ver=0.1.3
chrome:
Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://localhost:8678/java-china/assets/styles/main.min.css?ver=0.1.3".
百度了一下,此问题,应该需要在response的按照 后缀名 (.css) 设置 contextType的 text/css
研究了一下源码:
DispatcherHandler 中 print 的时候设置一下?是否正确?还需要作者考虑一下。
方案:
可以根据web.xml里的配置来进行设置。
css text/css
不知道能否修正这个问题,如果加载远程的css (配置成您官方的https://java-china.org/assets/styles/main.min.css 不会出现问题)是没有问题的,但放到本地加载会出现此问题。
谢谢!!!!!
The documentation at http://bladejava.com/docs/modules/csrf does not match the current blade API.
How should CSRF be configured with the new Blade API? I tried to update the example but we can see from the log that it does not handle CSRF errors correctly. The second request in to the server should be aborted but it still reach the "login" request handler.
import blade.kit.log.Logger;
import com.blade.Blade;
import com.blade.verify.CSRFTokenManager;
import com.blade.web.http.HttpMethod;
public class CrossSite {
public static void main(String[] args) {
Logger log = Logger.getLogger(CrossSite.class);
Blade blade = Blade.me();
blade.before("/login", (request, response) -> {
if (HttpMethod.POST.equals(request.httpMethod())) {
if (!CSRFTokenManager.verifyAsForm(request, response)) {
response.text("csrf error!!!");
log.info("POST csrf error");
return;
}
log.info("POST request");
}
});
blade.post("/login", (request, response) -> {
log.info("go login");
});
blade.start();
}
}
$ curl -b /tmp/cookies.txt -c /tmp/cookies.txt -X POST http://localhost:9000/login
2015-12-26 15:44:40,800 INFO [qtp1642360923-14] com.blade.IocApplication | Add Object:com.blade.web.DispatcherServlet$1=com.blade.web.DispatcherServlet$1@2dc32c12
2015-12-26 15:44:40,802 INFO [qtp1642360923-14] com.blade.web.DispatcherServlet | blade init complete!
2015-12-26 15:44:40,804 DEBUG [qtp1642360923-13] com.blade.web.AsynRequestHandler | Request : POST /login
2015-12-26 15:44:40,815 INFO [qtp1642360923-13] com.blade.verify.CSRFTokenManager | create csrf_token:qNlQgEJoXxKAjzyEeyN9NARBP7ken83j
2015-12-26 15:44:40,815 INFO [qtp1642360923-13] CrossSite | POST request
2015-12-26 15:44:40,815 INFO [qtp1642360923-13] CrossSite | go login
$ curl -b /tmp/cookies.txt -c /tmp/cookies.txt -X POST http://localhost:9000/login
2015-12-26 15:45:06,580 DEBUG [qtp1642360923-13] com.blade.web.AsynRequestHandler | Request : POST /login
2015-12-26 15:45:06,582 INFO [qtp1642360923-13] CrossSite | POST csrf error
2015-12-26 15:45:06,582 INFO [qtp1642360923-13] CrossSite | go login
private static String trim(String str, String stripChars, int mode)
此方法逻辑有问题
stripChars.indexOf(str.charAt(start)) != -1
此行并不能判定字符串顺序,例如
String a = "abcdefgbac";
System.out.println(trim(a, "abc", 0)); //结果defg
trim方法会匹配abc,同时也会匹配acb、bac、cba等等
JSONKit class optimization
Fix the bug
支持类似spring控制器中的pathvariable方式获取path参数,支持动态注入请求响应对象,非必须写。
java.lang.StackOverflowError
at blade.kit.json.JSONObject.put(JSONObject.java:48)
More clearly the design of the ioc
官网不能访问了!!过期了?
Hi there,
We are researchers from the University of Maryland conducting a study about software code reuse. If you are interested in helping us in this study through a short interview about this project, please contact us on [email protected] for more information. You will be compensated for your time.
Thanks
Ahmed
PatternKit.java
的isMobile
加上170的手机号,曾经不少网站出现这个bug 查看详细代码
地址应该是改了!比如这个
http://bladejava.com/docs/modules/cache
实在没搞懂 不是java项目吗
com.blade.Blade 没有获取是不是异步的设置
com.blade.web.DispatcherServlet 中:
boolean isAsync = httpRequest.isAsyncSupported();
请求都会当做异步来处理
boolean isAsync =Blade.isAsyn()
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:592)
at java.lang.Integer.valueOf(Integer.java:766)
at com.blade.web.http.wrapper.ServletRequest.queryAsInt(ServletRequest.java:304)
为极大简化开发速度,blade默认实现一个简单的数据库连接池。
The changes done to add abort request method removed the asyncContext.complete();
call, see d26e0b5#diff-7aa3ea01b06a20338721e6335ed5ed92
I would like to know if it will be helpful if I contribute some unit test cases to certain modules.
I think it's better to add a new branch dev to distinguish developed codes and published codes(master).
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionIdListener
at org.eclipse.jetty.server.session.SessionHandler.<clinit>(SessionHandler.java:54)
at org.eclipse.jetty.servlet.ServletContextHandler.newSessionHandler(ServletContextHandler.java:241)
at org.eclipse.jetty.servlet.ServletContextHandler.getSessionHandler(ServletContextHandler.java:334)
at org.eclipse.jetty.servlet.ServletContextHandler.relinkHandlers(ServletContextHandler.java:180)
at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:157)
at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:117)
at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:105)
at com.blade.server.Server.start(Server.java:60)
at com.blade.Blade.start(Blade.java:629)
at com.blade.Blade.start(Blade.java:639)
at App.main(App.java:13)
是否支持数据批量插入?没找到相应支持的方法,求解答,谢谢!
Blade Core用稳定版本1.4.2,startup用版本1.0.1时会报空指针异常,换为1.5.0-beta版正常。
<from>
<input name="person.name">
<input name="person.phone">
<input name="person.cardNo">
......
</from>
Person person = getModel("person", Person.class);
Not specify arg2,default person -> Person
实现一个简单的模版引擎
If the request url contains control will quote null pointer exception in the middle
将每一个模块分离出去
代码里的注解用英文写吧,有利于国际化。中文在不同的编码下有可能乱码
获取注册的bean,怎么写?
spring容器可以SpringContextListener.getApplicationContext().getBean(beanName)
change in 6c30faa#diff-0649f4cff8db55e74927362acbb4f3e1L62 causes NullPointerException if running the application within a jar
2016-03-24 15:35:39,660 ERROR [main] github.frodeaa.bottle.App | failed to start
java.lang.NullPointerException
at com.blade.server.Server.start(Server.java:60)
at github.frodeaa.bottle.App.main(App.java:145)
see https://github.com/frodeaa/bottle/tree/blade-1.6.1M1 for example
目前的事务管理使用有点麻烦,可否加入代理;
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.