joseph corner

Ranch Hand
+ Follow
since Feb 20, 2004
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 joseph corner

Well, I tried inverting the image after the colour conversion operation, and that gave a much better result. The final image looks very washed out though.

I have tried various different colour profile files, with more or less similar results.

Does anyone have any ideas or alternative places online to follow this up?

Thanks
12 years ago
Hi,
I'm using JAI to convert CMYK jpgs to RGB, as java throws exceptions on handling CMYK jpgs.
I've got something working, but the result is a very dark image, so I'm clearly going wrong somewhere. Any ideas how this code might be improved?

12 years ago
Thanks, I'll take a look at that. Do you know if HSQLDB uses up a lot of resources when used in a server-side application in this way? (Memory?)
13 years ago
Long story.
- The application is a plugin in a larger web app which is hosted remotely. Setting up db connections to it is complicated.
- I want the plugin to be self-contained and portable.
I guess I could use one of those embedded databases - Berkeley? That seems a bit over the top in this case though.
[ March 19, 2007: Message edited by: joseph corner ]
13 years ago
Hi,
I am writing a java server-side application which needs to store info about educational courses, and users in those courses.

When retrieving data, I need to ask:
- does this course already have an entry?
- if so, which users are listed there?

When storing data, I need to ask:
- does this course already have an entry? If so, append user entry. If not, create course entry, append user entry.

It's not convenient to use a database for this. So my question is: should I create an xml file of users for each course, then check for the existence of the course using file.exists()? Or should I put all courses and users in one xml file?
Or some other approach - perhaps not using xml?

I'm interested in terms of speed and overhead.

Thanks!
13 years ago
Hi all,
I have a java web app which connects to a MySQL database, using a datasource which i have defined in tomcat's server.xml, DefaultContext tag, as follows:



When I restart the web server with the java app, the connection works without problems. If I then go away and come back an hour later, and try to connect to the db again in my web app, it takes aaaaages to connect to the db. It doesn't time out, it just takes a looong time to connect and display the page with the results. (10 mins?) I am closing all my resultsets, statements and connections in my servlet code.
Once the connection is finally made, the web app seems to run OK. Any ideas what might be wrong?

Thanks.
[ March 15, 2007: Message edited by: joseph corner ]
That would certainly do it. Thanks.
13 years ago
Hi Bear,
Yes, the distinction is made between GET and POST, so passing the variable on the end of the url doesn't work.

D Rog, I didn't understand your solution. I have found examples of sending POST requests from JAVA and handling the return, but (perhaps I'm confused here) I actually want to direct the user to the page expecting the POST request.
13 years ago
Hi,
I have a servlet which uses a requestdespatcher to forward the user to various pages according to the action they have chosen in a webapp.

In one case I want to forward them to the login page of a php blog software package. I want to fill the username field on the login page with their username, which I have in the servlet.

I can see how to do this - I need to pass the username as a [_POST] variable for the php page to read. I can do this from an html web form, but how do I do it from a java servlet?

Hope that made sense! Thanks.
13 years ago
I was thinking in terms of efficiency - that it would be better to just have a single datasource object. I'm not totally clear on how Tomcat's pooling works, so this also seemed likely to ensure that there would just be one pool of connections, as they all come from the same datasource.

Am I on the wrong track?
I have a web application which uses Tomcat's connection pooling. I am paranoid about opening and closing connections efficiently. Does this approach seem reasonable? I use a singleton class to create a single datasource, then use that for opening connections:





Thanks for any feedback / reassurance!
I tried some basic ftp transactions using com.fooware.net.
The application just hung when trying to connect - no error message. I'll try it again from a stand alone java app., and will take a look at jakarta commons net too..
14 years ago
Hi,
I have ftp running on the remote server, and I could also run a servlet there to read and write the images.
What would people's best solution be, in terms of efficiency and speed?
My first experiments with ftping from my servlet have been unsuccessful....
Thanks.
14 years ago
Hi,
Do I really need to mount the remote file system?
Is this a basic security feature of java, that it can't write to a folder on a remote web server?

My case is complicated by the fact that my web app is a plugin in a larger application, and I don't have direct access to the web server which runs it. So I'd prefer not to have to set up mounted file systems.
14 years ago
Hi all,
I have a servlet/jsp forum application which supports image upload. For storage space reasons, I would like to write the uploaded images to a different server than the one hosting my web app. Obviously I will also need to read the image data from there.

I am having difficulties sorting out my file permissions - if I fix this will I be able to read and write to absolute file URLs? Or is it more complicated than that... ?

Thanks.
14 years ago