What is the JSP file format?
.jsp is a server-side file used for generating dynamic web content. Originally introduced by Sun Microsystems in 1999 as JavaServer Pages, the format was renamed Jakarta Server Pages in 2019 when stewardship passed to the Eclipse Foundation under the Jakarta EE umbrella. Like PHP or ASP files, a .jsp file embeds executable code within HTML markup - but the embedded language is Java. The file stores program logic on the server, which processes it and sends the finished HTML page to the browser.
.jsp source files are plain text. Java code is embedded via scriptlet tags (<% ... %>), expression tags (<%= ... %>), or the JSP Expression Language (${...}). Modern projects often use JSTL to keep business logic out of the template. If the page is written as well-formed XML, the .jspx extension is used instead.
Client-side considerations. The user does not need to know which technology a given website uses. The browser receives only the HTML output generated by the server - the .jsp layer is completely hidden from visitors. No Java Virtual Machine or special tools are needed to open a .jsp source file; a standard text editor is enough.
Security & safety
RISK: LOWThe .jsp extension says nothing about safety on its own - in a URL it's just a normal web page; treat the site as any website (watch for phishing on login/banking pages). A downloaded .jsp is typically harmless HTML or a misnamed document, and opening it in a text editor is always safe. Caution only if an unexpected .jsp download arrives from an untrusted source - inspect it as text before renaming, and never run anything it tries to launch. (For server operators, malicious uploaded .jsp 'web shells' are a server-side concern, not a risk to someone merely viewing the file.)
Format details
in a nutshellPrograms that open JSP files
Technical details
deep spec| File type | Server-side Java web template; plain-text source mixing HTML markup with Java scriptlets, directives, and EL expressions |
| MIME type | text/html |
| Text encoding | Plain UTF-8 (charset declared in the `<%@ page %>` directive; other encodings such as ISO-8859-1 are supported) |
| Binary signature | None - `.jsp` files carry no magic bytes; source commonly opens with `<%@ page ... %>` or a DOCTYPE/HTML declaration |
| Scriptlet syntax | `<% ... %>` for code blocks, `<%= ... %>` for output expressions, `<%! ... %>` for field and method declarations |
| Expression Language | `${...}` for immediate evaluation; `#{...}` for deferred evaluation - both access beans and scoped variables without embedding raw Java |
| Server requirement | Requires a Jakarta EE-compatible servlet container (Apache Tomcat, Eclipse Jetty, WildFly, etc.); cannot be served by a plain HTTP server |
| Compilation model | Container auto-translates `.jsp` to a Java servlet source file, compiles it to `.class` bytecode, then caches and reuses the compiled class |
| XML-based variant | `.jspx` (JSP Document) - strictly well-formed XML dialect; tag libraries referenced via XML namespaces instead of `<%@ taglib %>` |
| Tag library support | JSTL (Jakarta Standard Tag Library) and custom tag libraries described by `.tld` descriptor files reduce reliance on scriptlets |
| Deployment packaging | Bundled inside a `.war` (Web Application Archive) alongside servlets, classes, and static resources for deployment to a servlet container |
| Implicit scope objects | Four built-in scopes - page, request, session, and application - expose attributes accessible across the corresponding lifetime |
| Implicit variables | Nine predefined variables available without declaration: `request`, `response`, `out`, `session`, `application`, `config`, `pageContext`, `page`, `exception` |
| Stewardship history | Created by Sun Microsystems (JSP 1.0, 1999); became part of Java EE; transferred to Eclipse Foundation as Jakarta Server Pages under Jakarta EE in 2019 |
| Released | 1999 (JavaServer Pages 1.0); renamed Jakarta Server Pages under Jakarta EE (2019) |
| Open standard | Yes · royalty-free |
| Specification | jakarta.ee |
JSP conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about JSP files.