• Post Reply 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

how to include 'header tab' in JSP ?

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I saw in some applications (like www.etrade.com), they have header tabs like "Home", "Account", "Investing", etc. If you click one tab, it pops out its own content page. This method elegantly groups information together.
I want to know ---
1. Do we have to use Javascript to do it ? Is there any way to do it without using javascript ?
2. Can we just use JSP (without javascript) to do this kind thing ? How ? any resource ?
Thanks,
Steve
 
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:
  • Quote
  • Report post to moderator
Basically you can do anything on the client side that you can do with HTML/JavaScript, and nothing more. JSP is a server-side technology which can help you manage the creation of the pages that are sent to the client, but once sent off to the client, you are stuck with what the browser supports.
So you need to figure out how to accomplish the client-side appearance and behaviors that you want using client-side technology, then user server-side technology (if appropriate) to render those pages.
hth,
bear
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Steve,
The eTrade site top-menu is server-side code not JavaScript. When you click on a menu a request for the page is sent to the server. The page itself knows which menu option should be highlighted.
This can be acheived quite easily using JSPs. Typically you will create a separate JSP that just generates the menu section page and then include this at the top or your main JSPs using <%jsp:include %>. A more elegent alternative would be to use the templating ability supported by Tiles which are part of the Apache Struts project
[ April 08, 2003: Message edited by: Andy Bowes ]
 
Steve Yu
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Andy Bowes:
Hi Steve,
The eTrade site top-menu is server-side code not JavaScript. When you click on a menu a request for the page is sent to the server. The page itself knows which menu option should be highlighted.
This can be acheived quite easily using JSPs. Typically you will create a separate JSP that just generates the menu section page and then include this at the top or your main JSPs using <%jsp:include %>. A more elegent alternative would be to use the templating ability supported by Tiles which are part of the Apache Struts project
[ April 08, 2003: Message edited by: Andy Bowes ]


Thanks lot Andy, I looked at the "source" of eTrade web site and saw the follwoing thing --
href="javascript:GoToETURL('/e/t/invest',''); //">Investing</a>
it seems that once the "Investing" tab is clicked, it uses javascript to connect to a server side code and returns back a separate page.
I certainly hope this whole thing can be done without javascript. Could you show me any sample code or web site that uses only JSP/html skill to do the top menu tab thing ? That will be greatly helpful.
Thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic