title: Eclipse/JBoss Deployment of a JSP
body: <p>Alright, I am going for the total shotgun question here. I tried to create a basic JSP on a JBoss 6.0 server with Eclipse SR2. I have a JSP file, a Web.XML and the Build.XML all below. Now bare in mind that Eclipse stores the WAR in C:\JBoss\jboss-6.0.0.Final\server\default\deploy\quote.war</p>
  
  <p>The problem is that the files are not appearing on the localhost. I'm trying to make sense of the problem.</p>
  
  <p>So here's quote.jsp:</p>
  
  <pre><code>&lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  &lt;%@ page import="java.util.ArrayList" %&gt;
  &lt;%@ page import="java.util.Arrays" %&gt;
  &lt;%@ page import="java.util.Random" %&gt;
  
  &lt;%
  //Word up.
  String[] quotes = {
  "Eat my shorts!", "Cowabunga dude!","Oh snap!","Psyche!",
  "Talk to the hand!","Different strokes for different folks.",
  "Dont go there.","Da Bomb!",
  "All that, and a bag of potato chips!"};
  
  ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;(Arrays.asList(quotes));
  Random r = new Random(); /*This creates a new random number generator.*/
  int x = r.nextInt(list.size()); /*nextInt finds the next integer of the randomized number, between 0 and the integer provided, in this case, nine possible phrases.*/
  String saying = (String)list.get(x); //Not sure why they felt they had to cast this as a string...
  pageContext.setAttribute("saying",saying); /*Apparently takes whatever string value to be used within the scope of the HTML?*/
  %&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Behold! And Despair!&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;br&gt;
  &lt;c:set var="sessionCount" scope="session"
  value="${sessionCount +1}" /&gt;
  &lt;c:set var="applicationCount" scope="application"
  value="${applicationCount +1}" /&gt;
  &lt;h1&gt;
  &lt;font color="#1230cb"&gt;Catchphrases You Wish Time Forgot&lt;/font&gt;
  &lt;/h1&gt;
  &lt;h3&gt;
  &lt;br&gt;
  &lt;font color="#a6a6a6"&gt;
  ${saying}
  &lt;br&gt;-your Childhood
  &lt;/font&gt;
  &lt;/h3&gt;
  &lt;br&gt;&lt;br&gt;
  You've visited this application ${sessionCount}
  times this session. Perhaps its time to get a life.
  &lt;br&gt;
  Also, this application has been visited ${applicationCount}
  by you and others who also have no social outlet.
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here's the web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
  http://java.sun.com/xml/j2ee/web-app_2_5.xsd"
  version="2.5"&gt;
  &lt;servlet&gt;
  &lt;servlet-name&gt;QuoteServlet&lt;/servlet-name&gt;
  &lt;jsp-file&gt;/quote.jsp&lt;/jsp-file&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
  &lt;servlet-name&gt;QuoteServlet&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/quote&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>And finally, the build.xml:</p>
  
  <pre><code>    &lt;project name="quote" basedir="../" default="deploy"&gt;
  
      &lt;!-- Project settings --&gt;
      &lt;property name="project.distname" value="quote"/&gt;
  
      &lt;!-- Local system paths --&gt;
      &lt;property file="${basedir}/ant/build.properties"/&gt;
      &lt;property name="webroot.dir" value="${basedir}\WebContent"/&gt;
      &lt;property name="webinf.dir" value="${webroot.dir}\WEB-INF"/&gt;
      &lt;property name="build.dir" value="build"/&gt;
  
      &lt;!-- classpath for JSF 1.1.01 --&gt;
      &lt;path id="compile.classpath"&gt;
          &lt;pathelement path ="${webinf.dir}/lib/commons-beanutils.jar"/&gt;
          &lt;pathelement path ="${webinf.dir}/lib/commons-collections.jar"/&gt;
          &lt;pathelement path ="${webinf.dir}/lib/commons-digester.jar"/&gt;
          &lt;pathelement path ="${webinf.dir}/lib/commons-logging.jar"/&gt;
          &lt;pathelement path ="${webinf.dir}/lib/jsf-api.jar"/&gt;
          &lt;pathelement path ="${webinf.dir}/lib/jsf-impl.jar"/&gt;
          &lt;pathelement path ="${webinf.dir}/lib/jstl.jar"/&gt;
          &lt;pathelement path ="${webinf.dir}/lib/standard.jar"/&gt;
          &lt;pathelement path ="${webinf.dir}/classes"/&gt;
          &lt;pathelement path ="${classpath.external}"/&gt;
          &lt;pathelement path ="${classpath}"/&gt;
      &lt;/path&gt;
  
      &lt;!-- define your folder for deployment --&gt;
      &lt;property name="deploy.dir" value="deploy"/&gt;
  
  
      &lt;!-- Check timestamp on files --&gt;
      &lt;target name="prepare"&gt;
          &lt;tstamp/&gt;
      &lt;/target&gt;
  
      &lt;!-- Copy any resource or configuration files --&gt;
      &lt;target name="resources"&gt;
          &lt;copy todir="${webinf.dir}/classes" includeEmptyDirs="no"&gt;
              &lt;fileset dir="JavaSource"&gt;
              &lt;patternset&gt;
                  &lt;include name="**/*.conf"/&gt;
                  &lt;include name="**/*.properties"/&gt;
                  &lt;include name="**/*.xml"/&gt;
              &lt;/patternset&gt;
              &lt;/fileset&gt;
          &lt;/copy&gt;
      &lt;/target&gt;
  
      &lt;!-- Normal build of application --&gt;
      &lt;target name="compile" depends="prepare,resources"&gt;
          &lt;javac srcdir="JavaSource" destdir="${webinf.dir}/classes"&gt;
              &lt;classpath refid="compile.classpath"/&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
  
      &lt;!-- Remove classes directory for clean build --&gt;
      &lt;target name="clean"
        description="Prepare for clean build"&gt;
        &lt;delete dir="${webinf.dir}/classes"/&gt;
        &lt;mkdir  dir="${webinf.dir}/classes"/&gt;
      &lt;/target&gt;
  
      &lt;!-- Build entire project --&gt;
      &lt;target name="build" depends="prepare,compile"/&gt;
      &lt;target name="rebuild" depends="clean,prepare,compile"/&gt;
  
      &lt;!-- Create binary distribution --&gt;
      &lt;target name="war" depends="build"&gt;
        &lt;mkdir dir="${build.dir}"/&gt;
        &lt;war
          basedir="${webroot.dir}"
          warfile="${build.dir}/${project.distname}.war"
          webxml="${webinf.dir}\web.xml"&gt;
          &lt;exclude name="WEB-INF/${build.dir}/**"/&gt;
          &lt;exclude name="WEB-INF/src/**"/&gt;
          &lt;exclude name="WEB-INF/web.xml"/&gt;
         &lt;/war&gt;
  
      &lt;/target&gt;
  
      &lt;target name="deploy" depends="war"&gt;
         &lt;delete file="${deploy.dir}/${project.distname}.war"/&gt;
         &lt;delete dir="${deploy.dir}/${project.distname}"/&gt;
         &lt;copy file="${build.dir}/${project.distname}.war" todir="${deploy.dir}"/&gt;
      &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Sorry for being a clutter bug here. But advice would be appreciated.</p>