Skip to content

Instantly share code, notes, and snippets.

@ghusta
Created January 2, 2019 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghusta/c396174c8f6ffc136d5a6c04697c3337 to your computer and use it in GitHub Desktop.
Save ghusta/c396174c8f6ffc136d5a6c04697c3337 to your computer and use it in GitHub Desktop.
Change the HTTP response status for a JSP
<%@ page language="java" contentType="text/html; UTF-8; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%
response.setStatus(403);
%>
<!DOCTYPE html>
<html lang="en">
...
</html>
@ghusta
Copy link
Author

ghusta commented Jan 2, 2019

Quite simple. The response status will be 403 in the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment