Skip to content

Instantly share code, notes, and snippets.

View jyeary's full-sized avatar
🐝
in the hive mind

John Yeary jyeary

🐝
in the hive mind
View GitHub Profile
package com.bluelotussoftware;
import com.sun.faces.application.view.ViewScopeManager;
import java.util.Collections;
import java.util.Map;
import javax.faces.component.TransientStateHelper;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
package com.bluelotussoftware.example.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
package com.bluelotussoftware.example.filter;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:w="http://www.sun.com/webui/webuijsf">
<body>
<ui:composition template="/template-client.xhtml">
<ui:define name="title">
package com.bluelotussoftware.commons.io;
import java.io.File;
import java.util.Date;
import org.apache.commons.io.monitor.FileAlterationListener;
import org.apache.commons.io.monitor.FileAlterationObserver;
/**
*
* @author John Yeary
package com.bluelotussoftware.example.richfaces;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URLDecoder;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
//Substitute your target web application below.
ServletContext sc = request.getServletContext().getContext("/EnterpriseApplication1-war"); 
//An example of what you can see to prove a point
Map<String, ? extends ServletRegistration> map = sc.getServletRegistrations(); 
for (String key : map.keySet()) {    
sc.log("Registration " + map.get(key).getName());      
Map<String, String> params = sc.getServletRegistration(map.get(key).getName()).getInitParameters();    
for (String k : params.keySet()) {        
sc.log("\t" + k + " --> " + params.get(k));
}
@jyeary
jyeary / 0_reuse_code.js
Created August 6, 2017 23:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jyeary
jyeary / ViewMapSystemEventListener.java
Created July 22, 2017 03:02
Clears the view map if the current ID does not match the new view ID.
/*
* Copyright 2014 John Yeary <jyeary@bluelotussoftware.com>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jyeary
jyeary / ExtractorExample.java
Created July 21, 2017 22:08
An example of how to use the autolink-java framework.
package com.bluelotussoftware.autolink;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.EnumSet;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.nibor.autolink.LinkExtractor;