Here, Genre is the servlet and genreID and ID are the two different parameters. Every time a link is used, only one parameter is sent. They are both integer parameters.
My problem is right now I start my Genre servlet by reading in both of those parameters as such: int genreID = Integer.parseInt(request.getParameter("genreID")); int ID = Integer.parseInt(request.getParameter("ID"));
However just using this in my servlet causes an error during runtime. I suppose I cannot read in a value if it has not been assigned a value?? How can I solve this problem??
Basically because this is a controller servlet I want it to be able to handle multiple similar requests. In this example, if it receives a genreID, then it retrieves a whole category of music. If an ID is received, it retrieves just one cd.