Win a copy of Head First Android this week in the Android forum!

John Simpson

Ranch Hand
+ Follow
since Nov 28, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Simpson

In the code snippet, you only create one object:


Unless I am missing something, I do not see how changing the deviceId will create a new object of type ProjectDevice.

Adding the object to the ArrayList will add a reference to the object to the list. If you call the ArrayList add method twice with the same object you will end up with two references to the same object. That's my understanding anyway.
12 years ago
From my reading of the code, you are not adding 2 objects to the ArrayList. You are adding two references to a single object. From the code snippet I can not see how changing the value of the deviceId creates a new ProjectDevice.

Cheers,

John
12 years ago
My apologies, that is not what I meant to imply. The cookie I am trying to remove is created by an application with a maxAge of -1. And despite my best efforts its maxAge stays at -1.
[ January 04, 2008: Message edited by: John Simpson ]
13 years ago
The cookie is created by an authentication service which I call from the login screen. It is not the JSESSIONID cookie.
13 years ago
Hi Ulf,

I invalidate the session when the user logs out, but I want to destroy the cookie when they are still in the application.
The cookie is set by an authentication process. I want to use the data in the cookie when the user logs in, then delete the cookie, so that if the user logs out but doesn't close the session window they are forced to log back in (rather than just re-using the old cookie).

Thanks,

John
13 years ago
Apologies for revisiting a perennial topic but I'm struggling to delete a cookie.
Basically I have a session cookie that I want to access in a servlet filter then delete (expire). The code I'm using looks like this, in the doFilter method of the filter:

This appears to work fine, but the next time the user submits a request, the cookie is still there with a maxAge of -1. I'm using the Geronimo webserver.
Has anyone seen this before, and knows what I'm doing wrong?

Thanks,

John
13 years ago
Hi,

Is it possible to set a default schema for a datasource in WAS-CE? It's possible in WAS5.1 but I can't find how to do it in WAS-CE.

Thanks,

John
14 years ago
I'm probably missing something here, but I can't see a solution that will work with un-ordered data.
If the data is not ordered, then can you guarantee that rows will be returned in the same relative position over multiple queries?
Or is the data ordered but not keyed?

John
[ November 13, 2007: Message edited by: John Simpson ]
Hi,

If you are using a relational database and the data is ordered then you can do the paging in the SQL statement, on many DBs anyway.
Something like:



The fetch statement controls the number of rows returned. Set lastKey to the key of the last record in the previous page.
There's probably a better way to do it, but that should work.

John
It depends.
If I'm interested in whether s is null or whether it's equal to the string literal, then I'd go for a seperate null check and the literal on the right.
If I don't care if s is null, all I'm interested in is whether it equals the literal, then string literal on the right.
On a purely personal note, I prefer the literal on the right but that's just habit.

John
14 years ago
Thanks very much for the responses. They've given me new directions to look into.
The datasource is up and running already and is used by a web-app on the server.
What I want to do is make some of the web-apps business logic available in a 'batch' environement. I planned to use Quartz, but I've been blocked for none technical reasons. Hence, the app client approach.
I will give Merrills suggestion of using the EJB as a wrapper around the application, rather than the datasource, a go and let you know how I get on.

Thanks again.

John
14 years ago
Hi,

I'm using WAS 5.1 and want to deploy a standalone app. client to the server, to run some batch processes. I want to run the app in the server to re-use the datasource, logging etc. However, the app. client can not access the datasource directly. If I do a JNDI lookup I get a NameNotFound exception.
After doing some investigation, I found that the recommended approach is to access the datasource via an EJB. My issue is that currently the app client uses Spring to access the datasource and I'm not sure how that will interact with the EJB. Has anyone had any success with this? Is my best bet to build an EJB that also implements the SQL Datasource interface and let Spring treat it as a Datasource?

Thanks,

John
14 years ago
Hi,

Can anyone recommend a good introductory book on Portals/Portlets. The only one I can find reviewed on JavaRanch is 'Building Portals with the Java Portlet API'. As that is 3 years old, is it still the best one?

Thanks,

John
[ September 03, 2007: Message edited by: John Simpson ]
14 years ago
Hi,

The team I work in uses continuous integration, but only within a system. We run an automated unit test suite every time code is checked in. However, a lot of issues arise in the interfaces between systems, i.e. database access, remote updates, interface changes etc.
Is this something that CI could be applied to? That is CI appropriate for inter-system as well as intra-system use? If so any tips on how go about putting tests (test harnesses?) in place?

Thanks,

John
Hi,

I'm trying to deploy a simple application client in Geronimo and am getting problems trying to access a server wide datasource.
The datasource itself is OK, and is accesible from a web-app running on the same server. However, when the new application client trys to access the datasource it throws a GBeanNotFoundException. Any ideas?
The geronimo-application-client.xml has the datasource set up like this:



The application-client.xml like this:



Everything deploys OK, but when I try and run the client I get the following exception. Actually I get a lot more but this seems to be the root:



Any pointers as to what I'm missing would be much appreciated.

Thanks,

John
14 years ago