Where is GrizzlyWebServer ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Where is GrizzlyWebServer ?

Nicolas VEYSSIERE
Hello,

it is now a long time no see ! I was using GrizzlyWebServer in previous version of Grizzly, but I can’t find it anymore (v 2.3.14).

Is renamed or deleted ?


I was trying to achieve something like this :

GrizzlyWebServer grizzly = new GrizzlyWebServer();
ServletAdapter sa; 
String servletClassName = "com.vaadin.terminal.gwt.server.ApplicationServlet";
try {
    Servlet s = (Servlet)Class.forName(servletClassName).newInstance();
    sa = new ServletAdapter();
    sa.setServletInstance(s);
} catch (...) {
}
sa.setRootFolder("WebContent");
sa.addContextParameter("productionMode", "false");
sa.setContextPath("/MyApp");
sa.setProperty(ServletAdapter.LOAD_ON_STARTUP, "1");
sa.addInitParameter("application", "my.domain.MyApplication");
grizzly.addGrizzlyAdapter(sa, new String[]{"/MyApp","/VAADIN"});




Thanks for help...
Reply | Threaded
Open this post in threaded view
|

Re: Where is GrizzlyWebServer ?

oleksiys
Administrator
Hi Nicolas,


Is renamed or deleted ?
It's reworked :)

I was trying to achieve something like this :

GrizzlyWebServer grizzly = new GrizzlyWebServer();
ServletAdapter sa; 
String servletClassName = "com.vaadin.terminal.gwt.server.ApplicationServlet";
try {
    Servlet s = (Servlet)Class.forName(servletClassName).newInstance();
    sa = new ServletAdapter();
    sa.setServletInstance(s);
} catch (...) {
}
sa.setRootFolder("WebContent");
sa.addContextParameter("productionMode", "false");
sa.setContextPath("/MyApp");
sa.setProperty(ServletAdapter.LOAD_ON_STARTUP, "1");
sa.addInitParameter("application", "my.domain.MyApplication");
grizzly.addGrizzlyAdapter(sa, new String[]{"/MyApp","/VAADIN"});
You need to use Grizzly http-servlet module.
If you use maven, the artifact is:
    <groupId>org.glassfish.grizzly</groupId>
    <artifactId>grizzly-http-servlet</artifactId>

The app will look like:

HttpServer httpServer = HttpServer.createSimpleServer("WebContent");

WebappContext ctx = new WebappContext("Test", "/MyApp");
final ServletRegistration reg = ctx.addServlet("ServletName", servletClassName);
reg.addMapping("/servletPath");
reg.setLoadOnStartup(1);

ctx.setInitParameter("productionMode", "false");

ctx.deploy(httpServer);

httpServer.start();


I didn't test this code, but it should give you a hint what to look at.

Thanks.

WBR,
Alexey.

Reply | Threaded
Open this post in threaded view
|

Re: Re: Where is GrizzlyWebServer ?

Nicolas VEYSSIERE
In reply to this post by Nicolas VEYSSIERE
Thanks for your help !



(and sorry for bad mailing list usage, I first found the address before the registration process)