Please advise reasons for NullPointerException in a servlet dealing with request.getParameter in Tomcat 6.0.20.
The below does work where the city value does forward and show in my JSP (pageOne.jsp or pageTwo.jsp).
But it also outputs the printStackTrace() NullPointerException on this one line everytime: if(city.equals("Boston")).
The NullPointerException can be eliminated if I do this:
String city = "Boston" so I assume something is wrong with the request.getParameter.
I was also able to show the city value without NullPointerException in the Servlet output page if I use the PrintWriter and comment out the conditions: