This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.jsj.test; | |
import javax.inject.Named; | |
@Named | |
public class HelloBao { | |
public String getHelloMessage(){ | |
return "Hello JSF/Spring"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.jsj.test; | |
import io.loli.jsj.test.MyQualifier.Count; | |
import javax.inject.Inject; | |
import javax.inject.Named; | |
@Named("antherHelloService") | |
@MyQualifier(countMethod=Count.DESC) | |
@SessionScoped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Father{ | |
default void eat() { | |
System.out.println("I am eating !"); | |
} | |
default void sleep() { | |
System.out.println("I am sleeping !"); | |
} | |
} | |
class Son implements Father{ | |
public void sleep(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.water.maxthon; | |
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import org.apache.http.HttpEntity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- This web.xml file is not required when using Servlet 3.0 container, | |
see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html --> | |
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" | |
version="3.0"> | |
<servlet> | |
<servlet-name>Jersey REST Service</servlet-name> | |
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.askloli.spring; | |
import org.glassfish.jersey.server.ResourceConfig; | |
import org.glassfish.jersey.server.spring.scope.RequestContextFilter; | |
public class MyApplication extends ResourceConfig { | |
public MyApplication () { | |
register(RequestContextFilter.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.askloli.test; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.TreeMap; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.MultivaluedMap; | |
import org.codehaus.jackson.map.ObjectMapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.glassfish.grizzly.http.server.HttpServer; | |
import org.glassfish.grizzly.http.server.NetworkListener; | |
import org.glassfish.grizzly.threadpool.ThreadPoolConfig; | |
import java.io.IOException; | |
public class MyHttpServer { | |
public static void main(String[] args) { | |
HttpServer httpServer = new HttpServer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.sc.api; | |
import java.io.IOException; | |
import java.util.concurrent.ExecutorService; | |
import org.glassfish.grizzly.http.server.HttpHandler; | |
import org.glassfish.grizzly.http.server.HttpServer; | |
import org.glassfish.grizzly.http.server.NetworkListener; | |
import org.glassfish.grizzly.http.server.Request; | |
import org.glassfish.grizzly.http.server.Response; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.loli.sc.api; | |
import java.io.IOException; | |
import java.util.concurrent.ExecutorService; | |
import org.glassfish.grizzly.http.server.HttpHandler; | |
import org.glassfish.grizzly.http.server.HttpServer; | |
import org.glassfish.grizzly.http.server.NetworkListener; | |
import org.glassfish.grizzly.http.server.Request; | |
import org.glassfish.grizzly.http.server.Response; |
OlderNewer