users@grizzly.java.net

Re: getting started

From: Jonathan Gold <jgold.bg_at_gmail.com>
Date: Fri, 13 Nov 2009 12:57:14 -0800

Mark --

I asked essentially the same question a few days ago, and got a nice response,
which I have yet to implement. You might take a look at that thread (Subject
"Confusion around GrizzlyWebServer, GrizzlyAdapter, and serving static
resources") to see if the response there works for you. I'll be interested to
hear whether it does, too!
 
jon

On Fri, Nov 13, 2009 at 07:50:39AM -0800, Mark Volkmann wrote:
>
> I'm having a little trouble getting started. I want a server that serves up
> static content from the directory "docroot" AND supports a servlet. In the
> code below, if I don't register the servlet then static content works fine.
> http://localhost:8080/ will bring up index.html from the docroot directory.
> However, if I register the servlet, that no longer works. The servlet does
> though. http://localhost:8080/mine will display output from the servlet.
> What am I doing wrong?
>
> Also, it says that addGrizzlyAdapter is deprecated, but I can't figure out
> what to replace that with.
>
> package com.ociweb.grizzly;
>
> import com.sun.grizzly.http.embed.GrizzlyWebServer;
> import com.sun.grizzly.http.servlet.ServletAdapter;
> import java.io.IOException;
>
> public class Main {
>
> public static void main(String[] args) {
> GrizzlyWebServer ws = new GrizzlyWebServer("docroot");
> try {
> ServletAdapter sa = new ServletAdapter();
> sa.setServletInstance(new MyServlet());
> sa.setContextPath("/mine");
> ws.addGrizzlyAdapter(sa);
> ws.start();
> } catch (IOException e){
> System.err.println(e);
> }
> }
> }
> --
> View this message in context: http://old.nabble.com/getting-started-tp26338722p26338722.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net