JavaServer Pages, or JSP, create dynamic Web content. JSP Java scriptlets contain code that run loops and functions to fill the page with text, making each page interactive by responding to user requests. All Java elements, directives and actions belong in the body of the HTML document. Any link to an external CSS file belongs in the document's header. This linked CSS file defines the styles that the entire page uses. This applies a uniform design across your website, helping the dynamic content blend into the surrounding pages.
1. Access the JSP source file. If you have saved a copy of the site locally, open the source file from the site folder on your computer. If you edit the site using a direct FTP connection, access the file with your FTP client.
2. Scroll above the body's scriptlets to the document's header. This section of the code immediately follows the line: <HEAD>
3. Type the following line of code into the header: <LINK REL="stylesheet" HREF="sheet.css" TYPE="text/css">
4. Replace "sheet.css" with your style sheet's address. For example, if your sheet is called "MyStyles.css" and is in a folder called "docs" change the code to: <LINK REL="stylesheet" HREF="../docs/MyStyles.css" TYPE="text/css">
5. Save the file locally. Publish the updated page to your site using your FTP client.
- Comstock/Comstock/Getty Images