j2ee

Resource injection in webapplication JBoss 5

Is it possible to inject resources (like message queues, EJBs) using the @Resource annotation in webapplications running in JBoss 5? The webapp is part of an .ear file. ...

Drap and Drop in Eclipse for Web Projects

Is there an equivalent drag and drop style for Eclipse (or any IDE in Java) for J2EE or JSP that is similar to the IDE feel of ASP.NET in Visual Studio? ASP.NET allows you to drag and drop controls to a web form or web page. ...

Java Application Architecture Guide

Is there a Java Application Architecture Guide that is a counterpart of this: http://www.codeplex.com/AppArchGuide ? ...

JSF tutorials

Are there any good JSF tutorials? Let's say I'm new to JSF. Any way that my skills would get up to speed? Any good sites? ...

JPA tutorials

Let's say that I'm new to JPA, is there a way to get my skills up to speed? Are there any good tutorials? ...

How to inject variables with EJB3 via XML?

I have a single set of EJB code that I want to deploy multiple times with different resources. Currently, the code looks something like (oversimplified): @Stateless public class Bean implements BeanLocal { @Resource(mappedName="stateBean") private StateBean state; } Now, I want to be able to deploy the code once, and create d...

Can Hibernate be used in performance sensitive applications?

I'm seeing performance problems with retrieving multiple instances of objects that have many relationships with other objects. I'm using Spring and Hibernate's JPA implementation with MySQL. The issue is that when executing a JPA query, Hibernate does not automatically join to other tables. This results in n*r + 1 SQL queries, where n is...

Oracle converts empty string to null but JPA doesn't update entity cache correspondingly

It's a well known fact, that Oracle treats empty strings as null. However, I'm having an issue because of this behaviour due to JPA's caching. First I persist using JPA (Toplink Essentials) an entity, which has an empty string as one field. Oracle converts this value to null when it stores it. However, when I fetch the entity, JPA see...

Why do I get a NameNotFoundExcpetion when using context.lookup("java:comp/env/MyBean")

Why do I get a NameNotFoundException when using context.lookup("java:comp/env/MyBean") but not when I use context.lookup(MyBean.class.getName()) ? The error reports "No object bound for java:comp/env/MyBean" How do I bind the name and why does class.getName() still work? Why would I use java:comp/env ? I'm using Netbeans 6.5, Glassfish...

Singleton in Java App Server.. How bad of an idea is this?

I am currently working on some older java code that was developed without App Servers in mind. It is basically a bunch of "black box code" with an input interface, and an output interface. Everything in the "black box" classes are static Data Structures that contain state, which are put through algorithms at timed intervals (every 10 s...

Purpose of DynaValidatorForm

What is the use of DynaValidationForm in struts? I have read an article that it reduces the lines of code and complexity. Can anyone tell how it is so. Thanks in advance ...

What does the crossContext attribute do in Tomcat? Does it enable session sharing?

All I can find in the Tomcat 5.5 docs is: Set to true if you want calls within this application to ServletContext.getContext() to successfully return a request dispatcher for other web applications running on this virtual host. Set to false (the default) in security conscious environments, to make getContext() always return null. I...

Calling a Remote Bean vs Local Bean in App Server

Is there a noticeable amount of performance overhead in using Remote Bean Interface over using a Local Bean Interface? I would like to have every Client application connect to remote beans if there is little performance difference. ...

Using JMS, is there any way to store messages on intermittently disconnected clients and forward them to a broker when a network is available?

I am considering an architecture where I have clients that are intermittently connected to a network. I would like to store messages created on these clients in a JMS queue when the network is not available and have these forwarded to a central message broker when the clients are on the network. (The user has control over the network, e....

Any way to share session state between different applications in tomcat?

We want to split a working application in two different wars in order to be able to update one app without affecting the other. Each webapp will have different ui, different users and different deploy schedule. The easiest path seams to be sharing the same session, so if app A set session.setAttribute("foo", "bar") app B will be able t...

HQL order by within a collection

I have 2 entities: car and wheels (oneToMany) and I want to retrieve my car, with all the wheels and (this is the tricky part) ordered by wheels.location. Select c from Car LEFT JOIN FETCH c.wheels order by c.wheels.location doesn't work: "illegal attempt to dereference collection". Any idea how to do this and if this is possible in HQ...

Objects of session and request

In struts, where does the session object created & which class or method creates it? Likewise where does the request object created & which class or method invokes it? Thanks in advance ...

JSF 1.2 Custom Component - Body Content From Backing Bean

Hi I am developing a custom component using JSF 1.2 . My tag class extends UIComponentELTag and has variables of data type ValueExpression. The values for these are getting set from the corresponding attributes of the tag. (Using setProperties function) Example, <sr:show name="#{backingBean.name}" ...> #{backingBean.mainContent}</sr:...

Can Java Code tell if it is in an App Server?

Is there something I can call from a POJO to see if the code is currently in an App Server or outside of an App Server? Something like this (In rough PseudoCode): System.getRunningEnvironment().equals(Environment.Glassfish) or System.getRunningEnvironment().equals(Environment.ApplicationServer) or System.getRunningEnvironment().e...

How to correctly do a manytomany join table in JPA?

I need 3 entities: User, Contract (which are a many to many relation) and a middle entity: UserContract (this is needed to store some fields). What I want to know is the correct way to define the relationships between these entities in JPA/EJB 3.0 so that the operations (persist, delete, etc) are OK. For example, I want to create a Use...