Importance of named windows and how to close all child windows

One of the questions posed by a friend of mine is this. In a typical website-application, you spawn a few child windows here and there and because of the nature of the application, you do not have a handle to all the child windows you spawn open... Then how do you close all the child windows that belong to your application when the user logs out of your application or closes the main window with the intent that he/she wants to log out?

Understanding Tomcat Configuration

Case #1: When the Tomcat config is this: [sourcecode language=“jscript”] [/sourcecode] Observe the “path” element in the “Context”. Then… http://localhost/index.jsp yields to the “index.jsp” under HelloWorld folder. http://localhost/HelloWorld/index.jsp yields to a “404 Page”. Case #2: When the Tomcat setup is this: [sourcecode language=“jscript”] [/sourcecode] Once again observe the “path” element in the “Context”. Then… http://localhost/index.jsp yields to a “blank page”. http://localhost/HelloWorld/index.jsp yields to a “blank page”. http://localhost/hw/index.jsp yields to the “index.

Extract all images in PDF file in a directory (batch extract images)

Sometimes you need a way to extract all images in a PDF but then you have a directory of files and you need to extract them iteratively. Prerequisites: Install Cygwin or linux environment with Perl support. Install ImageMagick. Install GhostScript. Afterward run the following script: [sourcecode language=“jscript”] #!/bin/perl my $directory = $ARGV[0]; opendir (DIR, $directory) or die $!; while (my $file = readdir(DIR)) { if ($file =~ m/.pdf/) { my $newfile = $file; $newfile =~ s/.

Add custom jars under "\WEB-INF\lib" in a Maven project

The answer is a lot simpler than you think. But before we explore the answer, I should warn you that this approach is not what is recommended by Maven. Maven builds upon consistency and structure and this process goes away from that methodology. In Maven, you can take each of your jars\libraries and add them to your local repository and then include them as needed in your projects. If you want to go the proper route here’s how you do it.

Weblogic 10.3 Heap Size (does not allow 3072mb)

Has anyone experienced a similar issue? In tuning Weblogic 10.3 R27.6.0-50 for Windows, we were trying various values for the heap size. Startup jRockit options: [sourcecode language=“jscript”] -Xms1024m -Xmx1024m [/sourcecode] We were setting both values to the same. 1024m = worked 2048m = worked 3072m = did not work 4096m = worked Did anyone experience a similar problem in allocating? Is there something special about 3072MB? Update from Sept. 28th, 2010: When we tried this additional property in the start-up parameter the 3GB option works: -XxcompressedRefs=0

Maven - GWT - Vaadin - including additional custom jars in a maven project under "\web-inf\lib"

With a lot of folks trying Google Web Toolkit (GWT) and\or Vaadin (combined with Maven), one of the problems that they might encounter is this: How do I get my custom Vaadin themes or GWT jar files included under my "\web-inf\lib" folder inside the war Here’s a link to the such a question in detail. The answer is a lot simpler than you think. But before we explore the answer, I should warn you that this approach is going away from what Maven would like you to do.

GWT and Spring Integration - java.net.InetAddress is a restricted class

When trying to integrate both Spring and GWT, one might encounter the following error in the Spring Eclipse IDE: “java.net.InetAddress is a restricted class”. The problem happens when you try to use Spring configuration for your database. In my case, I was using Spring to update data back to a H2 database. Well, here’s one way to deal with this issue. Disable the “Google App Engine”. Yes, based on my research, if you’re using GWT, you can disable Google App Engine and still continue your development with GWT.

JBoss AS6 - Failed to resolve schema nsURI= location=persistence

If you encounter the following error when deploying under JBoss AS6: “Failed to resolve schema nsURI= location=persistence” The chances are that you are missing the name-space for the persistence.xml file. So examine your persistence.xml file and replace the tag with the following: [sourcecode language=“jscript”] [/sourcecode] And this should help you get rid of the above error. cheers.

questions and thoughts about twitter

I’ve been using Twitter for sometime now. And I’ve always wondered about the settings in Twitter, especially one particular setting - “public vs private”. Let me first review the setting. If you set your privacy settings to “private”, then all posts after that time-line will only be available to the followers that you have allowed. And if at some point of time, you decide to toggle it to “public”, then all posts (even the ones you sent in the past - as private) becomes open to the public.

Weblogic 10.3 - Using clear passwords while in production mode

In Weblogic, (on your development server or workstation), you might want to run it in “production mode” but you don’t want to go through and encrypt all the database passwords in the JDBC files for your development database servers. Well, this article shows you how. Before you do this, make sure you are NOT doing this in a production environment. By doing this in a real-production environment, you may be compromising the security of your production infrastructure.

Notable difference between Apache Ant 1.7.x and 1.8.x - path and pathelement

On key notable difference I’m observing between Apache Ant 1.7.1 and 1.8.1 is with the path and pathelement. a build.xml file before =========================== If you had a path-id set in a target that may never get executed, Ant will make an attempt to find that path and use it. Whereas with 1.8.1, you will need to move those “Init” properties to the main level so that they will be properly found and used.

Words of Wisdom - Our paradox of our time in history

The paradox of our time in history is that we have taller buildings but shorter tempers, wider Freeways , but narrower viewpoints. We spend more, but have less, we buy more, but enjoy less. We have bigger houses and smaller families, more conveniences, but less time. We have more degrees but less sense, more knowledge, but less judgment, more experts, yet more problems, more medicine, but less wellness. We drink too much, smoke too much, spend too recklessly, laugh too little, drive too fast, get too angry, stay up too late, get up too tired, read too little, watch TV too much, and pray too seldom.

Android Phone Tamil Music

If you or someone owns an Android based phone such as Nexus One, HTC Droid, or HTC Incredible and would like to listen to some Tamil music streams. I’ve setup a server that streams live 24x7 latest tamil music. [After posting it I’ve had comments about some usability issues by using the default MP3 player in Nexus One. So I’m revising the steps.] Under Android Market Place, search for an application “A Online Radio”.

where is the javax.servlet jar in Weblogic 10.3 and up?

With the 10.3 release, Weblogic has split the javax.servlet and others out of weblogic.jar. I’m blogging it in hopes that if others are looking for it, this entry would help them. You can find javax.servlet and other jars under “<BEA_HOME>\modules" folder. In my specific build, I have the servlet jar file as “<BEA_HOME>\modules\javax.servlet_1.0.0.0_2-5.jar”. So if you are looking for it that’s where it is and no need to go and download the servlet.

GreaseMonkey to the rescue - fixing Apache Jackrabbit Site

Starting yesterday the Apache JackRabbit JCR website had an interesting problem. Someone must have made a change to the base template such that they had removed the SyntaxHighlighter code that needs to be appended to the header. I’ve opened an issue in their jira issue tracker. Contents of JIRA Issue »»»» It started happening today. When I visit the website, for example: http://jackrabbit.apache.org/node-type-notation.html All the artifacts that contain a “SCRIPT” of type syntaxhighlighter does not get displayed.

Spring Framework Samples and Reference Implementations online in svn

Sometimes it’s good to look at the svn repository for the reference sample that Spring Framework provides. Here’s a quick link for that URL: https://src.springframework.org/svn/spring-samples/ You can traverse through it via a HTTP(s) browser or you can download the latest samples via tools like TortiseSVN. Here is a list of some of the projects samples that are available today: spring-samples - Revision 431: / * configuration-basic/ * jpetstore/ * mvc-ajax/ * mvc-basic/ * petcare/ * petclinic/ * petclinic-groovy/ * spring-travel/ * task-basic/ * templates/ * tutorials/ Hopefully this article will be beneficial for someone who is trying to get familiar with Spring Framework.

Java 6 Gems: Spash Screen for your application

In my coverage of all the new features that are part of Java SE 6, there is a new gem added that makes the user experience very clean and concise when you bring up a web-start or applet or desktop based Java application. Namely, the splash screen. When you load up a native application, it’s very traditional to display a “splash screen” with the company logo and branding of the particular product.

Finding the balance for your open source skills with .NET

I have been a strong supporter of Open Source technologies including Java, Python, Scala, Ruby and Perl for many, many years. But in order to be a strong Enterprise Architect, it’s best to also understand the various other technologies (some proprietary) to gain a broader-balanced view of technology and whats out there. And in this ever changing world of technology - knowing the various options you have can make the difference between being nimble and creative to an implementation that bites the dust.

Java 6 Gems: Scripting Framework to support Rhino Javascript and Groovy (natively)

What is it? With Java 6 there is a new addition (package: javax.script) that allows you to work with scripting languages like Javascript (using Rhino) and Groovy. Although there is built in support for adding scripting engines like Groovy, PHP, Perl, etc - what’s bundled in this release is Mozilla’s Rhino Javascript Engine. Why embed a scripting language? Most scripting languages out there are dynamically typed. Meaning, your code does not need to know what type of value you will be storing in a particular field at compile time.

Speeding up your load time for your Java applets and webstart applications

Today we are going to look at a new feature available in Java 5 and above that can speed up your load time of your jar’s within your applets and web start (provided you have a web server that’s hosting the jar that’s HTTP/1.1 compatible server). Let’s first take a look at what happens on the back-end: In a typical applet (same applies to a web-start application), you have a src/source tag that points to a JAR file like this:

Commonly overlooked feature in Java 5 - varargs

Today I’ll comment on a commonly overlooked feature now available in Java (since Java 5.0) called “varargs”. How many times have you done this? [sourcecode language=“jscript”] public ConstructorOne(String personFullName){ // Does something } //and later on added another constructor that took another parameter public ConstructorOne(String personFirstName, String personLastName){ // Now breaks down the name to pass along two strings instead of one. } // and so on… [/sourcecode] Well, not anymore.

How to setup Brix-cms (with Apache Jackrabbit as a cluster) - Part 1 of 3

PS: This tutorial assumes that you are familiar with deploying applications (war files) in Tomcat, setting up datasource\connection pooling using Apache DBCP and in using H2 Database. Objective: Setup two instances of Brix-cms backed by a clustered Jackrabbit JCR on the back-end persisted onto a H2 database. Because there is so much to cover, I will cover the pieces in three installments. Installment #1: What and why of Brix-cms. Intro into why we care about Brix and JCR.