我试图从文档中获取一些信息,但似乎它是那些你需要检查并使用它来解决问题的项目之一...
我注意到邮件列表中的高活动和很多提交,这是一个好兆头.但是当我查看代码库(btw 536MB大 - 不是一个好兆头)时,我没有找到太多的J2EE应用程序时尚.没有spring,ejb,奇怪的文件夹结构,相当多的非标准jar库.这就像开发人员不喜欢它所以他们以自己的方式做事:-)
我一直在使用一些类似的平台,主要是门户网站,例如Liferay很容易使用,因为它看起来像人们期望的那样.它基于Spring,它具有透明的服务和dao层,它具有简单的插件架构(plugin = WAR)等,是典型的J2EE开发.
我想知道开发人员在决定使用它之前应该注意哪些关键方面.由于它是非标准的J2EE应用程序,因此需要花费多少时间来了解它才能提高工作效率.
与OpenBravo等其他ERP系统相比,它有哪些(dis)优势.如果我主要需要Cart而不是ERP后端,我应该对OpenTaps感兴趣吗?
首先十分感谢.
如果我有这样的声明" EntitiesProvider.getEntities();
知道如何"生成"赋值给返回类型的变量?
这样就可以了 Map<String, Entity> hashMap =
这是结果:
Map<String, Entity> hashMap = EntitiesProvider.getEntities();
Run Code Online (Sandbox Code Playgroud)
它类似于ctrl + 1和Change类型,如果它返回你已经拥有的不同类型.
我发现自己经常手动做自己...
是否有可能做到这一点 ?目前这样做是这样的:
<bean id="resource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>content.Language</value>
</list>
</property>
</bean>
@Autowired
protected MessageSource resource;
protected String getMessage(String code, Object[] object, Locale locale) {
return resource.getMessage(code, object, locale);
}
Run Code Online (Sandbox Code Playgroud)
有没有办法通过@Value注释获取属性?
<util:properties id="generals" location="classpath:portlet.properties" />
@Value("#{generals['supported.lang.codes']}")
public String langCodes;
Run Code Online (Sandbox Code Playgroud)
因为必须调用该方法通常很好,但是例如在单元测试时,这很痛苦......在某些情况下,webdriver的PageObject模式对象没有初始化,这将是非常有帮助的
我是否理解正确,Java构建器重新编译scr路径上的源到输出路径,如果激活自动构建或通过"ctrl + b"或从javac抛出验证错误,通常在每个"ctrl + s"之后发生.
至于Maven2Bulder.我刚刚克隆了m2e-core git存储库,并且有相应的类org.eclipse.m2e.core.internal.builder.MavenBuilder,这是非常复杂的东西.
<projectDescription>
<name>modeshape-example-repositories</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Run Code Online (Sandbox Code Playgroud)
我认为它获取pom.xml,m2eclipse变量关于repo位置和settings.xml或一些配置文件信息和当前Run配置的目标/目标,它只是运行mvn与这些信息,但它做了更多,它可以产生意外的行为.
顺便说一下,它只用于开发人员实际运行>某些maven目标......?
可以请任何人帮我解决一下吗?
它可以这样做
Tika tika = new Tika();
tika.setMaxStringLength(10*1024*1024);
Run Code Online (Sandbox Code Playgroud)
但如果你不直接使用Tika,就像这样:
ContentHandler textHandler = new BodyContentHandler();
Metadata metadata = new Metadata();
Parser parser = new AutoDetectParser();
ParseContext ps = new ParseContext();
for (InputStream is : getInputStreams()) {
parser.parse(is, textHandler, metadata, ps);
is.close();
System.out.println("Title: " + metadata.get("title"));
System.out.println("Author: " + metadata.get("Author"));
}
Run Code Online (Sandbox Code Playgroud)
没有办法设置它,因为你没有与之交互WriteOutContentHandler.顺便说一下,它-1默认设置为没有限制.但由此产生的限制是100000个字符.
/**
* The maximum number of characters to write to the character stream.
* Set to -1 for no limit.
*/
private final int writeLimit;
/** …Run Code Online (Sandbox Code Playgroud) 我正在使用Apache Tika,并且我有特定内容类型的文件(没有扩展名)需要重命名以具有反映内容类型的扩展名.
任何想法是否有我可以使用的东西,而不是基于内容类型名称从头开始编程?
我正在使用文件api和xhr2规范.我创建了使用的上传(通过闪存旧版本浏览器的支持)FormData,并$.ajax(options)在那里与FORMDATA对象File是一部分options.data对象.一切都在运作.
现在我决定删除FormData因为浏览器支持不足.我无法找到上传文件的方法
var xhr = new XMLHttpRequest();
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.setRequestHeader("X-File-Name", file.name);
xhr.send(file);
Run Code Online (Sandbox Code Playgroud)
哪个不返回我可以在递归函数中使用的Promise.
我的代码是这样的:
startUpload: function() {
var that = this;
that.recurseSend(that.queue);
},
_initProgressListener: function (options, file) {
var that = this;
var xhr = $.ajaxSettings.xhr();
options.contentType = 'multipart/form-data';
options.processData = false;
options.type = 'POST';
// WHAT TO DO HERE TO avoid FormData???? What ever I put into options.data - fails
/* THIS WOULD WORK
var formData = …Run Code Online (Sandbox Code Playgroud) 有人知道如何改变吗?
我是说来自
target/test-classes ... target/classes .... maven dependencies
Run Code Online (Sandbox Code Playgroud)
至
target/test-classes ... maven dependencies .... target/classes
Run Code Online (Sandbox Code Playgroud)
它涉及这个surefire-plugin 功能请求
这是因为surefire-plugin不能包含/排除/ target/classes中的资源...它只能通过<testResources>元素包含/排除资源,这只会影响/ target/test-classes,而不是/ target/classes
这一切都发生在Surefire-plugin中:
File projectClassesDirectory = new File( project.getBuild().getOutputDirectory() );
if ( !projectClassesDirectory.equals( classesDirectory ) )
{
int indexToReplace = classpathElements.indexOf( project.getBuild().getOutputDirectory() );
if ( indexToReplace != -1 )
{
classpathElements.remove( indexToReplace );
classpathElements.add( indexToReplace, classesDirectory.getAbsolutePath() );
}
else
{
classpathElements.add( 1, classesDirectory.getAbsolutePath() );
}
}
File projectTestClassesDirectory = new File( project.getBuild().getTestOutputDirectory() );
if ( !projectTestClassesDirectory.equals( testClassesDirectory ) ) …Run Code Online (Sandbox Code Playgroud) 有可能做这样的事情:
<property name="template" value="file:/some/resource/path/myTemplate.txt" />
Run Code Online (Sandbox Code Playgroud)
通过注释而不创建自定义注释并通过反射填充该字段?它不能用@Value完成,因为它只适用于字符串......
如果没有,那么处理Spring bean自定义注释并相应地初始化bean的最佳方法是什么?
对于像odt,ppt,pptx,xlsx等文档,我需要获取iana.org MediaType而不是application/zip或application/x-tika-msoffice.
如果你看一下mimetypes.xml,那么mimeType元素由iana.org mime-type和"sub-class-of"组成.
<mime-type type="application/msword">
<alias type="application/vnd.ms-word"/>
............................
<glob pattern="*.doc"/>
<glob pattern="*.dot"/>
<sub-class-of type="application/x-tika-msoffice"/>
</mime-type>
Run Code Online (Sandbox Code Playgroud)
如何获取iana.org mime-type名称而不是父类型名称?
在测试mime类型检测时,我做:
MediaType mediaType = MediaType.parse(tika.detect(inputStream));
String mimeType = mediaType.getSubtype();
Run Code Online (Sandbox Code Playgroud)
检测结果 :
FAILED: getsCorrectContentType("application/vnd.ms-excel", docs/xls/en.xls)
java.lang.AssertionError: expected:<application/vnd.ms-excel> but was:<x-tika-msoffice>
FAILED: getsCorrectContentType("vnd.openxmlformats-officedocument.spreadsheetml.sheet", docs/xlsx/en.xlsx)
java.lang.AssertionError: expected:<vnd.openxmlformats-officedocument.spreadsheetml.sheet> but was:<zip>
FAILED: getsCorrectContentType("application/msword", doc/en.doc)
java.lang.AssertionError: expected:<application/msword> but was:<x-tika-msoffice>
FAILED: getsCorrectContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document", docs/docx/en.docx)
java.lang.AssertionError: expected:<application/vnd.openxmlformats-officedocument.wordprocessingml.document> but was:<zip>
FAILED: getsCorrectContentType("vnd.ms-powerpoint", docs/ppt/en.ppt)
java.lang.AssertionError: expected:<vnd.ms-powerpoint> but was:<x-tika-msoffice>
Run Code Online (Sandbox Code Playgroud)
有没有办法从mimetypes.xml获取实际的子类型?而不是x-tika-msoffice或application/zip?
此外,我从来没有获得application/x-tika-ooxml,但xlsx,docx,pptx文件的应用程序/ zip.
java ×8
apache-tika ×3
annotations ×2
eclipse ×2
spring ×2
ajax ×1
content-type ×1
detection ×1
editor ×1
erp ×1
evaluation ×1
file ×1
file-upload ×1
html5 ×1
javascript ×1
jquery ×1
localization ×1
m2eclipse ×1
maven ×1
maven-3 ×1
mime-types ×1
ofbiz ×1
surefire ×1