File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes JSP page partial display Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JSP page partial display" Watch "JSP page partial display" New topic

JSP page partial display

Baba Bizlowsky
Ranch Hand

Joined: Dec 15, 2003
Posts: 39
Hi everybody.
I would like to create a JSP page which is not revealed to the user in it's whole the first time, but rather reveals itself partially after the user clicks a button.
Consider a block of text and a button [NEXT] below. The user clicks it and the next paragraph is shown and so on until the full text is displayed.
I solved the problem with constant refreshing and the Session attribute which counted how many times the [NEXT] button was clicked but I know that there must be a more simple and elegant solution.
Thanks for any kind of help.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

A much better solution would be to put the 'hidden' data in a div with a style of 'display:none' and then set it to 'display:block' upon clicking the button. Simple and elegant and requires no error-prone book-keeping on the server side.
I'm moving this to the HTML/Javascript forum since the best solutions for this will be client-side operations.

[Asking smart questions] [About Bear] [Books by Bear]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
As Bear said you can show and hide information with no problem
Quick example

I just typed out the code, but it should be error free....
That should give youa god starting point...
[ February 26, 2004: Message edited by: Eric Pascarello ]
Baba Bizlowsky
Ranch Hand

Joined: Dec 15, 2003
Posts: 39
Thanks for the answer, it works like a charm.
[ February 27, 2004: Message edited by: Baba Bizlowsky ]
I agree. Here's the link:
subject: JSP page partial display
It's not a secret anymore!