Solved

how to add back, print functions in a jsp page

Posted on 2006-06-20
2
200 Views
Last Modified: 2010-04-01
Hi, I am currently designing a jsp pages.  I need to add two buttons in my page. One is a back button which will help me back to previous page, and one is print page which will print the current page. How to do that, thanks.
0
Comment
Question by:ly_uwo
2 Comments
 
LVL 4

Accepted Solution

by:
pablomorales earned 180 total points
ID: 16945278
You need to use Javascript for that.

For printing:

<form>
<input type="button" value="Print this page" onClick="window.print()">
</form>

For the back button:

<script>
function goback() {
    history.go(-1);
}
</script>

<form>
<input type="button" value="Back" onClick="goback()">
</form>
0
 

Author Comment

by:ly_uwo
ID: 16946166
excellent, it helps a lot, thank you!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
stateless EJB with glassfish 2 73
sortaSum challenge java 17 173
org.apache.jasper.JasperException: using jstl in jsp embedded jetty 13 653
IE doesn't Invoke servlet in iframe 1 115
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question