jetty

Configuring Jersey Test Framework with Security

醉酒当歌 提交于 2021-02-20 02:52:17
问题 I am writing a REST web service using Jersey, and I'm trying to write a set of unit tests to test the service using the Jersey Test Framework. However, I use HTTP Authentication and SecurityContext as part of my web service, and I'm having issues setting up JTF to allow me to test these aspects. I can send authentication information in the request, but how do I configure it to know about the different roles and users I wish to set up? I'm currently using Jetty (via JettyTestContainerFactory),

geoserver安装

匆匆过客 提交于 2021-02-19 10:43:40
由于GeoServer是基于Java开发的。因此在安装之前,必须确保安装了Java。官方文档说明里,如下: 确保自己已经安装JDK的情况下,访问官网: http://geoserver.org/ 选中对应版本后,可以选择bin版本或者war版本,此次选择bin版本,进入如下界面: 解压后进入目录: 配置环境变量,新增如下: 进入bin目录下,启动startup: 访问地址: http://localhost:8080/geoserver ,页面如下: 修改访问的端口号,修改start.ini里的jetty端口号,修改为8088,重新启动 默认安装后,用户名为“admin”,密码为“ geoserver ”,登陆后页面如下: 来源: oschina 链接: https://my.oschina.net/u/3781537/blog/4955524

Configuring a JNDI resource SQL in Jetty

安稳与你 提交于 2021-02-18 13:35:31
问题 I am having a lot of difficulty configuring a JNDI Resource in Jetty. I've gotten this to work in a Tomcat easily using context.xml and the Resource node. Attempts have been made to specify the resource in Jetty in both the jetty-env.xml and their version of a context.xml file but I end up getting the same exception. Here is the context.xml version of the resource definition: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse

Configuring a JNDI resource SQL in Jetty

可紊 提交于 2021-02-18 13:34:54
问题 I am having a lot of difficulty configuring a JNDI Resource in Jetty. I've gotten this to work in a Tomcat easily using context.xml and the Resource node. Attempts have been made to specify the resource in Jetty in both the jetty-env.xml and their version of a context.xml file but I end up getting the same exception. Here is the context.xml version of the resource definition: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse

Jetty - set system property [duplicate]

[亡魂溺海] 提交于 2021-02-17 14:47:05
问题 This question already has answers here : How to portably read configuration data from a servlet (4 answers) Closed 5 years ago . I run webapp on Jetty. The configuration for the app come from file that lives on the same server where Jetty is running. Inside the app I rely on the system property to obtain path to the file so I can parse it. E.g. final String loc = System.getProperty(FACTORY); Now I can start jetty with D switch to provide $FACTORY on the command line but I rather put it in

Geoserver跨域请求设置

孤街浪徒 提交于 2021-02-11 21:36:39
使用OpenLayers请求GeoServer发布的WFS服务时,如果不是相同的域可能会出现如下问题。 已拦截跨源请求:同源策略禁止读取位于 http://localhost:8080/geoserver/weng_test/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=weng_test: dw_country&maxFeatures=50&outputFormat=application%2Fjson 的远程资源。(原因:CORS 头缺少 'Access-Control-Allow-Origin')。 Geoserver 测试版本为 2.12.1。可有以下两种方案。 方案1 (1)下载跨域jar包jetty-servlets.jar 下载geoserver使用的对应jetty版本——可以查看<Geoserver>\lib下jetty-servlet.jar (如,Geoserver 2.12.1 版本下的为 jetty-servlet-9.2.13.v20150730.jar)的版本作为对照。 下载地址: http://central.maven.org/maven2/org/eclipse/jetty/jetty-servlets/ 并将jar包放到<Geoserver>\webapps\geoserver

How to setup embeded Jetty to use JDBC sessions

▼魔方 西西 提交于 2021-02-11 17:23:29
问题 I am using embedded jetty (group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.4.27.v20200227') and I am trying to programmatically setup it to use JDBC for session storage. All the documentation/examples I can find is about standalone jetty. Do you know how to setup it? 回答1: I don't know all that much about JDBC or session storage, but looking at the documentation Persistent Sessions: JDBC for standalone jetty, it is telling you to enable the module session-store-jdbc . By looking

How to setup embeded Jetty to use JDBC sessions

非 Y 不嫁゛ 提交于 2021-02-11 17:22:16
问题 I am using embedded jetty (group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.4.27.v20200227') and I am trying to programmatically setup it to use JDBC for session storage. All the documentation/examples I can find is about standalone jetty. Do you know how to setup it? 回答1: I don't know all that much about JDBC or session storage, but looking at the documentation Persistent Sessions: JDBC for standalone jetty, it is telling you to enable the module session-store-jdbc . By looking

How to retrieve client certificate from rest request in Java

为君一笑 提交于 2021-02-11 14:44:14
问题 I'm using Jersey for REST server in Java and Jetty as web server. I have self signed certificates. I want to fetch client certificate details from received HTTP Request. How to obtain the information from HttpServletRequest ? One method: X509Certificate certs[] = (X509Certificate[])httpRequest.getAttribute("javax.servlet.request.X509Certificate"); Is this right? This results in exception, Error [Ljava.lang.Object; cannot be cast to [Ljava.security.cert.X509Certificate Should I include any

How to collect and get connection pool statistics using jetty and spring boot?

时光总嘲笑我的痴心妄想 提交于 2021-02-11 14:39:46
问题 I'm developing simple Spring Boot web application with embedded Jetty server. I'd like to have some statistics on connection pool usage (i.e. how many threads, avg request time. avg queue wait time, queue size etc.) I realized that Spring Boot configures Jetty with QueuedThreadPool which has few basic metrics. Is there more sophisticated bean or module designated for statistics collecting in Spring Boot? How to enable it? 回答1: Have you had a look at Spring boot actuator? It provides you with