javabeans

JavaBeans ActiveX Bridge for Java 8?

二次信任 提交于 2019-12-01 11:14:51
There used to be a JavaBeans ActiveX Bridge but AFAIK this is no longer supported under Java 8. I want to call my JavaBeans from Excel, so what is the way to go with Java 8? The problem is I have some legacy JavaBean packaged in a dll that I use from Excel VBA. I don't have the source code to this bean. But I still want to use it with Java 8/9. Is this possible? I solved the problem using Obba : I read the Java bean with a Java parser and generated a VBA wrapper method for each Java method that I want to call. The wrapper calls the original Java method using Obba. I created a VBA class

How to dynamically add properties to class [closed]

China☆狼群 提交于 2019-12-01 11:14:22
I am developing framework for our products. I would like to add dynamically properties to a class. So if any of you have any sort of experience, kindly help me out. Any of your suggestions are welcome. I believe what you are asking for is not the right option here. Although in theory you can modify the byte code of your program to add a property dynamically as you describe, it is not a good idea at all. I suggest you use a HashMap that maps a property name to its value and interactively modify that map. 来源: https://stackoverflow.com/questions/14442998/how-to-dynamically-add-properties-to-class

Exception inside CORBA when accessing a remote bean

ε祈祈猫儿з 提交于 2019-12-01 10:59:20
On Windows Server with Glassfish 4.0 and JDK 1.7_55 I getting NoClassDefFoundError and ClassNotFoundException then invoking remote bean methods. StandardWrapperValve[action]: Servlet.service() for servlet action threw exception java.lang.ClassNotFoundException: com.sun.corba.ee.impl.orb.ORBSingleton at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ... at com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke(CodegenStubBase.java:226) at dudge.ifaces.__SolutionRemote_Remote_DynamicStub.getSolutionEager(dudge/ifaces/__SolutionRemote_Remote_DynamicStub.java) at dudge

JavaBeans ActiveX Bridge for Java 8?

▼魔方 西西 提交于 2019-12-01 09:24:47
问题 There used to be a JavaBeans ActiveX Bridge but AFAIK this is no longer supported under Java 8. I want to call my JavaBeans from Excel, so what is the way to go with Java 8? The problem is I have some legacy JavaBean packaged in a dll that I use from Excel VBA. I don't have the source code to this bean. But I still want to use it with Java 8/9. Is this possible? 回答1: I solved the problem using Obba: I read the Java bean with a Java parser and generated a VBA wrapper method for each Java

Java Beans - creating an inspector window

回眸只為那壹抹淺笑 提交于 2019-12-01 08:49:15
I'm wondering whether there is an existing Java class that, given a Java bean, uses introspection to find all the publicly modifiable fields, and displays them using default PropertyEditors. I see a bunch of information about BeanInfo, PropertyEditor, Bean Customizers, but nowhere can I find actual examples. Basically I want the functionality of the Inspector window from XCode or the Properties panel in Netbeans. Found another potential one: Java-Bean-Examiner . But I cannot log into the CVS to download the source. I82Much Looks like L2FProd commons library has something just up my alley: http

@SessionScoped CDI bean is a different Instance when injected

两盒软妹~` 提交于 2019-12-01 06:52:23
My config is a bean that I inject in my code wherever I need it. However, when injected, I get a new instance of the bean instead of the one from the session. My bean: @Named @SessionScoped public class TestModel implements Serializable { private static final long serialVersionUID = 4873651498076344849L; private String version; public String getVersion() { return version; } public void setVersion(String version) { this.version = version; } public void changeVersion() { this.version = "Version 2"; System.out.println("New version : " + version + ", Object : " + this); } } When injected in

Bind an inputRichText to a Bean

本秂侑毒 提交于 2019-12-01 06:17:16
问题 I'm trying to bind an xp:inputRichText to a bean (ChatBean), but get this validation error when the code tries update the field to the bean: java.lang.IllegalArgumentException: argument type mismatch I've tried a few of different things like converters to make sure the text will be a string, printing debug messages to find out where things go wrong, changed the type of the "setChatContent()" method (that sets the input to read-only), but can't get it to work. Am I missing something, or is it

net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : First_name

大兔子大兔子 提交于 2019-12-01 04:41:51
问题 I want to create CSV with Jasper Reports. There are many related questions, but nothing is working for me. Below is my bean class: public class DataBean { public String First_name; public String Last_name; public String Designation; public String Department; public void setfirstName(String First_name) { this.First_name = First_name; } public String getfirstName() { return First_name; } public void setLastName(String Last_name) { this.Last_name = Last_name; } public String getlastName() {

How to get the value of complex JavaBean

血红的双手。 提交于 2019-12-01 04:19:08
问题 I have a .jrxml file and I would like to pass some params from the code to it. I have an Orde r class that has fields like double price , int quantity and Product product . The situation is simple, when i need to pass price or quantity, I just do something like this: <textFieldExpression class = "java.lang.Integer"> <![CDATA[$F{quantity}]]> </textFieldExpression> The problem appears when I try to pass product.getName() . I tried something like: <textFieldExpression class = "java.lang.String">

How to control order of bean init-method invocation in Spring?

自作多情 提交于 2019-12-01 03:48:56
Suppose I have bean, which init-method or constructor should be called after init-method of another bean. Is it possible? Use depends-on attribute in spring context XML file: <bean id="beanOne" class="ExampleBean" depends-on="manager"> <property name="manager"><ref local="manager"/></property> </bean> or @DependsOn annotation on bean if you are using annotations. Use @DependsOn annotation or depends-on attribute if you're using xml configuration. You can use de depends-on attribute on your second bean. Reference: http://static.springsource.org/spring/docs/1.2.x/reference/beans.html#beans