java-ee

Struts 2 security

Does Struts 2 has complete solution for simple login task? I have simple declaration in struts.xml: <package namespace="/protected" name="manager" extends="struts-default" > <interceptors> <interceptor-stack name="secure"> <interceptor-ref name="roles"> <param name="allowedRoles">registered</pa...

Java on Iphone / IPad - Java Simulator / Proxy?

Hey, I wish to have a java-chat on the iphone / ipad. With both, as far i know, it's not possible to have java there. But I see a lot of mysteriuos things in the internet the last years, so I must ask - is there any possibilty to run a java-chat on IPad / Iphone?! ...

How does ‘Servers’ view work underlying in Eclipse?

‘Servers’ is built-in view in Eclipse. We could integrate jee server into Eclipse easily. It could start/stop server both in normal and debug modes. Moreover, we could even set timeout and deployment path, things like that. Various types of server tomcat, jboss, websphere are supported, no intrusive to server. I am just curious about ho...

Pros and cons of each JEE server for developing within Eclipse?

Eclipse JEE has a lot of server adapters allowing development against many different application servers like JBoss, Glassfish and WebSphere. Frequently you can benefit from using another server for developing new features than for production, simply because it may be able to deploy changes much faster and when the functionality is in p...

JavaEE in netbeans giving BUILD FAILED error upon deployment

When I try to run my Java EE program in Netbeans consisting of servlets (java pages), JSP's, beans(java pages) and HTML pages I get this error in the output: In-place deployment at C:\Users\Derek\Documents\NetBeansProjects\EJBProject\EJBProject-war\build\web Initializing... deploy?path=C:\Users\Derek\Documents\NetBeansProjects\EJBProjec...

ThreadLocal (and Singleton) in EJB Container

I've written an authorization system which relies on objects representing the current user. To simplify programming and increase performance I want to hold those objects in a ThreadLocal after the user has logged in. It looks like this: public class UserCache { private static final ThreadLocal<User> cache = new ThreadLocal<User>(...

How to set java_home on Windows 7?

I went to the Environment Variables in 'System' in the control panel and made 2 new variables. one for user variables and one for system variables, both named JAVA_HOME and both pointing to C:\Sun\SDK\jdk\bin but for some reason, I still get the below error when running a java command... BUILD FAILED C:\Users\Derek\Desktop\eclip...

JSF - get managed bean by name

I'm trying to write a custom servlet (for AJAX/JSON) in which I would like to reference my @ManagedBeans by name. I'm hoping to map: http://host/app/myBean/myProperty to: @ManagedBean(name="myBean") public class MyBean { public String getMyProperty(); } Is it possible to load a bean by name from a regular servlet? Is there a JS...

How to find out or where to specify path of the JavaEE project?

I develop Java EEapplication and I have to create some files in the src folder in the my application. But I dont where or how to specify the path. I want my application to be portable. It means just to say TestProject/src/.... and not C:/bla/bla/TestProject/src/... do we specify this in some app file like web.inf, meta-inf or its just s...

How to receive Email in JEE application

Obviously it's not so difficult to send out emails from a JEE application via JavaMail. What I am interested in is the best pattern to receive emails (notification bounces, mostly)? I am not interested in IMAP/POP3-based approaches (polling the inbox) - my application shall react to inbound emails. One approach I could think of would be...

What to use instead validator in jaxb 2.0

JAXB version 1 spec have a Validator object, in version 2 Validator object was depricated and optional. What i need to use instead Validator object? Thanks! ...

Java Package, Project , NoSuchMethod error

I have 2 projects linked and these 2 projects each have a package under them. XProject -> XPackage -> XClass -> X1Method(); X2Method(); YProject -> YPackage -> YClass -> Y1Method(); I'm trying to call X1 and X2 methods from Y1 Method. I can call X1 Method but when I call X2 method I get a runtime error (java.lang.NoSuchMethodError:) ...

Choosing an Open Source Application Server for J2EE

Hello, I know this may be a recurring topic, but I have read a lot of articles and I still have doubts. Also, I would like to hear more recent opinions about this. The main requirements of my application server are: flexible configuration, support for a extremely high number of concurrent users. It will be a system for the mobile comm...

getResourceAsStream not loading resource in webapp

I have a web application that uses a library which resides in TOMCAT_HOME/common/lib. This library looks for a properties file at the root of the classpath (in a class called ApplicationConfig): ApplicationConfig.class.getResourceAsStream("/hv-application.properties"); My Tomcat web application contains this properties file. It is i...

Are all of the core J2EE patterns still good in context of JEE?

With the arrival of JEE and EJB 3, have any of these Core J2EE Patterns become obsolete, or stand deprecated in light of (better) alternatives? Are there any new patterns that one could use? Thanks... ...

andromda problem

hi, I work now with andromda generator,and where I try to generate code ,I have this problem : "The default goals should be specified in the section of project.xml instead of maven.xml ". I use maven1.1 to download andromda plug-in please help me!!!! ...

Dynamic Typed Table/Model in J2EE?

Hi, Usually with Java EE when we create Model, we define the fields and types of fields through XML or annotation before compilation time. Is there a way to change those in runtime? Or better, is it possible to create a new Model based on the user's input during the runtime? Such that the number of columns and types of fields are dynami...

How to store a file on a server(web container) through a Java EE web application?

I have developed a Java EE web application. This application allows a user to upload a file with the help of a browser. Once the user has uploaded his file, this application first stores the uploaded file on the server (on which it is running) and then processes it. At present, I am storing the file on the server as follows: try { ...

Auto generation of Web Service sample, help and documentation

We're using javax.jws.WebServices deployed in a Glassfish server, is there a way to auto generate documentation like the one ASMX services generates? ASMX services display methods in service ASMX services when running locally could be easily tested with a prebuilt form ASMX services provided a sample request and response XML message ...

Should we or should we not check in the classes folder in WEB-INF directory into SVN?

I use SVN, and am learning how to use it along with eclipse IDE. The first time I add classes to my package, there is no problem, the generated class files get into SVN smoothly. The moment I edit them, I get this message - "WEB-INF/classes" is obstructed. I try the "clean-up" command and the clean up command says "WEB-INF/classes" folde...