Posts

Showing posts from May, 2012

JBoss Application Server 7

View more presentations from Raymond Ploski

CASifying your web application

CAS used for Single Sign On Download required jar files for CAS integration. Configuration in web.xml  <!--CAS Integration-->     <filter>         <filter-name>CAS Authentication Filter</filter-name>         <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>         <init-param>             <param-name>casServerLoginUrl</param-name>             <param-value>https://li419-10.members.linode.com:8443/cas/login</param-value>         </init-param>         <init-param>             <param-name>serverName<...

IPCommerce Secure Hosted Payments for Invoicing Web Service Call

public static void main(String[] args) throws RemoteException,ServiceException {                         InvoicingServiceInfoServiceLocator lInfoServiceLocator = new InvoicingServiceInfoServiceLocator();                lInfoServiceLocator.setEndpointAddress("InvoicingServiceInfoService", "https://pay.cert.ipcommerce.com/LS/InvoicingServiceInfo/InvoicingServiceInfoService.svc");                        InvoicingServiceInfoServiceStub infoServiceStub = (InvoicingServiceInfoServiceStub) lInfoServiceLocator.getInvoicingServiceInfoService();                 AuthenticatedUser user = infoServiceStub.logon("username","password","SAK number");         InvoiceCodeRequest i...

Display Images From a Non-Project Directory in JSF

<h:graphicImage value="/headerimage/?img=logo.jpg"/> Create Servlet : @WebServlet(name = "DynamicImageServlet", urlPatterns = "/headerimage/*"}) public class DynamicImageServlet extends HttpServlet {     protected void processRequest(HttpServletRequest request, HttpServletResponse response)             throws ServletException, IOException {         response.setContentType("text/html;charset=UTF-8");                 try {             //Get image file             String img = request.getParameter("img");                        BufferedInputStream in = new BufferedInputStream(new Fil...

Send Email With Attachment in Java

public boolean sendEmailWithAttachment() {         // create some properties and get the default Session         Properties props = System.getProperties();         props.put("mail.smtp.host", "smtp host address");         props.put("mail.smtp.port", "25");         Session session = Session.getInstance(props, new MailAuthenticator());         try {             // create a message             MimeMessage msg = new MimeMessage(session);             msg.setFrom(new InternetAddress(from));             InternetAddress address = new InternetAddress(to);   ...