• Post Reply Bookmark Topic Watch Topic
  • New Topic

I'm totally confused over this one....  RSS feed

 
Jack Davis
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about the subject but I don't know how to sum this problem into a short sentence.
Basially I'm building a small ecommerce app and I'm using JSP. I want to make it as dynamic as possible and not have much static details.
I will be selling products and I want to categorise them. So I have dynamically generated a list of categories from my db...
String name = RS.getString("name");
I have "href" each category as so....
td><a href="<%= response.encodeURL("subcategory.jsp") %>"><%= name %></a></td>

The idea is that each category listed is linked to 1 template page rather then having a sepearte page for each category. However the problem is how can I ensure that the category I click on gives me the that category's subcategories.
Basically this is my problem. I'm a total newbie so any help is much appreciated.
Thanks in advance
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jack Davis:
The idea is that each category listed is linked to 1 template page rather then having a sepearte page for each category. However the problem is how can I ensure that the category I click on gives me the that category's subcategories.
Basically this is my problem. I'm a total newbie so any help is much appreciated.
Thanks in advance

I'm not sure if I understand you.. but, what if you send your category as a parameter? something like...
www.yoursite.com/yourJSP.jsp?category=yourCategory
in this way you only display the subcategory you want for a particular category name.
Now, you only have ONE jsp, the difference is that you're displaying different content, depending on the value of the category parameter.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!