草庐IT

call_impl

全部标签

java - Java 中的 "Constructor call must be the first statement in a constructor"问题

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Whydoesthis()andsuper()havetobethefirststatementinaconstructor?我想在Java中使用构造函数链。例如,对于第一个构造函数,我将一个字符串作为参数,并在我从参数字符串创建对象时调用第二个构造函数。publicclassIMethodFinder{publicIMethodFinder(StringprojectName,StringmethodName,intnumberOfParameters){IProjectproject=ResourcesP

java - jsf-api-2.2.0-m05.jar 和 jsf-impl-2.2.0-m05.jar 中的 javax.faces-2.1.14.jar 有什么区别

我对javax.faces-2.1.14.jar与jsf-api-2.2.0-m05.jar和jsf-impl-2.2.0-m05.jar的区别感到困惑我试图在不使用maven的情况下创建一个jsf项目,并且在搜索示例时我在不同的教程中看到了不同的jar依赖项。教程来自coreservlets使用javax.faces-2.1.14.jar和我从不同站点看到的其他教程使用2个jar文件jsf-api-2.2.0-m05.jar和jsf-impl-2.2.0-m05.jar我想知道这两组依赖关系的区别。提前谢谢大家。 最佳答案 jsf

java - Tomcat 6 : how to delete temporary files after a web method call has ended?

我有一个临时文件,其中包含通过MTOM二进制附件作为SOAP响应的一部分返回的数据。我想在方法调用“结束”(即完成传输)后立即将其丢弃。对我来说最好的方法是什么?我能弄清楚如何执行此操作的最佳方法是在session被销毁时删除它们,但我不确定是否有更“直接”的方法来执行此操作。仅供引用,我没有使用Axis,我使用的是jax-ws,如果这很重要的话。更新:我不确定回答者是否真的理解这个问题。我知道如何在java中删除文件。我的问题是:@javax.jws.WebServicepublicclassMyWebService{...@javax.jws.WebMethodpublicMyFi

java - 碧 Jade 报告 : How to call the report in jsp page

我使用iReport3.7.4版本制作了一份jasper报告,现在我必须在我使用servlet、jsp和struts框架、apachetomcat的java应用程序中使用它或调用该报告服务器。我想要有关如何通过一些示例调用jasper报告的步骤。 最佳答案 在iReport中编译报告将编译后的报告放在类路径中加载它JasperReportjasperReport=(JasperReport)JRLoader.loadObject(inputStream);用数据填充它。dataSource是您拥有的DataSource实例-例如Be

java - 带logback的SLF4J还是提示failed to load class "org.slf4j.impl.StaticLoggerBinder"

我有一个Maven项目,它使用带有logback的slf4j作为记录器。我可以看到这两个Artifact都在我的Maven依赖项树项中。但是每当我尝试运行我的项目时,我都会收到提示:SLF4J:Failedtoloadclass"org.slf4j.impl.StaticLoggerBinder".SLF4J:Defaultingtono-operation(NOP)loggerimplementationSLF4J:Seehttp://www.slf4j.org/codes.html#StaticLoggerBinderforfurtherdetails.我查看了链接,上面写着:Pl

java - RxJava : calling unsubscribe from within onNext

我想知道从onNext处理程序中调用unsubscribe是否合法:ListgatheredItems=newArrayList();Subscribersubscriber=newSubscriber(){publicvoidonNext(Integeritem){gatheredItems.add(item);if(item==3){unsubscribe();}}publicvoidonCompleted(){//noop}publicvoidonError(ThrowablesourceError){//noop}};Observablesource=Observable.ra

java - ClassCastException : org. slf4j.impl.Log4jLoggerAdapter 无法转换为 ch.qos.logback.classic.Logger

我正在关注this回答以便在运行时添加附加程序。尽管这适用于原始海报,但我在Loggerlogger=(Logger)LoggerFactory.getLogger("abc.xyz");行中得到了这个异常:java.lang.ClassCastException:org.slf4j.impl.Log4jLoggerAdaptercannotbecasttoch.qos.logback.classic.Loggerde.mypackage.controller.MyController.meinOeOrte(MyController.java:335)sun.reflect.Nativ

Java 接口(interface) : Calling an implementation class based on object types

我有一个接口(interface)及其2个实现说:publicinterfaceObjectProcessor{publicvoidprocess(ListobjectNames);}publicCarImplimplementsObjectProcessor{@overridepublicvoidprocess(ListcarNames){//carlogic}}publicVanImplimplementsObjectProcessor{@overridepublicvoidprocess(ListvanNames){//vanlogic}}现在使用这个接口(interface)的

Java 编译器 : How can two methods with the same name and different signatures match a method call?

我有一个名为Container的类:publicclassContainer{privatefinalMapmap=newHashMap();publicvoidput(Stringname,Objectvalue){map.put(name,value);}publicContainerwith(Stringname,Objectvalue){put(name,value);returnthis;}publicObjectget(Stringname){returnmap.get(name);}publicRget(Stringname,Functionmapper){Objectv

java - getClass() 文档中的 "the erasure of the static type of the expression on which it is called"是什么意思?

"publicfinalClassgetClass()"的文档对象的方法说:TheactualresulttypeisClasswhere|X|istheerasureofthestatictypeoftheexpressiononwhichgetClassiscalled.Forexample,nocastisrequiredinthiscodefragment:我不明白这个解释,特别是关于什么|X|据说是-“删除调用getClass的表达式的静态类型”。|X|是什么形式的符号?或者,也许,还有什么地方会|X|使用类型符号? 最佳答案