---
title: "How do I include static files within a JSP page?"  
description: "How do I include static files within a JSP page?"  
author: "Anonymous User"  
published: 2011-05-21  
updated: 2020-09-20  
canonical: https://www.mindstick.com/interview/998/how-do-i-include-static-files-within-a-jsp-page  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# How do I include static files within a JSP page?

Static resources should always be included using the JSP include directive. This way, the inclusion is performed just once during the translation phase. Do note that you should always supply a relative URL for the file attribute. Although you can also include static resources using the action, this is not advisable as the inclusion is then performed for each and every request.

## Answers

### Answer by Anonymous User

Static resources should always be included using the JSP include directive. This way, the inclusion is performed just once during the translation phase. Do note that you should always supply a relative URL for the file attribute. Although you can also include static resources using the action, this is not advisable as the inclusion is then performed for each and every request.


---

Original Source: https://www.mindstick.com/interview/998/how-do-i-include-static-files-within-a-jsp-page

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
