Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unordered list in java for JSP page from database

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hello Friends,

I was trying to generate unordered lists from database through java code in JSP. I am facing difficulties to generate subcategories in <UL> list.

I have a table with Menu Items :



I want to list get the out put in the form as below :


What i have written is :



Could you please help me where i am wrong.. how should i join the tables? any idea? Could you please help me how to retrieve sub categories and get the output in :

<ul>
<li>
<ul>
</ul>
</li>
</ul>

Please help me if you can.. Thanks a lot!

Rgds,
Paddu

[ September 14, 2008: Message edited by: Paddu Hegde ]
[ September 14, 2008: Message edited by: Paddu Hegde ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Paddu,
First of all, note that it is considered extremely poor practice to put Java code in a JSP - especially JDBC code.

I can think of two possible approaches here.
1) Do the query as you are doing and create a Java data structure to represent what you want to output.
2) Write a query to generate the following and use a new entry in the first column to drive the header.
solutions - web
solutions - development
products - softies
etc
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
A solution was provided in your Sun Forums post on this same subject:
Unordered List <UL> generation in JSP.
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic