jetty

Embedded Jetty serving static content with form authentication

Dear all, I try to use the Forms-Based authentication within an embedded Jetty 6.1.7 project. That's why I need to serve servlets and html (login.html) under the same context to make authentication work. I don't want to secure the hole application since different context should need different roles. The jetty javadoc states that a Con...

How to make embedded servlet engine instantiate servlets eagerly?

The problem is simple, but I'm struggling a bit already. Server server = new Server(8080); Context context = new Context(server, "/", Context.NO_SESSIONS); context.addServlet(MainPageView.class, "/"); context.addServlet(UserView.class, "/signup"); server.start(); That's a pretty standard piece of code that you can find anywhere in J...

How do you get an embedded Jetty webserver to dump its interim Java code for JSPs

I keep running into this problem when debugging JSP pages in OpenNMS. The Jetty wiki talks about keepGenerated (http://docs.codehaus.org/display/JETTY/KeepGenerated) in webdefault.xml but it seems unclear how this works in embedded setups. ...

Why do I get "java.net.BindException: Only one usage of each socket address" if netstat says something else?

I start up my application which uses a Jetty server, using port 9000. I then shut down my application with Ctrl-C I check with "netstat -a" and see that the port 9000 is no longer being used. I restart my application and get: [ERROR,9/19 15:31:08] java.net.BindException: Only one usage of each socket address (protocol/network address...

Best way of restarting a jetty instance

I'm using start.jar and stop.jar to stop and start my jetty instance. I restart by calling stop.jar, then start.jar. The problem is, if I don't sleep long enough between stop.jar and start.jar I start getting these random ClassNotFoundExceptions and the application doesn't work correctly. Sleeping for a longer period of time between sto...

Disabling client cache from Jetty server for REST requests

I have a REST Java server implemented with Jersey running on Jetty. It seems that certain browsers (IE7) internally caches all requests made to the server. What I would like to do is to send a certain HTTP header in the response from the REST server indicating the browser that it shouldn't cache that response, and so will query the ser...

How to make Jetty dynamically load "static" pages.

I am building Java web applications, and I hate the traditional "code-compile-deploy-test" cycle. I want to type in one tiny change, then see the result INSTANTLY, without having to compile and deploy. Fortunately, Jetty is great for this. It is a pure-java web server. It comes with a really nice maven plugin which lets you launch Jetty...

How should I configure Jetty 7 pre3 to use oracle JDBC source?

All stuff is running under Windows XP Pro SP2/32-bit. I have downloaded Jetty 7 pre3 from http://dist.codehaus.org/jetty/jetty-7.0.0-prereleases/jetty-7.0.0pre3/jetty-assembly-7.0.0pre3.zip>dist.codehaus.org. I have extracted jetty to C:\jetty-7.0.0pre3\ (so I have C:\jetty-7.0.0pre3\bin\ and other dirs) I have put my webapp into C:\jet...

Configure webserver:80 to direct a domain name request to a different running webserver:8080 on same machine, different port?

I run Jetty6 yet gladly place Apache in the front if needs be. I would like to have two webserver instances running on the same machine on different ports. I would like the instance on port 80 to redirect the second public domain name to the second webserver on port 8080. This should not be visible to web users. Thank you. ...

How to configure nginx to work with Jetty6 webserver?

It seems that nginx is used with php, ruby and python. Anyone has an example of how to setup nginx to work with jetty/tomcat in backend? Thanks. ...

jetty - reload tag file in jar

Hi, I have my main web project and a common project which houses my tag files. Currently I use jetty in exploded structure and I jar up my common project with my tag files and place into web-inf/lib. When I make a change to my tag file, I can rejar and place into web-inf/lib again, though jetty is failing. javax.servlet.ServletExcepti...

Tomcat VS Jetty

I'm wondering about the downsides of each servers in respect to a production environement. Did anyone have big problems with one of the features? Performance, etc. I also quicky took a look at the new Glassfish, does it match up the simple servlet containers (it seems to have a good management interface at least)? ...

Remapping urls with jetty

My application's context root is /foobar and I am running an exploded deployment with maven-jetty-plugin. I need to dynamically remap requets for /images/* to /foobar/images/*, and I cannot remap my application's context root to /. For weblogic I have a halfwit solution where I deploy an additional war containing a proxy to context roo...

How to configure JNDI for Jetty 7.0pre5

Hi I am getting this error when starting up Jetty that uses Mysql Connection Pool. Could someone help me out please? [root@localhost test]# java -DOPTIONS=plus,ext.default -classpath %CLASSPATH% -jar /usr/src/jetty7/start.jar myjetty.xml 2008-12-20 18:24:08.138::INFO: Logging to STDERR via org.mortbay.log.StdErrLog 2008-12-20 18:24:0...

Advantage of using NIO vs BIO in jetty ?

Any experience on the tradeoffs in terms of nio vs bio when having heap and computationally intensive process executed for every query with execution times in (100ms-900ms) range ? ...

Maven Embedded Jetty Container fails to load Taglibs: Unable to initialize TldLocationsCache

Hi all, I'm using the Maven Cargo Plugin to startup a Jetty web container for running some integration tests in a separate project module. The problem i'm battling with occurs when i added taglibs into the jsp pages and tried hitting them from the integration tests. When jetty tries to compile the pages it fails with this error: org....

How to use a ThrottlingFilter for Jetty in Restlet

I would like to configure a webservice so that once the accept queue is full the service returns 503. Currently, these requests seem to just time out. I did set paramters like maxThreads and acceptQueuesize (as described here: http://www.restlet.org/documentation/1.1/ext/com/noelios/restlet/ext/jetty/JettyServerHelper). But the servic...

EL in a JSP stopped evaluating

In a JSP page(index.jsp): ${requestContext.requestURL} is the URL just shows the expression itself. It used to be evaluated to something like "http://.../somerset/" I created the Maven project with maven-archetype-webapp archetype in Eclipse. The Jetty version is jetty-6.1.14. My web.xml is simple: <web-app> <display-name>Arche...

Jetty Response with no Charset

Hi, I'm using Jetty to test a webservice we have and I am trying to get it to respond with no charset under the content-type header. Does anyone know how to do this? I've tried intercepting the Response and setting the CharacterEncoding to null or "" but that gives Exceptions. I am using Jetty 6.1.6. ...

How to run jetty:run-exploded in maven but prevent from assembling war again?

We are using the maven jetty plug-in to run exploded wars. We have a script that copies certain configuration files to the directory which is used by maven to assemble the war (basically spring configuration + web.xml for stand-alone test environment). The problem is that it seems the webapp is being built again before jetty:run-explo...