Matthew Brown wrote:OK, here's how you diagnose it.
The error is a NullPointerException. That means you're trying to call a method on a null object, or something similar.
The error tells you it is caused by line 24 of BeerExpert.java. That is:
There's only one way that line can throw a NullPointerException. That's if brands is null. So where is brands initialised? And as far as I can tell, it isn't. That's your cause.
There may or may not be a logical problem with your colour attribute - I haven't checked - but that's not what causes the exception.
Bear Bibeault wrote:Yes, you must attend to the NPE before all others.
Bear Bibeault wrote:You commented out the line that creates the array list.
Tom Hilliard wrote:Its all this bean stuff that confusing me, I understand java enough to make a relatively complex web app using servlet/jsp...
Tom Hilliard wrote:Just because I can't articulate it well, doesn't mean I'm out of my depth.
Paul Clapham wrote:A <c:forEach> element would be just the thing for that.
and the result I get from "view page source" is
are in the "compile time libraries"
Bear Bibeault wrote:
are in the "compile time libraries"
Irrelevant. Are they in WEB-INF/lib?
Bear Bibeault wrote:Yeah, you don't want overlapping jars. Remove the irrelevant one.
Is that a runtime error or an IDE warning? IDEs suck at web apps.
Bear Bibeault wrote:The convention of using reversed domain names is in order to avoid collisions with someone else's packages. Generally, you use a domain that you own, because that guarantees uniqueness. No one else can own that same domain.
For example, I own bibeault.org, so my personal projects use a package structure that follows: org.bibeault.project-name... where project-name is the name of the project to which the package belongs. E.g. org.bibeault.frontman, org.bibeault.resume, org.bibeault.bddb, org.bibeault.discovery, and so on.
When I'm working on a client's project, the packages are named using one of the client's domains.
If you don't own a domain, you should. You can't be considered a serious web developer if you don't own at least one domain.
Hey! Wanna see my flashlight? It looks like this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|