jetty

Possible to map subdomains to webapps in a standard Java app server?

送分小仙女□ 提交于 2019-12-24 11:54:35
问题 If you have two webapps, foo and bar, in a J2EE app server like Tomcat, the normal way to distinguish them is like this: domain.com/foo domain.com/bar I'd like to do this instead: foo.domain.com bar.domain.com Is this possible? 回答1: It's not something that can be done in a "standard" way - each Java app server has different ways of configuring itself. You will need to look at the documentation for which-ever server you want to deploy to. For Jetty, that documentation is here: http://wiki

Solr and Jetty deployment issue

隐身守侯 提交于 2019-12-24 11:47:59
问题 I am having trouble with getting solr + jetty to work. I am following all instructions to the letter from - http://wiki.apache.org/solr/SolrJetty. It works like a good. But when I restart jetty multiple times, after 3/4 such restarts it starts hanging. Admin pages just don't load and my app fails to acquire a connection with solr. I also created a work folder - /opt/solr/work . I am also setting tmpdir to a new path in /etc/default/jetty . I can confirm the tmpdir is set to the new path from

How to set JSP response locale in Jetty 7/8?

你说的曾经没有我的故事 提交于 2019-12-24 10:49:17
问题 If I set the HTTP response locale programmatically in a servlet as follows: @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setLocale(SOME_LOCALE); // .. etc } Then under Jetty 7 and later, any JSPs trying to read that locale via the expression ${pageContext.response.locale} will get the server's default locale instead of the one set above. If I use Jetty 6 or Tomcat, it works fine. Here's the full code

How do I prevent directory listing in Jetty?

对着背影说爱祢 提交于 2019-12-24 09:16:50
问题 Basically I have this jetty server running at my local. But I can't access my index.jsp file I see like that this is my web.xml file, You see I use Apache CXF, and also use Spring, Hibernate and Jetty <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <context-param> <param-name

Ignoring web.xml when loading a WAR file with Jetty

。_饼干妹妹 提交于 2019-12-24 08:30:37
问题 I'm trying a self-executable WAR package with Jetty. It configures with web.xml by default. If a run-time option is given, I wanted to override web.xml by Java code-level configuration with ServletContextHandler#addServlet, #addEventListener, and ... Can I ignore web.xml while loading a WAR package? % java -jar foobar.jar # Use web.xml % java -jar foobar.jar --customize=something # Use Java code to configure // Example WebAppContext webapp = new WebAppContext(); webapp.setWar(warLocation

How to authenticate websocket client in jetty?

别等时光非礼了梦想. 提交于 2019-12-24 08:15:37
问题 I am using embedded jetty on server side which will accept both http and websocket requests. I am using org.eclipse.jetty.security.authentication.FormAuthenticator for authenticating user. After user gets logged-in, my javascript code will open up a websocket connection with server. I want to know how server can authenticate this websocket client, to avoid accepting websocket connections from un-authorized clients(say, java client). 回答1: Assuming you have setup the embedded jetty properly, it

java.lang.NoSuchMethodError: javax.servlet.ServletContext.getJspConfigDescriptor using embedded jetty with jsp

拜拜、爱过 提交于 2019-12-24 07:46:08
问题 I'm trying to use jetty in embedded mode. I'm getting the following error on initialization: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getJspConfigDescriptor()Ljavax/servlet/descriptor/JspConfigDescriptor; at org.apache.jasper.servlet.TldScanner.scanJspConfig(TldScanner.java:148) Searched all the jars that ship with jetty 9.2.10.v20150310 but none but the class in question, javax.servlet.ServletContext, is not defined anywhere. Only interface in servlet-api-3.1.jar My startup

Error while replacing jetty plugin to gretty plugin gradle

梦想的初衷 提交于 2019-12-24 07:05:16
问题 I have a JAX-RS project which have jetty plugin in gradle. I want to replace jetty plugin with gretty as jetty is not supported in gradle 4 and other versions. I get following errors while running gretty plugin. Execution failed for task ':appRunWar'. java.lang.Exception: com/sun/jersey/spi/inject/InjectableProvider build.gradle code containing jetty plugin apply plugin: 'java' apply plugin: 'war' apply plugin: 'jetty' apply plugin: 'eclipse' jettyRun { httpPort = 8080 reload = 'automatic'

How to stop only one app?

牧云@^-^@ 提交于 2019-12-24 06:52:59
问题 Jetty is running 3 sites from webapps . On of which is a "static" angular site, another is a huge java app. Typically, I use Ctrl + c to stop Jetty, make changes on my angular site, and start Jetty with java -jar start.jar -DCommon.properties.path=C:\Jetty If I try to edit the files while Jetty is running, random, buggy code is injected, breaking the site. So this process is extremely tedious. The java app takes 15-20 seconds to load. So if I forget a slash, it takes about a min to shut it

Jetty and max content size

时光总嘲笑我的痴心妄想 提交于 2019-12-24 06:29:34
问题 I use Jetty 9.4.8 and i want limits the amount of data that can post to the server. For that i added to jetty.xml: <Call name="setAttribute"> <Arg>org.eclipse.jetty.server.Request.maxFormContentSize</Arg> <Arg>10000</Arg> </Call> I tested jetty like (request-xxlarge.xml - text file(20mb)): curl -X POST --data @request-xxlarge.xml http://localhost:8080/test -v As a result i got * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 8080 (#0) > POST /test HTTP/1.1 > Host: localhost