beans

NHibernate: Violated not-null constraint when saving HasMany relation with Cascade=AllDeleteOrphan

Hi, My bean looks like this: public class A { ... [HasMany (MapType = typeof(B), Table = "B_table", ColumnKey = "A_object_id", Fetch = FetchEnum.Join, RelationType = RelationType.List, Index = "id", Cascade = ManyRelationCascadeEnum.AllDeleteOrphan)] IList<B> BList { get; ...

Problems overriding a property to null in Spring bean declaration

Just wondering if there is a way in Spring to have a parent controller: <bean id="parentController" class="org.springframework.web.portlet.mvc.SimpleFormController" abstract="true"> <property name="validator" ref="validatorImpl"/> ... </bean> , and a class extending it: <bean id="child1Controller" class="com.portlet.contr...

Spring: How to assure that a class is only instantiated by spring and not by keyword new.

Hi, Is it possible to assure that only spring can instantiate a class, and not by the keyword new at compile time? (To avoid instantiating by accident) Thank you! ...

How to use bean in JSP?

How to use bean in JSP with only <jsp:useBean>, not MVC? Assume you have a grade.txt file which contains following data: Tom 90 Jerry 70 Katy 80 John 60 It asks you to create a bean named grade.java, a JSP page named graderesult.jsp, and a html page named gradecheck.html. gradecheck.html provides a input textbox and a button submit...

where can i get basic concepts of java beans?

suggest me the tutorial of java beans.. Thanks in advance. ...

BeanCreationException in Spring Framework .WAR deploy to Tomcat 6 on Ubuntu 9.10

I am in the process of switching from a Windows box to Ubunutu and I want to run my own local instance of Tomcat 6. I have installed Tomcat 6 without any basic issues. When I try to deploy a .war file that I had running on the Tomcat 6 instance on my Windows box I am getting the following error.... Apr 26, 2010 3:30:27 PM org.apache.c...

Spring bean creation via deserialization

Spring has many different ways of creating beans, but is it possible to create a bean by deserializing a resource? My application has a number of Components, and each manipulates a certain type of data. During test, the data object is instantiated directly and set directly on the component, e.g. component.setData(someDataObject). At run...

dynamically create class in scala, should I use interpreter?

Hi, I want to create a class at run-time in Scala. For now, just consider a simple case where I want to make the equivalent of a java bean with some attributes, I only know these attributes at run time. How can I create the scala class? I am willing to create from scala source file if there is a way to compile it and load it at run tim...

How can I make properties in properties files mandatory in Spring?

I have an ApplicationContext.xml file with the following node: <context:property-placeholder location="classpath:hibernate.properties, classpath:pathConfiguration.properties" /> It specifies that both properties files will be used by my application. Inside pathConfiguration.properties, some paths are defined, such as: PATH_ERROR=/...

Get all existing session beans from all users in Spring

Is there a way to get all existing session beans managed by Spring at runtime? Getting them for the current user is easy. Any suggestions? Thanks, XLR ...

JBoss - BSHDeployer Service - Redeploy ?

Does anyone know how to, in a JBoss Server (no matter the version), redeploy the BSHDeployer Service, via the JMX-CONSOLE ? ...

How to access session bean in EJB

Hi! I'm new to ejb. I've created the session bean in one computer. And i want to access that session bean from the another system. How to do this? Thanks in advance :-) ...

In JSF1.2 is it possible to redirect to a bean before a page is rendered?

Hi all, I know that in Seam, we could write an xml file (if my jsf page is named index.jsf -> index.page.xml) that we could add there action execute="#{loginAction.checkIfBlaBla}" so that JUST BEFORE the index.xhtml is rendered we could call a method of a Bean (Session or Managed, in seam it doesnt matter) I am wondering if it is al...

Spring bean's DESTROY-METHOD attribute and web-application "prototype"d bean

Can get work the attribute "destroy-method". First, even if I type non-existing method name into "destroy-method" attribute, Spring initialization completes fine (already strange!). Next, when a bean has a "prototype" scope, then I suppose it must be destroyed before the application is closed. That not happens, it is simply never ca...

Create spring beans, based on a comma-separated list of classes

Is there a way in Spring to create a collection, or array, of beans, based on a comma-separated list of classes. For example: package mypackage; public class Bla { private Set<MyBean> beans; public void setBeans(Set<MyBean> beans) { this.beans = beans; } } With the application context: <bean id="bla" class="mypackage.Bla"> <pro...

Hibernate Beans generator

Hi, Does anybody know if there is any program able to create beans classes from a SQL file ? Thank you. ...

Spring - How to insert a nested bean using a SimpleJdbcDaoSupport class

I have two beans (POJOs) - a Customer and an address class defined like this: public class Customer { private String name = null; private Address address = null; public Customer() { address = new Address(); } public String getName() { return name; } public void setName(name) { this.name = name; } //addit...

Different ways of crating an instance of class

What are the different way a bean can be created in web development? I know we can use <jsp:useBean />, <bean:define />, or JSON format. Are there more choices? What are their advantages or disadvantages? ...

How to define an Integer bean in Struts 1.x

Hi. How do you instantiate an Integer bean, assigning a value, in the Struts 1.x framework? <bean:define id="index" type="java.lang.Integer" value="0"/> or <bean:define id="index" type="java.lang.Integer" value="${0}"/> Results in a: java.lang.ClassCastException: java.lang.String <bean:define id="index" type="java.lang.Integer" v...

JSP + View bean complete example

I found this interesting tutorial that explains the concept of view bean with some code snippets http://www.ibm.com/developerworks/ibm/library/i-extreme5/, but I'd like to view a complete (simple) web application in a real world scenario using plain JSP and view beans (not using struts, spring or jsf framework). Thanks for pointing me to...