Skip to content

Instantly share code, notes, and snippets.

@rherrick
Last active September 10, 2015 15:37
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 rherrick/60f8599b068c5f2aea28 to your computer and use it in GitHub Desktop.
Save rherrick/60f8599b068c5f2aea28 to your computer and use it in GitHub Desktop.
index.jsp and web.xml for modern skin
#!/bin/bash
# If you're on Ubuntu/Debian or a different version of Tomcat, you'll need to change this path.
cd /usr/share/tomcat6/webapps/xnat/WEB-INF/lib
wget -O standard-1.1.2.jar http://search.maven.org/remotecontent?filepath=taglibs/standard/1.1.2/standard-1.1.2.jar
wget -O jstl-1.2.jar http://search.maven.org/remotecontent?filepath=javax/servlet/jstl/1.2/jstl-1.2.jar
<%@ page session="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head><title>Hi there</title></head>
<body>
<ul>
<li> User: ${sessionScope.user.username}</li>
<li> CRSF: ${sessionScope.XNAT_CSRF}</li>
</ul>
</body>
</html>
<!-- Remove the "<!DOCTYPE" element right in front of the web-app element then modify the web-app element itself to match: -->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<!-- Modify the welcome-file-list to add the index references -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>app</welcome-file>
</welcome-file-list>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment