j2ee

Running batchprocesses in Bea Weblogic

We currently have batchjobs in Java that proces mulitple (sometimes large) files. These jobs can take some time to run. We run these files directly in the JVM, using Java Threads that continuesly run in a loop. (proces files and then wait a while). Now the company I work for, wants to run these jobs in the Weblogic application server. N...

How can I add a role in code, J2EE

I'm using jboss 4.2.3 and jaas org.jboss.security.auth.spi.DatabaseServerLoginModule. After a user is logged in I want to add a role to it. How can I do it? For example, the user clicks in a button and a role is added... Clarification: I have 1 app where a user does the login. In the login the users gets some roles (from the db). Afte...

Avoiding IllegalStateException in Java/Servlet web stack

I don't know, but I feel that IllegalStateException is causing undo headache. If I have a request say a JSP or some other servlet and need to associate a filter with that request. I can't do any other modifications to the output to the client if the response has already been committed? For example, I see in JSP code that sets the mime...

How to display success message in Struts?

Hi, we could display errors in Struts by doing actionErrors.add(key, new Actionmessage("string")), addErrors(request, actionErrors); and then outputting it into a JSP page via I'm wondering, how do I output success messages in Struts? How do you normally/conventionally do it? ...

How can I enforce that a user is only logged in once in Jboss/J2EE?

I need to enforce that some users (that have a flag at true) can only have 1 active session. I mean, the users logs in 1 browser and can't login in another browser/computer. I tried using my own loginmodule but the second time I login (in another browser) the loginmodule isn't used, it seems something is being cached... ...

Tiles won't parse Struts tags

Hi, I'm tried using tiles but it seems that it's not parsing the Struts tags, It outputs them directly e.g. instead of ... What seems to be the problem? ...

What are the benefits of JCA?

Our application often connects to different king of back-ends over web services, MQ, JDBC, proprietary (direct over socket) and other kids of transport. We already have a number of implementations that let us connect from our application to these back-ends and while all of these implementations implement the common java interface, they d...

Disable Struts converting HTML tags into entities

Hi I'm using Struts 1.2 and I installed TinyMCE. The problem is that struts is converting all HTML tags into entities. How do I disable or configure this to allow only selected tags? ...

Java Web Application: Using a custom realm

Hello, I'm writing a java web application which need to perform login through a webservice. Of course, none of the realms supplied with the application server I'm using (glassfish v2) can do the trick. I therefore had to write my own. It seems however, that the realm implementation that I wrote is completely tied to glassfish and cannot...

Customizing login procedure in a java web application

Hello, I'm writing a java application which needs to perform an unusual login procedure. One of my problems is that the user needs to supply more than a simple username/password combination. Specifically, a username/password/domain combination is required. Another problem is that my application enforces some password lifetime rules (eg...

Advice on handling multiple ear deployments into jBoss

We have a typical J2EE application: ear war A war B domain jar datasource config ejb.jar EJBs JPA config We use jBoss as our J2EE container. The same application must be deployed multiple times into the same container (in order to support different independent customers). This is proving to be a troublesome and error prone task s...

What should I learn first, Spring or Hibernate?

Hi guys, I've just started learning Struts and I'm trying to be marketable for a good job as a Java programmer. My next decision would be choosing which to learn next, Spring or Hibernate? Also do you guys have any suggestions or tips for me to be good? Thanks in advance! ...

How to fix a Resource not Found error in OC4J?

I am trying to deploy a web app on OC4J, and although I've followed the instructions to the letter and the deployment process goes without a hitch, I keep getting a 500 error (below). I am a newbie in OC4J, so I would appreciate some hints on what to look at and tinker with (XML/settings/etc) to fix this. Here's the actual error, just ...

How to implement generic test for RMI connection, J2EE services?

I'd like to implement a little test to check connectivity to J2EE services over RMI. It needs to be generic, so that I could just give it a property file with the following properties set in it: java.naming.factory.initial=oracle.j2ee.rmi.RMIInitialContextFactory java.naming.security.principal=user java.naming.security.cred...

How to forward to j_security_check?

I'm using form based authentication (JBOSS/JAAS) but my form is sending the data to my Servlet so I can perform some checks before trying to login. Now I need to forward to j_security_check but what I tried didn't work (404 error)... How can I redirect/forward to the j_security_check (please note the application is running over https /...

Make URL Request from Servlet and retain Header information

I need to make a request from a servlet but I also need to retain all the header information. That is in the request object. For example, I if I do something like the following from the doGet method, is there a simple way to just pass that information to the URL Connection object? URL url = new URL(); URLConnection uc = url.openConnec...

How can I manage sessions in J2EE?

In my J2EE application, I have a problem with sessions. Different users can login to the application and the specified user can see the data for which he is authorized. He should not be able to see other user data. To differentiate users, we are using Client_ID. As soon as the user logs in we are fetching this Client_ID from the dat...

WebORB for Java or BlazeDS?

I'm in the beginning phases of a project that uses a flex front end with a java/glassfish back end. I'm curious which technology is better to connect the two, WebORB or BlazeDS. At first glance WebORB seems a little bit easier to deal with, but BlazeDS has a larger support community. ...

Is Red Hat's JBOSS a fork of the code you get from JBOSS.org?

Does anyone know if Red Hat has forked the code you download from JBOSS.org? I'm guessing that the answer is "yes", but I'd like to confirm it. I can't pin it down at the Red Hat site, and jboss.org giving me an HTTP 502 right now for some reason. I know that Red Hat owns JBOSS. Does that mean that the code they sell in JBOSS Develo...

What is the difference between Dispatcher view and Service to work design pattern?

What is the main difference between Dispatcher view and Service to work design pattern? ...