E Armitage wrote:In your servlet you have but you don't seem to be initializing getData anywhere.
Also, you don't seem to be closing your database resources anywhere in your code. You must close connections, Statements and result sets in a finally block after using them or use the try with resources feature of Java 7+.
Roel De Nijs wrote:If you initialize the instance variable getData correctly (and preferrably mark it final)you can't have a NullPointerException on this line of the RetrieveData classThat's impossible! Because on that line you'll only get a NullPointerException if getData is not initialized (and thus is null), unless you have changed the code but still are running the old code. But it's possible that a NullPointerException is still being thrown, but not on the same line...
PS. Why are you using data members in capital case with underscores? Never heard of the Java naming conventions?
Marsoni Hutao wrote:Thank, you very much for the help, The issue was with the JSTL library, I've fixed it. And the output looks great.
Roel De Nijs wrote:And how did you solve the problem?
It might be helpful for other ranchers facing a similar issue.
Marsoni Hutao wrote:
It might be helpful for other ranchers facing a similar issue.
Thanks for poking me on that and sorry that i forgot to post the solution
Marsoni Hutao wrote:
In Servlet i initialized an object
Don't get me started about those stupid light bulbs. |