I have 2 servlets now. I have a navigation bar on the left and a content space on the right. I use the folowing JS in order to put the servlets output in the right spot
$(document).ready(function() {
$('#navigation').load('Navigation');
$('#content').load('Content');
});
Inside the Navigation, I have links in order to get the articles that I want in the content space. So on every categoryname of my navigation, I have a reference to the other servlet. So the navigation is a servlet, and the content is a servlet. The problem is, that the content does not "get" the names of the navigation.
String category = request.getParameter("category");
String suche = request.getParameter("suche");
I try to get the category name I click on as an ID, or the search string I type in. Both do not work. A category look like this in the navigation:
out.println("<li><a><form method='get'><button type='submit' name='category' value='"+ k2.getKategorieNr() + "'>" + k2.getKName() + "</button></form></a></li>");
I gues that the problem is that everytime I click on a category, the whole HTML page makes a reload and the name that is inside the navigation servlet, cannot be refered by the content servlet so the getParameter returns always null in the content servlet. I just have no idea how I can design my web app in order to make it work. Any idea?