Tip Bank

Date Settings Problem (Regional Settings)

Regional Settings, especially dates, are always a problem in code. For example, suppose your product is developed in the U.S. and deployed in the UK. DateTime.Parse would throw exceptions because String is not recognized as a valid DateTime). The quickest fix for this problem is to use the DateTimeFormatInfo object during

JSF Backing Bean Tips: Parameter Extractions and Redirects

These two quick JavaServer Faces (JSF) tips show how to extract request parameters and redirect page loads using a bean backing. Extract a Request Parameter in JSF When an application sends an HTTP GET request, it usually sends different kinds of parameters. Using a JSF backing bean, you can extract

Send Large Data Sets from WCF to Silverlight

The web.config alteration allows a WCF service to feed large blocks of data to Silverlight. If your initial testing of a Silverlight application worked but now you are failing on large production data, this tip may be for you. Full credit goes to Syed Mehroz Alam, who diagnosed the problem

Java Code to Filter File Names in a Directory

The following Java code does the following: Filters files for an array of extensions. Splits file names. Tests the resulting array package FileHandling;import java.io.File;import java.io.FilenameFilter;/** * filters files for an array of extensions critstr * splitting file name by splitstr * last element of resulting array being tested * @author

Managed Classes and Object Injection in Java EE 5

This table provides a quick reference for what types of managed classes can inject what object in Java EE 5.   Objects Managed Classes Stateful Stateless Message-driven Bean (MDB) Interceptors JDBC DataSource Yes Yes Yes Yes EJBContext Yes Yes Yes No Web Service Ref Yes Yes Yes Yes EntityManagerFactory Yes

Managing Concurrent Requests with EJB Containers

As you probably know, an important solution offered by EJB containers is the ability to manage concurrent requests and satisfy multiple clients while avoiding unpleasant issues. When the number of requests is too large and the available memory is insufficient, EJB containers try to use the hard disk to store

Using EJB Interceptors for Java EE Audits

Enterprise JavaBeans (EJB) 3.0 provided the ability to intercept EJB business methods by using AroundInvoke interceptors. Based on these interceptors, you can access the method name, its parameters, and its EJB context. You also can perform tasks such as security checks, logging, auditing or frequently changing the values of method

How to Read Environment Variables in SQL Server Using T-SQL

To read Environment variables in T-SQL, you can use the xp_cmdshell extended stored procedure in SQL Server. The following example shows how to read the %windir% environment variable, which gives the Windows directory path on SQL Server using xp_cmdshell: DECLARE @windir nvarchar(255)CREATE TABLE #Tmp(EnvVar nvarchar(255))INSERT INTO #Tmp exec xp_cmdshell ‘echo

Merge XML files into a PDF Document in .NET

Sometimes different PDF documents have some content in common. For example, a number of PDF documents may have the same header or footer. In such cases, .NET developers who are responsible for document creation might go through a lot of code duplication. To reduce this code duplication, it’s a good

No more posts to show