webx / citrus Goto Github PK
View Code? Open in Web Editor NEWJava-based Web Framework for Alibaba Group
Home Page: http://www.openwebx.org/
Java-based Web Framework for Alibaba Group
Home Page: http://www.openwebx.org/
对于用户自己处理pipelineExcpetion中处理的异常,由用户来控制,而不是框架统一来强制的打出日志,比如多的外地爬虫来爬系统的页面,导致很多找不到模板文件的异常出现在日志中,而用户可能只想记录一下那个模板找不到,不想打出一堆异常信息,或者框架能不能提供一个开关来关闭这个日志的开关,能让用在pipelineException处理的时候来设置是否打出异常
文档中的9.3.1.2章节(pdf的Page 151),例9.5下的描述
“定义velocity宏:仅当field验证通过时(即$group.field.valid=true),_才显示错误信
息。
对于空白表单和通过验证的字段而言,$group.field.valid为true。”
应该改为
“定义velocity宏:仅当field验证通过时(即$group.field.valid=true),不_显示错误信
息。
对于空白表单和通过验证的字段而言,$group.field.valid为true。”
webX现在支持spring4吗?
修改LogConfiguratorListener以支持Log4j2
当一个请求不属于webx的请求,但是在自己的servlet中抛出异常,但是业务自己没有控制,在使用了pipelineException处理异常时,webx会抛出Buffering mode is required to popCharBuffer,原因是因为在giveupControl以后,将Buffer关掉了,从而在pipeline中去renderTemplate的时候,就出现了上面的异常
如果一个form表单中既有需要进行验证的属性,又包含不需要验证的属性,该表单里的所有属性都必须要在对应的form.xml文件中配置么?如果不想配置不要验证的属性,有什么好的解决办法么?
我想将user单独打个包要怎么做??
maven 3.1.1
webx-all-in-one 3.0.6
slf4j的冲突?
换成maven 3.0.5就OK了
Execution default of goal com.alibaba.citrus.tool:maven-autoconfig-plugin:1.0.10:autoconfig failed: No log system exists -> [Help 1]
$.post(
"$testModule.setTarget('test_form/edit_form.do')",
$('#editForm').serialize(),
function(data,status){
alert(status);
}
);
这样提交表单不进行验证?
因为一直在离线环境下开发,所以没打算用maven管理,可在配置webx时,配置文件始终无法生效
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:services="http://www.alibaba.com/schema/services"
xmlns:pl-conditions="http://www.alibaba.com/schema/services/pipeline/conditions"
xmlns:pl-valves="http://www.alibaba.com/schema/services/pipeline/valves"
xsi:schemaLocation="
http://www.alibaba.com/schema/services http://localhost:8080/schema/services.xsd
http://www.alibaba.com/schema/services/pipeline/conditions http://localhost:8080/schema/services-pipeline-conditions.xsd
http://www.alibaba.com/schema/services/pipeline/valves http://localhost:8080/schema/services-pipeline-valves.xsd
http://www.springframework.org/schema/beans http://localhost:8080/schema/www.springframework.org/schema/beans/spring-beans-3.2.xsd
">
里面的 http://www.alibaba.com/schema/services/pipeline/conditions 以及 http://www.alibaba.com/schema/services/pipeline/valves 都访问不了,导致编辑的时候无法进行 scheme 提示
另外,我用的是 IDEA+maven plugin
---ParameterParserImpl 98 行开始
if (requestContext.isAutoUpload() && upload != null) {
// 如果是multipart/*请求,则调用upload service来解析。
isMultipart = upload.isMultipartContent(wrappedRequest);
if (isMultipart) {
try {
parseUpload();
} catch (UploadSizeLimitExceededException e) {
add(ParserRequestContext.UPLOAD_FAILED, Boolean.TRUE);
add(ParserRequestContext.UPLOAD_SIZE_LIMIT_EXCEEDED, Boolean.TRUE);
log.warn("File upload exceeds the size limit", e);
} catch (UploadException e) {
add(ParserRequestContext.UPLOAD_FAILED, Boolean.TRUE);
log.warn("Upload failed", e);
}
}
}
// 从request中取参数
if (!isMultipart) {
String method = wrappedRequest.getMethod();
在webx.xml中配置了cookie-store
<id>
<cookie path="/" maxAge="0" httpOnly="true" />
</id>
<stores>
<session-stores:cookie-store id="temporaryCookie">
<cookie name="tmp" />
</session-stores:cookie-store>
</stores>
<store-mappings>
<match name="*" store="temporaryCookie" />
</store-mappings>
如何在程序中对maxAge进行更改,使不同的用户maxAge不同
我尝试用cookie修改
for(Cookie cookie : request.getCookies()){
cookie.setMaxAge(60*60*24*7);
response.addCookie(cookie);
}
但是这样csrftoken貌似也被cookie了? 导致重新打开浏览器时csrftoken验证不通过,还有如何理解
webx主张把一切对cookie的读写,都转换成对session的读写
是说将cookie读写都通过session来读写,还是说将cookie都放入session中?
感谢各位不吝赐教!!
private final static Pattern SCHEMA_VERSION_PATTERN = Pattern.compile("-((\\d+)(.\\d+)*)\\.xsd$");
第一个点"."前应该有\\
,不然逻辑上会有问题。
需求如题。
有时候会需要不同的展示场景,但是所需数据是一样的。
webx在webxFrameworkFilter中使用excludes 排除_.css,_.js以后,在开发模式下直接访问webx的开发模式首页时出现页面混乱,因为internal里面的css和js也被过滤掉了
使用最新代码在本地进行编译运行过程中报错。
1、环境
本地环境:OS X 10.10.4 (14E46)
Java :java version “1.7.0_80" Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
Maven: Apache Maven 3.3.9
2、操作
按照http://openwebx.org/ 首页教程:
git clone https://github.com/webx/citrus-sample.git
cd citrus-sample/petstore
mvn clean install
cd web
mvn jetty:run-war
进行操作之后,报下面错误,但是可以启动:
Caused by: com.alibaba.sample.petstore.biz.StoreManagerException: Could not get upload directory from ResourceLoader: /petstore/upload
at com.alibaba.sample.petstore.biz.impl.StoreManagerImpl.afterPropertiesSet(StoreManagerImpl.java:77)
然后访问 http://127.0.0.1:8081,页面报错,HTTP报文头:
Request URL:http://127.0.0.1:8081/
Request Method:GET
Status Code:503 Service Unavailable
Remote Address:127.0.0.1:8081
实际上,应该将教程中的
mvn jetty:run-war
修改成:
mvn jetty:run
这样的话,应用正常启动,访问http://127.0.0.1:8081 成功。
com.alibaba.citrus.turbine.pipeline.valve.RenderResultAsJsonValve中
PrintWriter out = response.getWriter(); String jsonResult = JSON.toJSONString(resultObject); if (outputAsJson) { out.print(jsonResult); } else { out.print("var "); out.print(javascriptVariable); out.print(" = "); out.print(jsonResult); out.print(";"); }
什么时候帮忙解决 @wenshao @superbaobao @cqsuper
可以升级成spring4吗?
发现日志中很多错误是用户访问不存在的URL,这个如何规避
现在表单支持批量提交,是在页面初始化后,都已经定下来了,有多少个批量提交就多少个批量提交。
现在有需求,希望能动态增加表单,最后批量提交。
IDEA 官方的issue:
官方的解法是给IDEA配置启动参数 editable.java.test.console=true
。
实测在mac下面,要修改 /Applications/IntelliJ IDEA CE.app/Contents/bin/idea.properties
,增加
editable.java.test.console=true
理论上,修改 /Applications/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions
,加上下面的配置也应该生效。但实际上并不起作用,原因不明。
-Deditable.java.test.console=true
如果中间又有一个空类,就会无法读取参数注解。
public Parent{
public void execute(Context context, @Param("id") String id) {
}
}
//aop增强
public Child extends Parent{
}
分析原因是com.alibaba.citrus.service.dataresolver.impl.DataResolverServiceImpl.getAnnotatedMethod(Method)
中有bug,
private Method getAnnotatedMethod(Method method) {
Method annotatedMethod = method;
//这里的判断annotatedMethod 可以为空,因为它的父类可以不回空,例如Child
while (annotatedMethod != null && !hasAnnotations(annotatedMethod.getParameterAnnotations())) {
annotatedMethod = getOverridenMethod(annotatedMethod);
}
return annotatedMethod == null ? method : annotatedMethod;
}
发现日志中很多错误是用户访问不存在的URL,这个如何规避
我添加了
<beans:bean id="velocityConfigurer" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<!--<beans:property name="resourceLoaderPath" value="/velocity 模板目录/"/>-->
<beans:property name= "velocityProperties">
<beans:props>
<beans:prop key="input.encoding">utf-8</beans:prop>
<beans:prop key="output.encoding">utf-8</beans:prop>
<beans:prop key="userdirective">com.my.directive.Script</beans:prop>
</beans:props>
</beans:property>
</beans:bean>
但是vm依然解析不了#script()
webx3中该如何添加自定义的velocity块指令呢?
╭───────────────────────┈┈┈┈
│
│ 您的配置文件需要被更新:
│
│ file:/Users/xxx/antx.properties
│
│ 这个文件包括了您个人的特殊设置,
│ 包括服务器端口、您的邮件地址等内容。
│
└───────┈┈┈┈┈┈┈┈┈┈┈
如果不更新此文件,可能会导致配置文件的内容不完整。
Failed to execute goal com.alibaba.citrus.tool:autoconfig-maven-plugin:1.2:autoconfig (default) on project petstore-web: Autoconfig failed: 因为配置文件“file:/Users/xxx/antx.properties”未准备好,所以无法继续下去!
以上是master mvn install ERROR log info ....
我看编译的时候是用的是servlet2.5
我这里想用`AsyncContext`。
请问baobao,以后以哪个源码库为主?
是先更新taobaocode,然后同步到github还是?
谢谢
""
如题,http://www.openwebx.org/ 无法访问了
com.alibaba.citrus.webx.support.AbstractWebxRootController 中 public RequestHandlerContext getRequestHandlerContext(HttpServletRequest request, HttpServletResponse response)
String baseURL = getBaseURL(request);
String path = getResourcePath(request).replace(' ', '+'); // 将空白换成+,因为internalHandlers的key不会包含空白。
String internalBaseURL = baseURL + internalPathPrefix;
未考虑到端口问题
如题,如果代码中使用uribrokerservice,那么意味着这段代码很难脱离容器测试,很难mock。
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.