This file contains hidden or 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
<p:outputPanel layout="block" style="position: relative;"> | |
<div style="position: absolute; top: 0.5em; right: 0.5em; z-index: 10;"> | |
</div> | |
</p:outputPanel> | |
This file contains hidden or 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 javax.swing.text.MutableAttributeSet; | |
import javax.swing.text.html.HTML; | |
import javax.swing.text.html.HTMLEditorKit; | |
import javax.swing.text.html.parser.ParserDelegator; | |
final StringBuilder sb = new StringBuilder(); | |
HTMLEditorKit.ParserCallback parserCallback = new HTMLEditorKit.ParserCallback() { | |
public boolean readyForNewline; |
This file contains hidden or 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 javax.annotation.ManagedBean; | |
import javax.inject.Inject; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.QueryParam; | |
import javax.xml.bind.annotation.XmlRootElement; | |
/** | |
* JAX RS implementation of REST logfile service. |
This file contains hidden or 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
/** | |
* Example repository. | |
* @author Koert Zeilstra | |
*/ | |
public class HelloRepository { | |
/** | |
* @return Example greeting. | |
*/ | |
public String getGreeting(String name) { | |
return "Hello world " + name; |
This file contains hidden or 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"?> | |
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> | |
<display-name>test-service</display-name> | |
</web-app> |
This file contains hidden or 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
<beans xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> | |
</beans> |
This file contains hidden or 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 javax.ws.rs.ApplicationPath; | |
import javax.ws.rs.core.Application; | |
/** | |
* Application configuration. | |
* See https://stackoverflow.com/questions/23508159/jax-rs-glassfish-eclipse-a-simple-web-service-doesnt-work | |
* @author Koert Zeilstra | |
*/ | |
@ApplicationPath("/") | |
public class TestServiceApplication extends Application { | |
} |
This file contains hidden or 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 test; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import java.math.BigDecimal; | |
import javax.ejb.EJB; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; |
This file contains hidden or 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 enterprise.programmatic_login; | |
import java.io.*; | |
import java.net.*; | |
import javax.annotation.security.DeclareRoles; | |
import javax.servlet.*; | |
import javax.servlet.http.*; | |
/** | |
* Copied from https://docs.oracle.com/javaee/6/tutorial/doc/gjiie.html |
This file contains hidden or 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
/** | |
* Repository for authentication. | |
* @author Koert Zeilstra | |
*/ | |
@ApplicationScoped | |
public class AuthenticationRepository { | |
private Map<String, AuthenticationToken> tokenCache = new HashMap<>(); | |
public Optional<AuthenticationToken> authenticateUser(String userName, String password) { |
OlderNewer