19.09.2015 Views

Prentice.Hall.Introduction.to.Java.Programming,.Brief.Version.9th.(2014).[sharethefiles.com]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<br />

A JSP declaration is for declaring methods or fields in<strong>to</strong> the servlet.<br />

It has the following form:<br />

<br />

HTML <strong>com</strong>ments have the following form:<br />

<br />

<br />

If you don’t want the <strong>com</strong>ment <strong>to</strong> appear in the resultant HTML file, use<br />

the following <strong>com</strong>ment in JSP:<br />

<br />

Listing 43.1 creates a <strong>Java</strong>Server page that displays fac<strong>to</strong>rials for<br />

numbers from 0 <strong>to</strong> 10, as shown in Figure 43.5.<br />

Figure 43.5<br />

The JSP page displays fac<strong>to</strong>rials.<br />

Listing 43.1 Fac<strong>to</strong>rial.jsp<br />

<br />

<br />

<br />

<br />

<br />

<br />

Fac<strong>to</strong>rial<br />

<br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!