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
/* | |
* Copyright 2013-2017 John Yeary <jyeary@bluelotussoftware.com>. | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* * Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* * Redistributions in binary form must reproduce the above copyright notice, |
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 com.bluelotussoftware.io; | |
import java.io.ByteArrayInputStream; | |
import java.io.DataInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.UnsupportedEncodingException; | |
/** | |
* |
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 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; |
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
@PersistenceUnit(unitName="SamplePersistenceWebPU") | |
EntityManagerFactory emf; | |
public Customer[] getCustomers() { | |
EntityManager em = emf.createEntityManager(); | |
Query q = em.createQuery("SELECT c FROM Customer c"); | |
List list = q.getResultList(); | |
return list.toArray(new Customer[list.size()]); | |
} |
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 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; |
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 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; |
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' ?> | |
<!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"> |
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 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 |
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 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; |
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
//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)); | |
} |