草庐IT

matching_field

全部标签

Java/XSLT : Cannot find a matching 1-argument function

我收到以下错误:javax.servlet.ServletException:Cannotfindamatching1-argumentfunctionnamed{http://exslt.org/dynamic}evaluate()atorg.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)atorg.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774

java - BeanWrapperFieldsetMapper 映射 PropertyEditor per field basis

我正在使用springbatch进行文件到数据库的处理,目前我正在使用PropertyEditors将分隔文件中的字符串转换为下面提供的某个对象。Map,PropertyEditor>editors=newHashMap();CustomDateEditordateEditor=newCustomDateEditor(newSimpleDateFormat("yyyy-MM-dd"),true);editors.put(Date.class,dateEditor);因此,如果我有一个日期字段,我将使用CustomDateEditor并成功解析给定的格式日期字符串。但是,如果我在同一文件

java - FindBugs - SE_BAD_FIELD 规则,为什么它会忽略 java.lang.Object?

来自SE_BAD_FIELD的描述:Non-transientnon-serializableinstancefieldinserializableclassThisSerializableclassdefinesanon-primitiveinstancefieldwhichisneithertransient,Serializable,orjava.lang.Object,anddoesnotappeartoimplementtheExternalizableinterfaceorthereadObject()andwriteObject()methods.Objectsofthi

java - Spring 数据 MongoDB : How ignore unique indexed field when Document is embedded in another one?

我有一个这样定义的Contract类:@DocumentpublicclassContract{@IdprivateStringid;@Indexed(unique=true)privateStringref;privateStringstatus="pending";//getter&setter&hashcode&equals&tostring...}我想随时间保存契约(Contract)状态,所以我创建了一个Version类,如下所示:@DocumentpublicclassVersion{@IdprivateStringid;privateContractcontract;pr

java - 好的设计 : How use fields of superclass

这个问题在这里已经有了答案:关闭11年前。PossibleDuplicate:Javaprotectedfieldsvspublicgetters如果我有B类扩展A并且在A中我有一些我也在B中使用的字段,最好使这些字段受到保护并从B类中调用它们或为此字段编写getter方法,因此使用此方法来自B级?(此字段在A的构造函数中设置)

java - SonarQube 误报鱿鱼 :S1450 for @Getter (lombok) annotated fields

我想我在使用@Getter时发现了误报来自ProjectLombok的注释.在下面的示例类中,我收到警告“仅用作方法中的局部变量的私有(private)字段应成为局部变量”(squid:S1450)。publicclassExample{@GetterprivateStringexampleField;//有人可以证实吗?是SonarQube规则中的错误还是我的类(class)或我对该规则或@Getter注释的理解有问题?为了完整起见:项目lombok注释或生成的方法在其他SonarQube规则中被正确识别。所以我认为我的设置很好。我还尝试将@Getter注释放在类级别,但我收到了同样

Java 证书异常 "No subject alternative names matching IP address ... found"

我正在尝试在我的网络服务器中实现一个自签名证书,并且它已经可以与firefox和chrome一起工作(无论是从服务器本身还是从远程机器)......但是我无法让它与java一起工作.我已经创建了一个包含我的证书的keystore文件,但每次我尝试连接到服务器时,它都会给我一个SSLHandshakeException:javax.net.ssl.SSLHandshakeException:java.security.cert.CertificateException:Nosubject找到与IP地址192.168.178.71匹配的替代名称我用于此测试的代码是:publicstatic

java - hibernate 映射 : ignore a super class field

我有一个A类和B类publicclassA{intf1;intf2;intf2;}publicclassBextendsA{}我的问题是如何忽略映射到B的表中的字段,例如“f2”? 最佳答案 假设我对您的帖子所做的编辑获得批准,我将尝试回答。在下面的代码中,我忽略了类A中的字段f2,即使用AttributeOverride的B的父类(superclass)。@Entity@AttributeOverride(name="f2",column=@Column(name="f2_col",insertable=false,updatab

Java8 : how to copy values of selected fields from one object to other using lambda expression

我正在尝试了解java8的新功能:forEach和lambda表达式。尝试重写这个函数:publicTcopyValues(Classtype,Tsource,Tresult)throwsIllegalAccessException{for(Fieldfield:getListOfFields(type)){field.set(result,field.get(source));}returnresult;}使用lambda。我觉得应该是这样的但是做不对:()->{returngetListOfFields(type).forEach((Fieldfield)->{field.set(

java - 什么是 java.io.IOException : invalid header field?

当我尝试运行以下命令时:jarcvfmmyjar.jarmanifest.txt*.class我得到以下异常:java.io.IOException:invalidheaderfieldatjava.util.jar.Attributes.read(Attributes.java:410)atjava.util.jar.Manifest.read(Manifest.java:199)atjava.util.jar.Manifest.(Manifest.java:69)atsun.tools.jar.Main.run(Main.java:171)atsun.tools.jar.Main.