Niklas Rosencrantz

Ranch Hand
+ Follow
since Apr 08, 2006
Merit badge: grant badges
For More
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 Niklas Rosencrantz

Hi what is a good book or other study material for the Java 7 programmer exam?
I see at amazons that the books are announced but they aren't yet out.
Any recommendations or ideas what material to focus on if I've got the Java 6 study guide?

Thank you
catch(AvoidingTheQuestionException){
Actually, Linux with JDk 1.5 doesn't seem to support GIF writing in the standard libraries. I must upgrade to 1.6 or use third party library.
15 years ago
Dear friends, why won't this code resizing a GIF image work on Linux with JDK 1.5? It works well on WinXP with JDK 1.6. On Linux it just produces an empty thumbnail image.

[ May 03, 2008: Message edited by: Niklas Rosencrantz ]
15 years ago
Thank you. I understand. I want the code to be clean and it needs cleaning. What is does is generate a list of object in a JSP page. You can see the program work at this web page. I'll try not to use the session object and will refactor the method, maybe take out the parts that work with XML reading and randomly selecting a news item from an XML file.
15 years ago
I build a classified ads web project with a listing generated by a Struts 1.3.9 Action which "works" but needs cleaning:

I just modified this from Servlet to Action. Would you propose I also change the simpler case of viewing one single object also from a Servlet to an Action, or should I keep it a Servlet?
Thank you
Niklas Rosencrantz
15 years ago
Is this as it says "encryption" or just hashing with MessageDigest? Is this good enough? Should I use SHA? Are code conventions completely followed?
15 years ago
I chose it when I had to do file uploads. It was the right choice. A good place for examples is RoseIndia Struts
If you start from scratch now you probably want Struts 2.
Or check out an example struts action which is my latest example (1.3.9)

[ April 28, 2008: Message edited by: Niklas Rosencrantz ]
15 years ago
The way I did it with Ubuntu was completely trivial, just with apt-get install and everything was set. If you want j2ee to reside in another directory I would reinstall it and try to use some installation option to specify where it installs. I myself didn't have to set up java configuration variables at all with Ubuntu. java and javac worked from any directory right after installation. I used to run Mandriva where I had to specify conf variables which isn't optimal for instance if you upgrade you have to change JAVA_HOME wherever you have it, for instance in startup files for the application server. My advice would be to avoid all manual configuration and leave as much as possible to the installer.
Good luck
Niklas
15 years ago
I believe you need to define a form bean and use the struts html:form tag.
Here are good examples to base your code on: Struts examples
I hope these clarify.
Niklas
[ April 19, 2008: Message edited by: Niklas Rosencrantz ]
15 years ago
Is request.getServerName() what you're looking for? I hope so. It works for me.
yours truly
Niklas R
15 years ago
Replace the jsp in the default ROOT directory or remove the ROOT directory if you deploy your root context as an archive.
Regards,
Niklas
15 years ago
Usually you won't have to compile mod_jk, just download mod_jk.so to the location you set in httpd configuration. mod_rewrite is usually built in with newer httpd installations or very easy to set up if you read the manual. Reading the manual worked for me with Arch Linux, Red Hat Linux, Mandriva Linux and MS-windows. If you post a specific error you receive in your configuration we can provide more help.
Hope this clarifies somewhat.
Niklas R
15 years ago
Dear guys,
I've added features and fixes to my web app which works well in the development environment, want to deploy it to production environment where users are logged on, have planned like this and would like to know if this could be a well-working strategy: When I update the web archive and deploy a new version to the app server (Tomcat 5.5) I set it to /context2 so everything still works normal from the usual /context1?
When the new tests work you deploy again and replace /context1, or change the links from / so everything points to /context2 and next deployment you replace /context1 accordingly. This way you'd be able to test the new verison once more in production environemnt with not logging off all users.
Thank you
Niklas R

[ April 16, 2008: Message edited by: Niklas Rosencrantz ]
[ April 16, 2008: Message edited by: Niklas Rosencrantz ]
15 years ago
How come the following outputs are not the same:

The two log messages are in different languages. There is something I've misunderstood since I expect the output from the two log messages to be identical. Could somebody please explain?
Thank you
Niklas
15 years ago
Thank you for the very informative replies. Indeed, my round calculation resulted in about maximum 1000 files per directory if you store a million files and have 3 directory levels, if the first 3 letters in the filenames are somewhat evenly distributed. I assume there would be about the same number of files starting with "aba" as with "abn" and that no three-letter-combination is significantly more popular than another. I can run tests on my thousands of stored files so far to see how naming of the first 3 letters is statistically.
Sincerely,
Niklas
15 years ago