embedded-jetty

How can i deliver jetty with many webapps via jnlp?

你离开我真会死。 提交于 2019-12-07 13:11:24
问题 i have a webapp (http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo/net/sf/maven/plugins/example-captaincasa-jnlp/0.1-SNAPSHOT/example-captaincasa-jnlp-0.1-SNAPSHOT.war/download) wich use jsf in a servlet container. This works fine with jetty-maven-plugin run-war target at my local pc. In the future i would like make more of this kind of weapps. Now i am looking for a way to deliver this webapps with jetty via jnlp. The end user should be have a zero installation but the webapps

Container-Agnostic Websocket throws NPE with Embedded Jetty

丶灬走出姿态 提交于 2019-12-07 12:44:30
I'm writing a container-agnostic Websocket server. My development environment uses IntelliJ IDEA with an embedded Jetty version 9.3.11.v20160721 (embed code below). My code, however, uses the Tomcat Websocket libraries, tomcat-websocket-api and tomcat-websocket , version 8.5.4 . I want to register the Websocket EndPoint with a ServletContextListener . Following some examples from the Tyrus project , as well as some answers on SO and in the Jetty mailing list by Joakim Erdfelt (@joakim-erdfelt), I wrote the following implementation and added it via a listener in web.xml . The code enters the

NameNotFoundException Jetty 9 JNDI lookup

我的梦境 提交于 2019-12-07 10:05:54
问题 I need to implement JNDI for Jetty 9.0.3 web server for H2 database using C3p0 connection pooling, I've placed both H2 and C3p0 jars in lib/ext of JETTY-HOME directory and I've created a jetty-env.xml file in my WEB-INF. WEB-INF/jetty-env.xml <?xml version="1.0"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <New id="DSTest" class="org.eclipse.jetty.plus.jndi.Resource

How to remove trailing slash from embedded Jetty URLs?

[亡魂溺海] 提交于 2019-12-07 09:57:58
问题 I use embedded Jetty 9.3.8.v20160314 from Scala (Scala is incidental here, this is a pure Jetty question), configured like this: val loginService = new RepoLoginService(usersRepository, signInsRepo) val server = new Server(8080) server.addBean(loginService) val security = new ConstraintSecurityHandler() server.setHandler(security) val constraint = new Constraint() constraint.setName("auth") constraint.setAuthenticate(true) constraint.setRoles(Array[String]("user", "admin")) val mapping = new

Jetty embedded and JSP compilation to 1.7?

坚强是说给别人听的谎言 提交于 2019-12-07 07:32:06
问题 Could i specify somehow the target version of vm for jsp compilation? (I need 1.7, not 1.5 which is by default). I have a WebAppContext , some filters in code on it etc. The webapp itself is an exploded war.. so no xml configuration is used as it was not needed. But seems, xml configuration are strictly necessary in order to do this? How it shall look like (and wouldn't it conflict with the in-code definitions) ? ..or is there any way to do the trick through the code? Thanks. 回答1: http://www

What's the difference between a ServletHandler and a ServletContextHandler in Jetty?

末鹿安然 提交于 2019-12-07 02:21:46
问题 I'm trying to get started with an embedded Jetty server. I just want to map requests to different servlets based on the request path. What's the difference between creating a ServletHandler and adding servlets to it as opposed to creating a ServletContextHandler and adding servlets to that? For example: //how is this different... ServletHandler handler = new ServletHandler(); handler.addServletWithMapping(MyServlet.class, "/path"); //from this? ServletContextHandler contextHandler = new

Embedded Jetty rewrites not working properly

回眸只為那壹抹淺笑 提交于 2019-12-06 20:23:35
问题 I am trying to implement a simple rewrite rule in an embedded Jetty server, following the Jetty documentation examples. I want requests to /admin/ to rewrite to /admin.html. At the moment if I request /admin/ I get a 404 error with /admin.html not found. But if I request /admin.html directly, it works! There are 2 other similar posts on stackoverflow but no answers to the question! Here's the code: WebAppContext _ctx = new WebAppContext(); _ctx.setContextPath("/"); _ctx.setDefaultsDescriptor

Read JSON message from HTTP POST request in Java

为君一笑 提交于 2019-12-06 14:56:45
I am new to Java and to client- server programming. I am using embedded Jetty, and I'm trying to send a JSON string to some address ( http://localhost:7070/json ) and then to display the JSON string in that address. I tried the following code but all I get is null. Embedded Jetty code: public static void main(String[] args) throws Exception { Server server = new Server(7070); ServletContextHandler handler = new ServletContextHandler(server, "/json"); handler.addServlet(ExampleServlet.class, "/"); server.start(); } Client side function for sending the Http POST: public static void sendHttp(){

Apache Shiro with Embedded-Jetty or Spark-Java - Is it possible?

痞子三分冷 提交于 2019-12-06 14:47:57
Does anyone have an example project on how I could integrate Shiro with Spark-Java/Jetty(embedded) please? I can see from http://sparkjava.com/documentation#filters that it must be the way. But not sure what would be the smartest way to do this according to https://shiro.apache.org/web.html If you may have any examples, appreciate much! 来源: https://stackoverflow.com/questions/54835994/apache-shiro-with-embedded-jetty-or-spark-java-is-it-possible

Minimum set of files needed from Jetty to serve static content?

自闭症网瘾萝莉.ら 提交于 2019-12-06 11:57:28
Background Disclaimer: I have very little experience with Java. We previously used a wrapped version of Jetty 6 for on-demand static content (JS, CSS, images, HTML) during our Ant build so we can run unit tests with PhantomJS against an HTTP-hosted environment. However, Jetty is now on version 8.1.3 and we no longer need that wrapping (which solves a different problem which is now moot), so I wanted to update to just using Jetty 8.1.3 directly. First I downloaded the whole Jetty distribution, which weighs in at a massive ~40 MB. This works from Ant, using "start.jar"... but I don't really want