Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

treeview from database  RSS feed

 
satheesh subramani
Greenhorn
Posts: 29
Fedora Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a database table (named Topics) which includes these fields :

topicId
name
parentId
and by using them I wanna populate a TreeView in jsp. How can I do that ?

Thanks in advance...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by learning HTML. Then define the HTML to display the view the way that you want. Then you will be ready to think about how to construct it from the database values using servlets and JSP.
 
Shashank Ag
Ranch Hand
Posts: 88
Java Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thing is you are trying to co relate between Java AWT/Swing coponents and web application.
Although you can do this but its little tricky and involves applet, if are not kick ass web developer (but a fine J2SE developer).

1. Make a servlet which fetches data from database and converts it into some data transfer object or an instance of awt/swing tree.
2. Within above servlet serialize the object made and write itinto response.
3. Make a seperate applet in which url of servlet is called by java.net.* package.
Read the response and reinflate the data/tree object.
4. Add applet to any html page.

NOTE: To call java.net.* from applet you will need to pack applet in jar and then sign it using jarsigner included in jdk.

Although, I will say you should use this only if you are very beginner to web applications.
Besides, JSF tag libraries can generate tree stucture in html but implimenting JSF is altogather different story.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!