title: View Engine for Grizzly, Jersey, and Ozark MVC
body: <p>I'm trying to create an MVC app using Java EE MVC API implementation - Ozark. I'm using Grizzly as embedded web server. Of course, with Ozark is a JAX-RS implementaion - Jersey.</p>
  
  <p>This is my server class with run method being invoked by main method:</p>
  
  <pre><code>public class GrizzlyServer {    
      private static final Logger LOGGER = LoggerFactory.getLogger(GrizzlyServer.class);
      private static final String APP_NAME = "Hello World";
      private static URI baseUri;
      private static final String PROTOCOL = "http://";
      private static final String HOST = "localhost";
      private static final String PATH = "app/";
      private static final int DEFAULT_PORT = 8080;
  
      private GrizzlyServer() {
  
      }
  
      private static int port(String[] args) {
          if (args.length &gt; 0) {
              String port = args[0];          
              try {
                  return Integer.valueOf(port);
              } catch (NumberFormatException exception) {
                  LOGGER.error("Invalid port number {}", port);
                  LOGGER.error("Default port number {} will be used", DEFAULT_PORT);
              }
          }
  
          return DEFAULT_PORT;
      }
  
      public static HttpServer startServer(int port) {
          final ResourceConfig rc = new ApplicationResourceConfig();
          baseUri = UriBuilder.fromUri(PROTOCOL + HOST).port(port).path(PATH).build();
          HttpServer httpServer = GrizzlyHttpServerFactory.createHttpServer(baseUri, rc);
  
          return httpServer;
      }
  
  
      public static void run(String[] args) throws IOException {
          int port = port(args);
          try {
              final HttpServer server = startServer(port);
              LOGGER.info("{} started with WADL available at {}application.wadl", APP_NAME, baseUri);
              LOGGER.info("Hit Enter to stop it...");
              System.in.read();
              server.shutdown();
          } catch (IOException exception) {
              LOGGER.error("{}", exception.getMessage());
              LOGGER.error("Exit...");
              System.exit(1);
          }
      }
  }
  </code></pre>
  
  <p>This is my controller:</p>
  
  <pre><code>@Controller
  @Path("hello-world")
  public class HelloWorldController {
  
      @GET
      public String index() {
          return "/WEB-INF/index.jsp";
      }
  }
  </code></pre>
  
  <p>My app structure looks like this:</p>
  
  <pre><code>java
  resources
  web
  ..WEB-INF
    ..index.jsp
  </code></pre>
  
  <p>If I run my app and open my browser, <a href="http://localhost:8080/app/hello-world" rel="nofollow noreferrer">http://localhost:8080/app/hello-world</a>, it displays the return string od my method index instead the contents of <strong><em>index.jsp</em></strong>:</p>
  
  <pre><code>/WEB-INF/index.jsp
  </code></pre>
  
  <p>These are the relevant dependencies (Jersey version: 2.26):</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-container-servlet&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-container-grizzly2-http&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;!-- Dependency Injection --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.hk2&lt;/groupId&gt;
      &lt;artifactId&gt;hk2-api&lt;/artifactId&gt;
      &lt;version&gt;2.5.0-b50&lt;/version&gt;
      &lt;exclusions&gt;
          &lt;exclusion&gt;
              &lt;groupId&gt;javax.inject&lt;/groupId&gt;
              &lt;artifactId&gt;javax.inject&lt;/artifactId&gt;
          &lt;/exclusion&gt;
      &lt;/exclusions&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.jersey.inject&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-hk2&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;!-- MVC --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.ozark&lt;/groupId&gt;
      &lt;artifactId&gt;ozark&lt;/artifactId&gt;
      &lt;version&gt;1.0.0-m02&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Any help will be highly appreciated. Thanks...</p>