This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating Tabs in JSP using xml file  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i need to create tabs in JSP page. One way is to include the tabs in the JSP page itself. But i want to use an XML file as a source file for doing the same.

This will help in eliminating hard coding plus giving the advantage of easy modification.

Are there any APIs that allow me to use XML for creating tabs?

Thanks & Regards,
Mehul C Mandge
 
Sheriff
Posts: 21288
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many ways of reading XML. The easiest way is using DOM; JDOM can help you, but also the standard API:
Alternatively, you can use SAX or StAX for parsing and handling the events. You can even use XMLStreamReader or XMLEventReader, but if you want the easy way, DOM is the way to go.
 
mehul mandge
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi rob.

i am thinking of some way where i can just specify the name of the XML file and it will create tabs accordingly.

hope i have made myself clear.

its clear that i can read the xml file and make tabs. e.g this is the code that i am including in my JSP




but i want that the tabs foo and bar should be defined in some xyz.xml and then i use some code similar to

<tab:tabContainer id="foo-bar-container" some_attribute="xyx.xml"/>

This will be much easier.
Thanks.
 
Rob Spoor
Sheriff
Posts: 21288
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the issue is now purely JSP related, let me move it to our JSP forum.
 
Author and ninkuma
Marshal
Posts: 66537
160
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no such API.
 
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!