java-ee

Combining Mapped properties with Indexed properties in Struts

不想你离开。 提交于 2019-12-18 09:39:12
问题 I'm trying to have a dynamic form and, depending on an attribute type, I would like to display a different input style (textfield, radio buttons, dropdown, checklist, ...). In order to have the dynamic form, I've set up the ActionForm with a Map. Map<String, Object> values; public void setValue(String key, Object value); public Object getValue(String key); My problem comes when I try to set up a checklist or multibox. The ActionForm only passes one value, although I would have expected that

oracle 11g and integration of hibernate spring and jsf

懵懂的女人 提交于 2019-12-18 09:38:26
问题 i am using jsf 2,hibernate 4.1.4,spring 3.1,oracle 11g and maven 3. but it can not connect to oracle and has error. i downloaded the latest version ojdbc6. applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:lang="http://www.springframework.org/schema

JPA query.getResultList()?

回眸只為那壹抹淺笑 提交于 2019-12-18 09:36:48
问题 I use JPA 1.0: Query query; query = em.createNamedQuery("getThresholdParameters"); query.setParameter(1, Integer.parseInt(circleId)); List<Object[]> resultList = new ArrayList(); resultList = query.getResultList(); Here I get result as List<Object[]> , thus I have to type convert all the parameters of the row to their respective types which is cumbersome. In JPA 2.0 there is TypedQuery which return an entity object of type one specifies. But as I am using JPA 1 I can't use it. How to get

java.lang.NullPointerException at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate$SerializableLocalObjectDelegate.createObject

百般思念 提交于 2019-12-18 09:36:19
问题 I create simple maven Enterprise Application project in NetBeans 8.0.2 with GlassFish 4.1 Session scoped managed bean: import java.io.Serializable; import javax.ejb.EJB; import javax.inject.Named; import javax.enterprise.context.SessionScoped; @Named( value = "newJSFManagedBean" ) @SessionScoped public class NewJSFManagedBean implements Serializable { @EJB private NewSessionBean newSessionBean; public NewJSFManagedBean() { } public String getName( ) { return newSessionBean.getName(); } }

NullPointerException in JPA

非 Y 不嫁゛ 提交于 2019-12-18 09:30:20
问题 I am creating a Java EE application using jpa. I am getting the following error when the code is run on server [2/25/12 22:56:31:371 IST] 00000047 SystemOut O hello [2/25/12 22:56:31:375 IST] 00000047 SystemOut O Error...:( [2/25/12 22:56:31:371 IST] 00000047 SystemErr R java.lang.NullPointerException [2/25/12 22:56:31:371 IST] 00000047 SystemErr R at plh.service.ejb.UserBean.getUserDetails(UserBean.java:41) [2/25/12 22:56:31:372 IST] 00000047 SystemErr R at sun.reflect

TomEE - Unable to create annotation scanner for web module: null

允我心安 提交于 2019-12-18 09:10:48
问题 I'm sorry for the vagueness of the question title, but I'm not entirely sure what the question that I'm asking even is. I'm trying to deploy a sample application I built with GWT on TomEE, but deployment fails for some reason. I have a stacktrace, but that wall of text is completely meaningless to me. I know what an annotation scanner is, but I don't know why tomee fails to create one or how that relates to anything I have to do to fix it. The application is basically the StockWatcher one

Struts2 'Required' field Validation Interceptors not working

安稳与你 提交于 2019-12-18 09:06:28
问题 Building a login application (In Netbeans 731) which basically ensures non blank values for username and pw. The application runs fine except the validation doesn't work, so even if the user enters blank values they are taken to the Thanks.jsp page. After trying to build it as a Netbeans web app, I have rebuilt this application using Maven, with the following directory structure: The generated war file is: pom.xml : <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3

Struts2 'Required' field Validation Interceptors not working

旧街凉风 提交于 2019-12-18 09:06:02
问题 Building a login application (In Netbeans 731) which basically ensures non blank values for username and pw. The application runs fine except the validation doesn't work, so even if the user enters blank values they are taken to the Thanks.jsp page. After trying to build it as a Netbeans web app, I have rebuilt this application using Maven, with the following directory structure: The generated war file is: pom.xml : <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3

How to get transactions to a @PostConstruct CDI bean method

℡╲_俬逩灬. 提交于 2019-12-18 09:03:37
问题 I'm experimenting with Java EE 7, CDI, JPA and JSF. When the webapp starts, I would like to run an initialization method in my CDI bean (marked with @PostConstruct) that does some work with the database (inserts some rows etc..). For this I need a transaction, but this wasn't as easy as I expected. I have tried adding @Transactional annotation to my method, but apparently it only works with EJB. I actually tried converting my bean to EJB instead of CDI bean, but I still didn't get transaction

Choose EJB to be injected without recompiling

末鹿安然 提交于 2019-12-18 08:46:29
问题 Imagine you have two implementations of a @Local interface @Local public interface LocalInterface { } @Stateless public class MyFirstImplementation implements LocalInterface { } @Stateless public class MySecondImplementation implements LocalInterface { } And I want to choose, without recompiling the project (that is, at runtime or using an external configuration property) which one (MyFirstImplementation or MySecondImplementation) I want to use. public class MyClass { @EJB LocalInterface