jetty

Metro + Jetty + OSGi = pain

烈酒焚心 提交于 2019-12-10 12:00:03
问题 I am trying to swap out Sun's HTTPServer for the much better Jetty server, within an OSGi bundle, running on Equinox. I have tried this: System.setProperty("com.sun.net.httpserver.HttpServerProvider","org.mortbay.jetty.j2se6.JettyHttpServerProvider"); but when endpoint.publish(url) is called, and the server is spawned, it complains of a ClassNotFoundException for org.mortbay.jetty.j2se6.JettyHttpServerProvider. However, the correct jars are in the bundle, and indeed in the Activator I can

Embed Jetty in Eclipse RCP

久未见 提交于 2019-12-10 11:49:23
问题 I am building a RCP application , where I need to monitor http traffic and show it to user. For that I require use of Embeded Jetty as transparent proxy. I tried everything , followed this Tutorial But things just don't work. I get build exception. I tried adding Jetty jar as external dependency , but still no use. Would appreciate any help. Also please let me know if there are any other ways of achieving this without use of jetty. (I tried Socks but it conflicts with RCP UI thread) Thank You

How to map a servlet filter on /* in Jetty?

吃可爱长大的小学妹 提交于 2019-12-10 11:47:47
问题 I have a servlet filter which I want to map to http://127.0.0.1:8888/ in Jetty. I have put a servlet filter mapping with url pattern /* . However, the filter is not called. I also tried with / mapping. It does not work either. How is this caused and how can I solve it? 回答1: If you name your war root.war it will be deployed to the root / context. http://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications 回答2: You can redirect requests from "/" to "/urlToRedirect" and handle "/urlToRedirect"

Using web.xml with WebAppContext in Jetty

谁说我不能喝 提交于 2019-12-10 11:43:28
问题 This is my first web application, I am just trying to follow guides and launch my server with servlets specified at web.xml , but it seems that my actions don't change functionality of the server and the result is 404 error. But if I programmatically specify servlets its OK. Could anyone figure it out how this all should work? Here is my code for server public class Launcher { public static void main(String[] args) throws Exception { Server server = new Server(8080); WebAppContext web = new

What are “Jetty 6 Continuations” and how do they compare to the continuations found in programming languages?

扶醉桌前 提交于 2019-12-10 11:26:04
问题 I'm looking for an answer that describes a "continuation" mechanism in a web server vs. a programming language. My understanding is that using continuations, it is trivial to have a "digits of pi" producer communicate with a "digits of pi" consumer, without explicit threading. I've heard very good things about Jetty continuations. I am curious what others think. I may have already found my answer, but I'm asking the question here anyway - for the record. 回答1: how do they compare to the

Auto-reloading WAR in Jetty standalone

℡╲_俬逩灬. 提交于 2019-12-10 10:57:31
问题 I have a WAR deployed to Jetty 9.0.0.M3. I am trying to figure out what I need to set in my context in order to be able to have it reloaded every time I upload an updated war file (without having to restart Jetty). I had a look at the docs, but I'm afraid I couldn't find what I was looking for. I only know how to do this with the embedded Jetty Maven plugin, but not with the standalone. Any help would be appreciated! Thanks. 回答1: The key is in the deployer. You need to wire up the deployment

Jetty Plugin 9 startup does not like icu4j-2.6.1.jar

*爱你&永不变心* 提交于 2019-12-10 10:31:13
问题 I have the same configuration for maven jetty plugin 6 from mortbay <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.26</version> </plugin> and for maven jetty plugin 9 from eclipse <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.3.11.v20160721</version> </plugin> The first one is working, the second is not, giving the following error: 2016-08-06 11:43:59.281:INFO:oejs.Server:main: jetty

Jetty SSL configuration Apache karaf

别来无恙 提交于 2019-12-10 10:30:27
问题 I am trying to configure the jetty to work with SSL in Apache Karaf OSGI container. http works, but https does not work. What could be the problem? My configuration details below: etc/jetty.xml <Call name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> <Set name="host"> <Property name="jetty.host" /> </Set> <Set name="port"> <Property name="jetty.port" default="8282" /> </Set> <Set name="maxIdleTime">300000</Set> <Set name="Acceptors">2</Set> <Set name=

redirect from http to https in Jetty

别来无恙 提交于 2019-12-10 10:02:49
问题 I want make permanent redirect from http:// myurl to https:// myurl, but in Jetty I find only MovedContextHandler, with it I can redirect only context path, for examnple from myurl/bla to myurl/bla/bla <Configure class="org.mortbay.jetty.handler.MovedContextHandler"> <Set name="contextPath">/bla</Set> <Set name="newContextURL">/bla/bla</Set> <Set name="permanent">true</Set> <Set name="discardPathInfo">false</Set> <Set name="discardQuery">false</Set> </Configure> but how can I work with prefix

Handle “multipart/related” in java servlet

左心房为你撑大大i 提交于 2019-12-10 09:40:25
问题 A Servlet, running under Jetty 8, receives the following request: Header: Content-Type = multipart/related; boundary=example Data: --example content-type: text/xml; charset=UTF-8 data1here --example content-type: text/xml; charset=UTF-8 data2here --example-- Is there a convenient way of getting "data1here" and "data2here" from this kind of a request? Do Java servlets support it, natively? Or are there any additional libraries that support it? 回答1: Consumes Annotation Consume the event using a