Browsed by
Category: Jetty

CXF Jetty Example

CXF Jetty Example

This is a simple example of how to combine CXF and Jetty to get a simple web services up and running. Pom for this example: [code language=”xml”] <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>datadidit.helpful.hints</groupId> <artifactId>parent</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> <artifactId>jetty-cxf</artifactId> <name>jetty-cxf</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxrs</artifactId> </dependency> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>javax.ws.rs-api</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>${jetty.version}</version> </plugin> </plugins> </build> </project> [/code]   Here is a simple REST endpoint: [code language=”Java”] package datadidit.helpful.hints.rest.cxf; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import…

Read More Read More

Hello Jersey and Jetty

Hello Jersey and Jetty

Seven Easy steps to get Jetty and Jersey working together When you need a servlet and don’t want to have to run your own web server like JBoss or Tomcat, Jetty is very handy. I like to use JAX-RS annotations and am very familiar with Jersey so I wanted to write a step by step tutorial for how to combine Jetty and Jersey. Instructions assume you know how to use Maven . 1. Use mvn archetype:generate to create your java…

Read More Read More