embedded-jetty

Authenticate a user using CAC (Common Access Card) in a web application running in Jetty for an application used by a US government agency

泄露秘密 提交于 2019-12-22 09:56:52
问题 I've been recently tasked with a similar task that this question describes. My task is to enable a web application to verify credentials via a CAC card. My web application is running on an embedded Jetty server running in an OSGi container. While the question is answered with good information, I noticed that one of the answers asks a good question back. The user that answered is @erikson and in a comment on his own answer he says "Are you using CACs issued by the US DOD? Is this application

Embedded Jetty : how to use a .war that is included in the .jar from which Jetty starts?

柔情痞子 提交于 2019-12-22 07:37:13
问题 I'm trying to generate a .jar containing a main() that would start Jetty. My problem is that I'd like the .war that Jetty loads to be included in the same .jar . I've been able to create the .jar containing the .war with : In the POM.xml : <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.3</version> <configuration> <finalName>myApp</finalName> <appendAssemblyId>false</appendAssemblyId> <archive> <manifest> <mainClass>com.myApp.Server</mainClass> </manifest> </archive>

404 Not Found Error in a simple Jetty/Maven Hello World webapp

点点圈 提交于 2019-12-22 04:09:37
问题 I have followed the instructions to create a "Standard WebApp with Jetty and Maven" precisely as described on the eclipse wiki: http://wiki.eclipse.org/Jetty/Tutorial/Jetty_and_Maven_HelloWorld#Developing_a_Standard_WebApp_with_Jetty_and_Maven However when I run the webapp (mvn jetty:run) and go to localhost:8080/hello-world/hello I end up at a "HTTP ERROR 404 Problem accessing /hello-world/hello. Reason: Not Found". I have read through documentation, looked at the wiki page's history, poked

No multipartconfig for servlet error from Jetty using scalatra

佐手、 提交于 2019-12-22 04:07:46
问题 I am trying to unit test an upload call but I get this error for the following code: @MultipartConfig(maxFileSize = 3145728) class WebServlet extends ScalatraServlet with FileUploadSupport { override def isSizeConstraintException(e: Exception) = e match { case se: ServletException if se.getMessage.contains("exceeds max filesize") || se.getMessage.startsWith("Request exceeds maxRequestSize") => true case _ => false } error { case e: SizeConstraintExceededException => RequestEntityTooLarge("too

Vaadin 10/11 and embedded Jetty

旧巷老猫 提交于 2019-12-21 20:10:05
问题 I developed middle-size application on Vaadin 8.5.1. Jetty embedded 9.4.8 was used as Servlet container for Vaadin servlet. In Java code i initialize Jetty instance, create Vaadin servlet and attach it to Jetty. In Maven i use 'vaadin-maven-plugin' which helps me make correct settings to folders, also packaging is 'jar'. The Spring (not Spring Boot) are used for application configuration purposes and IoC. Now i want to migrate project to Vaadin 10/11. I was tried all Vaadin Starter Packs

How do you set both port and thread pool using embedded jetty, v 9.1.0

情到浓时终转凉″ 提交于 2019-12-21 07:59:32
问题 I'm using jetty 9.1.0, embedded, and would like to set both port and ThreadPool. I see a constructor for each, but don't see how to use one of those, and then any way to set the other. doing this Server server = new Server(9090); or Server server = new Server(new QueuedThreadPool(100, 10)); but there's no setPort or setThreadPool on Server. 回答1: QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setMaxThreads(500); Server server = new Server(threadPool); ServerConnector http =

Add more than one resource directory to jetty

会有一股神秘感。 提交于 2019-12-21 07:45:59
问题 Looking to use multiple static directories with Jetty. When the server runs: http://localhost:8282/A http://localhost:8282/B http://localhost:8282/C A is placed in X/V/A B is placed in Q/Z/B C is placed in P/T/C The following failed: ResourceHandler resource_handler = new ResourceHandler(); resource_handler.setWelcomeFiles(new String[]{"index.html"}); resource_handler.setResourceBase(HTML_SITE); ResourceHandler resource_handler1 = new ResourceHandler(); resource_handler1.setWelcomeFiles(new

Add resources to Jetty programmatically

杀马特。学长 韩版系。学妹 提交于 2019-12-20 23:29:04
问题 I have a main class that configures and fires up Jetty. (That's standard practice from Wicket for testing a webapp, but it's really not wicket-specific.) final Server server = new Server(); //skipped socketconnector initialization final WebAppContext bb = new WebAppContext(); bb.setServer(server); bb.setContextPath("/"); bb.setWar("src/main/webapp"); server.addHandler(bb); server.start(); As you can see, src/main/webapp is used as webapp root. However, I have some resources that are in target

Eclipse RCP plugin + embedded Jetty + JSF

爷,独闯天下 提交于 2019-12-20 10:26:20
问题 I made an RCP plugin with embedded Jetty as following: 1) In plugin.xml -> Dependencies, I have added the following: org.eclipse.equinox.http.jetty org.eclipse.equinox.http.registry org.mortbay.jetty.server javax.servlet 2) In plugin.xml -> Extensions, I have added a Servlet extension point ( org.eclipse.equinox.http.registry.servlet ) class: TemperatureServlet alias:/temperature The TemperatureServlet looks like this: import java.io.IOException; import javax.servlet.ServletException; import

Jetty: To embed or not to embed?

不想你离开。 提交于 2019-12-20 08:24:23
问题 What are the benefits of embedding jetty vs deploying your webapp(s) in jetty? If you are planning on deploying more than one web app, should you strictly stick with deploying a war file for each web app (as opposed to writing an embedded server which calls each web app)? 回答1: i'd use jetty embedded when the goal is to create a standalone application in which jetty is just one of the components (for example in an osgi container). if you just want to deploy some war's then a default jetty