java-ee

java beans: difference between persistent field and persistent property?

I got the impression that if we use persistent fields, there is no need for getter methods since the entity manager references the instance variables directly. However, when I removed the getter and setter methods from an entity to have persistent fields, the values for the corresponding instance variable was not retrieved from the datab...

Which is better to continue Java EE or Spring Framework?

I am not so much experienced on enterprise systems but i have some experience on Spring framework.I start to think open source framework such as Spring,Hibernate start to become defacto in enterprise development.Do you think it is necessary to learn Java EE 6 to become experienced on enterprise development cause i do not have so much exp...

Connecting to WebService via HTTPS throws SCL Profile Allocation error

I'm trying to use Jax-WS generated classes (created using wsimport) to call a webservice over an HTTPS connection from within a Java component in the application server Sybase EAServer 5.3. I get an exception in the EAServer log with the following as its underlying cause (I have removed the URL of the webservice). 2009-11-15 18:39:...

Problem with persisting data in Google Application Engine

Hi, we are having a hard time persisting data in our google app project, we have the classes "Customer" "Reservation" and "Room". Our goal is to map a relation between these, with a one-to-many relation from Customer to Reservation and a one-to-many relation from Room to the same Reservation. The exception we get is: Error in meta-dat...

EXT GWT + java EE

Hello. My question is: what is the best way to send my jee annotated entity beans' data to the clientside to use it in a grid for example? Surely I could make the BaseModel-extended client models for each entity manually, but I wonder what could be the best-practice here. I need a step-by-step tutorial if possible. regards ...

Spring MVC Annotations with Global Context context:component-scan?

I have a spring dispatcher servlet with servlet-name "spring-mvc". The spring-mvc-servlet.xml appears as follows: <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" valu...

Custom resource in @Resource annotations added at runtime

Hello, I want to be able to do something like this in a stateless Session Bean @Resource(name="mycustomthingie") private CustomClass stuff; The value injected is context (speak: Thread) dependant. I guess this would be possible if I bind an ObjectFactory into the JNDI Context that delivers the correct Object when requested. As I und...

Examples or Uses Cases to explain EJB Transaction Attributes

There are some good explanations of EJB Transaction Attributes (and annotations) out there, for example, OpenEJB's. But sometimes when I try to cover this with someone who hasn't worked with many transactional resources, I see their eyes start to glaze over. So my question - how would you explain EJB Transaction Attributes to your gr...

Page redirect / refresh using ExtJS

Hi all, My Web application makes use of Ext JS & Java web technology. Due to the size and complexity of the application, I need to do a complete refresh of the page (load a different page) when user select some menu from the menu bar. What is the best what to redirect to the required page? For example, In my main menu, I have two...

difference between Stop, Immediate Stop and Terminate in WAS6.1

What is the difference between "Stop", "Immediate Stop" and "Terminate" in case of a Websphere Application Server instance. Specifically in the context of in-flight requests and in-flight transactions at the time. ...

Display binary tree using JSP

One of my DB tables contains data that suits well to be rendered as a binary tree. Now my requirement is to display the data read from the DB in the format of a Binary tree. The tree can go down to any level also each node of the tree should act as a hyper link so the displayed tree should not be an image. Can anyone please help me how...

How can one read a text file in a Struts 2 app.

Hi guys. Developing a Struts 2 app I run in a following problem. I need to read a text file that is deployed in web server with my app. How can I access it knowing its relative path. In other words how can I find absolute path if I know relative path inside the deployed directory. When I had similar problem with servlets I used to use t...

Turn off TRACE in GlassFish v2

I need to turn off TRACE to help close XST security vulnerabilities. I've been looking, nothing obvious so far. Any help? ...

two log4j files for EAR with two modules

Hi, I have an EAR that is made up of two modules. Both expose services and share common code. Imagine that the ear has a common.jar shared by a webservices.war and webapp.war. I use log4j to log the activities. I would like to be able to have two log files (webservices.log and webapp.log) capturing the events that are specific to each o...

Custom JSP tag - detect existence of other instances

Is it possible for a custom JSP tag to detect if there are other instances of itself within a page? If so, what's the preferred way to do this? My tag's output needs to be conditional dependent upon whether it's the only instance or not. Note that my page has three occurences of my tag, two of which have a different set of attributes fr...

Struts 2 data transfer and type conversions for primitive types.

Hi. I'm using java beans with automatic data transfer and type conversion. Ex: public class MyAction { public String execute(){ // .... } private double price; public getPrice(){ return price; } public setPrice(double price){ this.price=price; } } Let my request to be http://localhost:8080/my.action?price=21.3 Then in th...

Alternative to resource bundle properties file

Are there any other better mechanism than resource bundle properties file to localize the application? ...

Jetty JNDI Java Mail

Hi all, I am using Jetty 7 with JBoss Seam and have 2 Java Mail Sessions configured, one for support notifications and another for general notifications. The problem I am having appears to be from JBoss Seam / JSF not being able to resolve the session which I set in the Event Context to the proper Java Mail Session prior to sending the...

gxt + j2ee hosted mode

Hi. I'm trying to develop a jee+gxt application. I have an rpc call which calls a session bean's method. If I compile the project and run it in the browser, it works fine, but when I use hosted mode I get an exception like this: (edited for readability) Exception while dispatching incoming RPC call ... Caused by: java.lang.NullPointe...

What is 'Facet' in JavaEE?

I wonder not only what is Facet but also what is Facet 'in physical level' (as I understand it's not a separate jar, but what?)? I also wonder how can it affect my application after deploying. I'll explain on real example: I had 2 facets (which were created by IDE): Spring Facet and Web Facet (for jsf). I deployed it to Tomcat and my a...