paoding-code / paoding-rose Goto Github PK
View Code? Open in Web Editor NEWpaoding-rose 提供最好用的Java Web应用整体性框架。
License: Apache License 2.0
paoding-rose 提供最好用的Java Web应用整体性框架。
License: Apache License 2.0
想声明个拦截器,作用在反射controller中方法参数赋值之前
有办法吗
或者有人研究过源码,能提供下提高拦截器优先级的办法吗
setPriority(Integer.MAX_VALUE) 这个我试过了 最大的优先级也是在解析参数之后
请问Rose可以自动接收并反序列化List 这样的参数吗?
如果可以,浏览器提交的表单中参数名字应该怎么写呢?
Caused by: java.lang.IllegalStateException: Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on JDK 1.5 and higher
at org.springframework.context.config.ContextNamespaceHandler$1.parse(ContextNamespaceHandler.java:65)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
RT
比如,我用到了这个类 net.paoding.rose.web.paramresolver.MultipartFileResolver 来做文件上传,但是应该如何限制上传文件的大小呢?
由于rose的数据处理是先通过参数解析器,然后是拦截器,因此如果在拦截器部分进行转发,此时数据有可能已经被参数解析器读完了,因此难以对request进行wrapper,目前项目中使用的是servlet的过滤器,也就是在rose外部进行处理的,但这又导致我们难以拿到rose内部方法的注解,因此还是需要配合拦截器。
对比mvc,拦截器是在参数解析器之前,就不存在这个问题。是否考虑增加一个扩展点,让用户可以在框架处理数据前拿到request和response进行预处理?
RT,我看servlet中的init-param不能配置数组,不知道改如何配置。
目前公司老项目是使用的 Rose 项目,新项目都是 Spring Boot,后续计划是往 Spring Boot 走
但是老的 Rose 项目迁移成本很高,如果 Rose 项目和 Spring Boot 能在一个项目**存,这样前移时可以减少一部分的风险
先快速切换到 Spring Boot 启动,并能同时使用 Spring Boot 的特性,具体代码慢慢迁移
不知道目前 Paoding Rose 的使用情况如何,有多少公司在使用,是否有此类需求在里面?
Rose will not be updated any more? Dose it support JDK1.8?
Our company used it in a very big project.
http://code.google.com/p/paoding-rose/issues/detail?id=26
上面连接有个回应说:
问题原因:tomcat6和resin3支持的servlet api标准是2.5,而tomcat7、resin4支持的servlet api标准是3.0,portal内部实现servlet api的一个接口时使用的是2.5标准,现在已经使用3.0标准了。
下载了最新的代码,经测试,portal依然不支持tomcat7和resin4 ,报异常为java.lang.AbstractMethodError,在tomcat6上运行没任何问题。
尽管我是站在Gradle一边的,也觉得maven又臭又长,但是奈何还得用啊。
想用paoding-rose做app的rest 接口,请问怎么返回json格式的数据啊
您好,net.paoding.rose.web.portal.impl DefaultPipeRender 里面没有捕捉 JSONException。十分感谢开源。
当使用链式编程的时候,如Lombok的@accessors(chain = true)注解,pd.getWriteMethod()会返回空导致无法进行映射
具体代码位置:
PropertyDescriptor pd = pds[i];
if (pd.getWriteMethod() != null) {
}
我在根目录用gradle install后,context的artifactId是paoding-rose-context,但是rose和jade的pom.xml写的依赖是context。
看了文档,弄了弄还是不行。不会用gradlm,求解。
qieqie大侠,你能否整一个像在googlecode上那样一个编译好的完整包啊?本地编译总会出现各种问题,现在用gradle就是遍了一半卡死在那里不动了,真不知道是啥原因啊……弄一个全部编译好,且带有全部依赖包的完整包真的很需要啊!多谢了!
如题,qieqie,可能会是什么原因?
java.lang.NullPointerException
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:210)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at net.paoding.rose.web.portal.impl.WindowTask.run(WindowTask.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
用的jetty版本:
org.mortbay.jetty
maven-jetty-plugin
6.1.26
paoding的版本, 大概就这一个版本吧?
paoding-rose paoding-rose 1.0.1改为jetty 7
org.mortbay.jetty jetty-maven-plugin 7.6.5.v20120716报这样的错:
java.lang.NullPointerException
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:214)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:115)
at net.paoding.rose.web.portal.impl.WindowTask.run(WindowTask.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
改为jetty 8.1.5
java.lang.NullPointerException
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:197)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:98)
at net.paoding.rose.web.portal.impl.WindowTask.run(WindowTask.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
老大,rose还在更新吗?还会更新吗?感觉跟终止了一样啊。
mongodb会添加支持吗?
qieqie大侠,如何让rose接收xml或json请求呢?而不只是通常的K-V
404 能在rose 中处理吗??
因为涉及到国际化的问题,不想写在web.xml配置文件中
2016-09-21 18:45:39 [DEBUG] GET http://localhost:8084/search/3.8
2016-09-21 18:45:39 [DEBUG] ['/3.8'] matched(1): ''
2016-09-21 18:45:39 [DEBUG] ['/3.8'] matched(2): '/3.8'
2016-09-21 18:45:39 [DEBUG] ['/3.8'] matched over.
2016-09-21 18:45:39 [DEBUG] Score of net.paoding.rose.web.impl.thread.LinkedEngine:1
2016-09-21 18:45:39 [DEBUG] Engine selected:com.itcc8.sms.wechat.controllers.WechatController#pipe
2016-09-21 18:45:39 [DEBUG] mapped '/search/3.8' to com.itcc8.sms.wechat.controllers.WechatController#pipe
2016-09-21 18:45:39 [DEBUG] set request.characterEncoding by default:UTF-8
2016-09-21 18:45:39 [DEBUG] add attribute to model: invocation=/search/3.8
2016-09-21 18:45:39 [DEBUG] add attribute to model: ctxpath=/search
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.springframework.validation.BindingResult.parameterBindingResult=net.paoding.rose.web.impl.validation.ParameterBindingResult: 0 errors
2016-09-21 18:45:39 [DEBUG] Resolves parameter Pipe using net.paoding.rose.web.paramresolver.ResolverFactoryImpl$IndexAliasResolver
2016-09-21 18:45:39 [DEBUG] setAttribute($$paoding-rose-portal.pipe=pipe ['/search/3.8'])
2016-09-21 18:45:39 [DEBUG] add attribute to model: pipe=pipe ['/search/3.8']
2016-09-21 18:45:39 [INFO] rendering a unsuccess window: /wp1; contentLength=-1; sc=200
2016-09-21 18:45:39 [DEBUG] add attribute to model: p1=
2016-09-21 18:45:39 [DEBUG] onWindowAdded: [p1]@pipe ['/search/3.8']
2016-09-21 18:45:39 [INFO] rendering a unsuccess window: /wp2; contentLength=-1; sc=200
2016-09-21 18:45:39 [DEBUG] add attribute to model: p2=
2016-09-21 18:45:39 [DEBUG] onWindowAdded: [p2]@pipe ['/search/3.8']
2016-09-21 18:45:39 [DEBUG] onWindowStarted: [p1]@pipe ['/search/3.8']
2016-09-21 18:45:39 [DEBUG] onWindowStarted: [p2]@pipe ['/search/3.8']
2016-09-21 18:45:39 [DEBUG] interceptor[rose.mergeWindowAttributesToModel] do round and return 'pipe'
2016-09-21 18:45:39 [DEBUG] pipe ['/search/3.8'] is going to wait pipe windows' ins.
2016-09-21 18:45:39 [DEBUG] waitting for window 'p1''s in; timetou=never
2016-09-21 18:45:39 [DEBUG] GET http://localhost:8084/search/wp1
2016-09-21 18:45:39 [DEBUG] GET http://localhost:8084/search/wp2
2016-09-21 18:45:39 [DEBUG] notify window 'p1'
2016-09-21 18:45:39 [DEBUG] notify window 'p2'
2016-09-21 18:45:39 [DEBUG] ['/wp1'] matched(1): ''
2016-09-21 18:45:39 [DEBUG] ['/wp2'] matched(1): ''
2016-09-21 18:45:39 [DEBUG] ['/wp1'] matched(2): '/wp1'
2016-09-21 18:45:39 [DEBUG] ['/wp2'] matched(2): '/wp2'
2016-09-21 18:45:39 [DEBUG] ['/wp1'] matched over.
2016-09-21 18:45:39 [DEBUG] ['/wp2'] matched over.
2016-09-21 18:45:39 [DEBUG] Score of net.paoding.rose.web.impl.thread.LinkedEngine:1
2016-09-21 18:45:39 [DEBUG] Score of net.paoding.rose.web.impl.thread.LinkedEngine:1
2016-09-21 18:45:39 [DEBUG] Engine selected:com.itcc8.sms.wechat.controllers.WechatController#portal1
2016-09-21 18:45:39 [DEBUG] Engine selected:com.itcc8.sms.wechat.controllers.WechatController#portal2
2016-09-21 18:45:39 [DEBUG] mapped '/search/wp1' to com.itcc8.sms.wechat.controllers.WechatController#portal1
2016-09-21 18:45:39 [DEBUG] mapped '/search/wp2' to com.itcc8.sms.wechat.controllers.WechatController#portal2
2016-09-21 18:45:39 [DEBUG] add attribute to model: ctxpath=/search
2016-09-21 18:45:39 [DEBUG] add attribute to model: ctxpath=/search
2016-09-21 18:45:39 [INFO] rendering a unsuccess window: /wp2; contentLength=-1; sc=200
2016-09-21 18:45:39 [INFO] rendering a unsuccess window: /wp2; contentLength=-1; sc=200
2016-09-21 18:45:39 [DEBUG] add attribute to model: p2=
2016-09-21 18:45:39 [DEBUG] add attribute to model: p2=
2016-09-21 18:45:39 [INFO] rendering a unsuccess window: /wp1; contentLength=-1; sc=200
2016-09-21 18:45:39 [INFO] rendering a unsuccess window: /wp1; contentLength=-1; sc=200
2016-09-21 18:45:39 [DEBUG] add attribute to model: p1=
2016-09-21 18:45:39 [DEBUG] add attribute to model: p1=
2016-09-21 18:45:39 [DEBUG] add attribute to model: invocation=/search/3.8
2016-09-21 18:45:39 [DEBUG] add attribute to model: invocation=/search/3.8
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.springframework.validation.BindingResult.parameterBindingResult=net.paoding.rose.web.impl.validation.ParameterBindingResult: 0 errors
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.springframework.validation.BindingResult.parameterBindingResult=net.paoding.rose.web.impl.validation.ParameterBindingResult: 0 errors
2016-09-21 18:45:39 [DEBUG] add attribute to model: pipe=pipe ['/search/3.8']
2016-09-21 18:45:39 [DEBUG] add attribute to model: pipe=pipe ['/search/3.8']
2016-09-21 18:45:39 [DEBUG] add attribute to model: invocation=/search/wp1
2016-09-21 18:45:39 [DEBUG] add attribute to model: invocation=/search/wp2
2016-09-21 18:45:39 [DEBUG] add attribute to model: ctxpath=/search
2016-09-21 18:45:39 [DEBUG] add attribute to model: ctxpath=/search
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.springframework.validation.BindingResult.parameterBindingResult=net.paoding.rose.web.impl.validation.ParameterBindingResult: 0 errors
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.springframework.validation.BindingResult.parameterBindingResult=net.paoding.rose.web.impl.validation.ParameterBindingResult: 0 errors
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose-portal.window=window[/wp1]
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose-portal.window=window[/wp2]
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose-portal.window.name=p1
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose-portal.window.name=p2
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose.model=net.paoding.rose.web.var.ModelImpl@2a66ac2e
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose.model=net.paoding.rose.web.var.ModelImpl@3ab215c1
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.apache.catalina.core.DISPATCHER_REQUEST_PATH=/wp1
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose.invocation=/search/wp1
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.apache.catalina.core.DISPATCHER_REQUEST_PATH=/wp2
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose-portal.window.in=true
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose.invocation=/search/wp2
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.springframework.web.servlet.support.RequestContext.CONTEXT=WebApplicationContext for namespace 'context@controllers'
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose-portal.window.in=true
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.apache.catalina.core.DISPATCHER_TYPE=FORWARD
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.springframework.web.servlet.support.RequestContext.CONTEXT=WebApplicationContext for namespace 'context@controllers'
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose-portal.window.path=/wp1
2016-09-21 18:45:39 [DEBUG] add attribute to model: org.apache.catalina.core.DISPATCHER_TYPE=FORWARD
2016-09-21 18:45:39 [DEBUG] interceptor[rose.mergeWindowAttributesToModel] do round and return 'portal1'
2016-09-21 18:45:39 [DEBUG] add attribute to model: $$paoding-rose-portal.window.path=/wp2
2016-09-21 18:45:39 [DEBUG] interceptor[rose.windowCancelableSupport] do round and return 'portal1'
2016-09-21 18:45:39 [DEBUG] interceptor[rose.mergeWindowAttributesToModel] do round and return 'portal2'
2016-09-21 18:45:39 [DEBUG] parset instruction:java.lang.String: 'portal1'
2016-09-21 18:45:39 [DEBUG] interceptor[rose.windowCancelableSupport] do round and return 'portal2'
2016-09-21 18:45:39 [DEBUG] parset instruction:net.paoding.rose.web.instruction.InstructionExecutorImpl$StringInstruction: ''
2016-09-21 18:45:39 [DEBUG] parset instruction:java.lang.String: 'portal2'
2016-09-21 18:45:39 [DEBUG] Returning cached instance of singleton bean 'viewDispatcher'
2016-09-21 18:45:39 [DEBUG] parset instruction:net.paoding.rose.web.instruction.InstructionExecutorImpl$StringInstruction: ''
2016-09-21 18:45:39 [DEBUG] resolving view name = 'portal1'
2016-09-21 18:45:39 [DEBUG] Returning cached instance of singleton bean 'viewDispatcher'
2016-09-21 18:45:39 [DEBUG] found '/views/portal1.jsp' for viewName 'portal1'
2016-09-21 18:45:39 [DEBUG] resolving view name = 'portal2'
2016-09-21 18:45:39 [DEBUG] found '/views/portal2.jsp' for viewName 'portal2'
2016-09-21 18:45:39 [DEBUG] to get jsp view resolver.
2016-09-21 18:45:39 [DEBUG] found viewResolver 'org.springframework.web.servlet.view.InternalResourceViewResolver@d11460d' for viewPath '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] add attribute to model: roseInvocation=/search/wp2
2016-09-21 18:45:39 [DEBUG] to get jsp view resolver.
2016-09-21 18:45:39 [DEBUG] Added model object 'ctxpath' of type [java.lang.String] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'roseInvocation' of type [net.paoding.rose.web.impl.thread.InvocationBean] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'org.apache.catalina.core.DISPATCHER_REQUEST_PATH' of type [java.lang.String] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'p2' of type [net.paoding.rose.web.portal.impl.WindowForView] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] found viewResolver 'org.springframework.web.servlet.view.InternalResourceViewResolver@d11460d' for viewPath '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'p1' of type [net.paoding.rose.web.portal.impl.WindowForView] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] add attribute to model: roseInvocation=/search/wp1
2016-09-21 18:45:39 [DEBUG] Added model object 'invocation' of type [net.paoding.rose.web.impl.thread.InvocationBean] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'ctxpath' of type [java.lang.String] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'roseInvocation' of type [net.paoding.rose.web.impl.thread.InvocationBean] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'org.springframework.web.servlet.support.RequestContext.CONTEXT' of type [net.paoding.rose.web.impl.module.ModuleAppContext] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'org.apache.catalina.core.DISPATCHER_REQUEST_PATH' of type [java.lang.String] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'org.springframework.validation.BindingResult.parameterBindingResult' of type [net.paoding.rose.web.impl.validation.ParameterBindingResult] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'p2' of type [net.paoding.rose.web.portal.impl.WindowForView] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'org.apache.catalina.core.DISPATCHER_TYPE' of type [javax.servlet.DispatcherType] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'p1' of type [net.paoding.rose.web.portal.impl.WindowForView] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'pipe' of type [net.paoding.rose.web.portal.impl.PipeImpl] to request in view with name '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'invocation' of type [net.paoding.rose.web.impl.thread.InvocationBean] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'org.springframework.web.servlet.support.RequestContext.CONTEXT' of type [net.paoding.rose.web.impl.module.ModuleAppContext] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'org.springframework.validation.BindingResult.parameterBindingResult' of type [net.paoding.rose.web.impl.validation.ParameterBindingResult] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'org.apache.catalina.core.DISPATCHER_TYPE' of type [javax.servlet.DispatcherType] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Added model object 'pipe' of type [net.paoding.rose.web.portal.impl.PipeImpl] to request in view with name '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] Forwarding to resource [/views/portal2.jsp] in InternalResourceView '/views/portal2.jsp'
2016-09-21 18:45:39 [DEBUG] Forwarding to resource [/views/portal1.jsp] in InternalResourceView '/views/portal1.jsp'
2016-09-21 18:45:39 [DEBUG] GET http://localhost:8084/search/views/portal1.jsp
2016-09-21 18:45:39 [DEBUG] GET http://localhost:8084/search/views/portal2.jsp
2016-09-21 18:45:39 [DEBUG] notify window 'p1'
2016-09-21 18:45:39 [DEBUG] notify window 'p2'
2016-09-21 18:45:39 [DEBUG] not rose uri: /search/views/portal1.jsp
2016-09-21 18:45:39 [DEBUG] not rose uri: /search/views/portal2.jsp
2016-09-21 18:45:39 [DEBUG] onWindowDone: [p1]@pipe ['/search/3.8']
2016-09-21 18:45:39 [DEBUG] onWindowDone: [p2]@pipe ['/search/3.8']
2016-09-21 18:45:39 [DEBUG] firing 'p1' : add to waiting list
2016-09-21 18:45:39 [DEBUG] firing 'p2' : add to waiting list
Tomcat 7 不知道支不支持
现象
当SQL中使用##拼接sql字符串时,如果sql语句中使用了in的sql语法,就会导致解析错误
查看源码
ReplacementIntercepter中的##解析的正则表达式有问题
final Pattern PATTERN = Pattern.compile("\{([a-zA-Z0-9_\.\:]+)\}|##\((.+)\)");
这个正则表达式采用的是贪婪模式
如下sql
update ##(:1) set status=:2 where id in (:3)
源码
while (matcher.find(start)) {
String group = matcher.group();
String key = null;
if (group.startsWith("{")) {
key = matcher.group(1);
} else if (group.startsWith("##(")) {
key = matcher.group(2); //key = :1) set status=:2 where id in (:3
}
按照google code的手册在jade中使用map和list,解析不了
我按照 四步完成Spring国际化动态配置 上面配好了resolver
并在controller里处理:
@Get
public String index(Invocation inv, @Param("language") String language) {
if (language != null) {
Locale locale = org.springframework.util.StringUtils.parseLocaleString(language);
logger.debug("language: {}, locale: {}", language, locale);
resolver.setLocale(inv.getRequest(), inv.getResponse(), locale);
}
return "index";
}
在jsp里打印:
${pageContext.request.locale}, <spring:message code="web.title"/>
结果 /?language=zh_CN 访问,logger里能打出来是:zh_CN,cookie里也能看到是zh_CN
但是jsp里,仍然是en_US
求教。。。
为啥要转为gradle,maven不是挺好的么?
windows8 +java7 clone出paoding-rose,安装gradle后 gradle install 都OK;
但是进入 sample/HelloRose ,然后 gradle jettyRun 的时候报错:
"
D:\devtools\paoding-rose\samples\HelloRose>gradle jettyRun
:compileJava
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all dependencies for configuration ':compile'.
Could not find net.paoding:rose:1.2-SNAPSHOT.
Required by:
:HelloRose:unspecified
Could not find net.paoding:rose-jade:1.2-SNAPSHOT.
Required by:
:HelloRose:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
"
进入~/.m2/ 确实有找到上面的错误中的jar,难道是环境变量不对?
why the paoding-rose project don't updated spring3.x to spring 4.x ? Will Rose be eliminated?
qieqie大侠,能给个让jade支持事务的思路么?我自己去实现就好了,多谢啊
paoding-rose依赖spring的版本为3.2,我看到网上一篇文章说spring3.2是不支持jdk8的?下面是文章链接地址
http://blog.csdn.net/zl544434558/article/details/44758381
[[email protected]]:I/O failure during jade scanning; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [E:\work\web\apache-tomcat-6.0.37\wtpwebapps\zen-admin\WEB-INF\classes\com\suoluo\zentravel\admin\dao\account\AccountBuyerDAO.class]; nested exception is java.lang.IllegalArgumentException
org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during jade scanning; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [E:\work\web\apache-tomcat-6.0.37\wtpwebapps\zen-admin\WEB-INF\classes\com\suoluo\zentravel\admin\dao\account\AccountBuyerDAO.class]; nested exception is java.lang.IllegalArgumentException
at net.paoding.rose.jade.context.spring.JadeComponentProvider.findCandidateComponents(JadeComponentProvider.java:205)
at net.paoding.rose.jade.context.spring.JadeBeanFactoryPostProcessor.findJadeDAODefinitions(JadeBeanFactoryPostProcessor.java:373)
at net.paoding.rose.jade.context.spring.JadeBeanFactoryPostProcessor.doPostProcessBeanFactory(JadeBeanFactoryPostProcessor.java:311)
at net.paoding.rose.jade.context.spring.JadeBeanFactoryPostProcessor.postProcessBeanFactory(JadeBeanFactoryPostProcessor.java:295)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:684)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at net.paoding.rose.RoseFilter.prepareRootApplicationContext(RoseFilter.java:426)
at net.paoding.rose.RoseFilter.initFilterBean(RoseFilter.java:268)
at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:194)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:424)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [E:\work\web\apache-tomcat-6.0.37\wtpwebapps\zen-admin\WEB-INF\classes\com\suoluo\zentravel\admin\dao\account\AccountBuyerDAO.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:56)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
at net.paoding.rose.jade.context.spring.JadeComponentProvider.findCandidateComponents(JadeComponentProvider.java:175)
... 27 more
Caused by: java.lang.IllegalArgumentException
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:53)
... 30 more
之前使用的时候,发现批量操作,其实是循环调用单次的更新操作。这样性能会比较差?
不知道是故意这样设计还是其他原因?
希望能修复一下
thanks
jetty 的dispacher中有一行的处理是
Request baseRequest=(request instanceof Request)?((Request)request):AbstractHttpConnection.getCurrentConnection().getRequest();
(Request)是jetty的实现
AbstractHttpConnection.getCurrentConnection()内部实现是threadLocal
如果用portal会报nullpointerexception
1.我想增加vm模版的指令应该是怎么处理?
2.我发现有个toolbox.xml这个文件时配置vm指令的吗?
RT,
尝试bugfix如下,不知道是否合理
修改execute方法:
@OverRide
public Object execute(SQLType sqlType, StatementRuntime... runtimes) {
switch (runtimes.length) {
case 0:
return 0;
case 1:
/**
* runtime长度为1,也可能调用的是batchUpdate,
* 根据jdbcTemplate接口定义,是不是可以认为返回值为数组的,即为batchUpdate操作
*/
if(returnType.isArray()){
return executeBatch(runtimes);
}
return executeSingle(runtimes[0], returnType);
default:
return executeBatch(runtimes);
}
}
Restful,返回json可以使用字符串返回,但是提交json,requestBody如何实现,我根据SpringMVC来做接收不到参数
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.