Java
This is the archive for Java.
Dive into the archives.
- maven and ear packaging
okay, i just needed to place some files in the ear file.
solution:
-create src/main/application
-anything you place in that folder will be included in the ear file
-DO NOT USE ’src/main/resources’, it will not get into your ear file
-thanks to cata
- Java, the IP address and reverse proxy
Okay so there is the getRemoteAddr() method of HttpServletRequest, but when you’re using a reverse proxy that won’t work and it will just return 127.0.0.1
If so, look for the header ‘X-Forwarded-For‘ of your request object. (request.getHeader(”X-Forwarded-For”)).
But this will return null if using non-reverse proxy.thanks to POLONKAI Gergely
- Transposing Records into One Field
As they say in Exist, There’s always a better way.
What I Did…
performed a loop for each record in my collection to retrieve another collection using a particular Id in the record
and placing the retrieved collection to be part of the record.
The Effect…
my screen populates very slow
The Solution…
from backend, transpose those collection being retrieved […]
- Debugging in Eclipse, calling shell scripts
Background:
i’m using Ubuntu, my Eclipse was installed via apt-get
i have Oracle installed under ‘oracle’ profile
i run and debug my program through Eclipse
Issue:
attempt to run sqlldr which is called from the webapp results to an error/sqlldr exit code 3.
Solution:
run the webapp externally, don’t use Eclipse when running the webapp(since it was installed via apt-get and uses […]
- Finding Memory Leaks
As Jon Bentley said, “Make it work before you make it work fast.”
I got this line in the JMP user guide. By the way, JMP stands for Java Memory Profiler.
Oh yeah, we’re now looking for possible memory leaks.
I also found out that JMP can be installed in Gutsy Gibbon using apt-get.
After installing, I tried running […]
- Java to DWR - decrease the file size of your javascript
It was until yesterday i realized I was doing something wrong with regards to JAVA-DWR interfacing as pointed out by Cata.
Backgrounder: in dwr.xml we define the classes(services) we use, which generates javasript which we will call facades and these can be imported in our javascript files.
My practice: In my js file, i simply import those […]

