Creating tabs in a jsp page
Hi All,
I am not very much familiar with jsp.My problem is.....
I am creating a jsp page in which i want 5 tabs, i know that it can be done using picture and corresponding jsp can be displayed on click event of the pictures. But I am not able to get through it.
Can anybody please help me some pease of code.
Thanx in advance.
[360 byte] By [
ymi_abhia] at [2007-11-27 2:44:20]

# 1
This is just basic HTML knowledge, no need of JSP knowledge in here. Usually such a tab with a picture looks like:<a href="tab1.jsp"><img src="tab1.gif" /></a>
Or do you want to use frames? If so, as the use of frames is discouraged, I don't give any hints on this.
# 2
Thanks Balus for having a look on my problem. But my actual problem is wtth layout, by using hyperlink the control is transfered to next page, while what i need is that the content of each tab should be displayed on the same page.Thanks
# 3
Then change the links by forms with an image as button and pass a hidden parameter along it indicating the filename of the tab. Retrieve this parameter in a jsp:include tag.
You can also use JS+DOM do display and hide block elements, but this requires that the content of all tabs have to be loaded at once, which isn't a good practice if the content of the tabs is relatively big.
# 5
Basically:<form>
<input type="image" src="tab1.gif" />
<input type="hidden" name="tab" value="tab1" />
</form>
<jsp:include page="<%= request.getParameter("tab") + ".jsp" %>">
# 7
Like I said, it is a basic example. You can build on it further. Yes, the request.getParameter("tab") might need a check if it is not null and if the supplied value is correct, etc. But this is not my task, you're the developer here :)