Here is an interesting concept which I came across just recently and considered it worth sharing. I was reading about inner classes concepts where in, there is a type of inner class called the local inner class. Local inner classes are those classes which reside within the function of a method belonging to an outer class. The code can be something shown like this.
public class LocalInnerClassTest {
public void defineInnerClass() {
class MyLocalInnerClass {
public void doSomething() {
}
}
}
}
Now lets suppose we want to pass a variable in the defineInnerClass() and pass it to the doSomething() for some computation, then according to the specifications on local inner classes methods we must declare the variables as final or else it will result in a compile time error. So the resulting code must be something as follows: Read the rest of this entry »
Many a times I have come across my friends who get this error and are clueless because this error is not something related to the programming logic neither to the server which shows this error either on accessing a servlet or a service. You have to know that this error comes when a class compiled on a newer version is being tried to run on an older JVM i.e. If you try to run a JDK 1.5 compiled class in an environment having JRE 1.4 the JRE will give you the error,
Unsupported major.minor version 49.0
This error is given because the new features introduced in the newer version of Java are not present in the older version. So you have to be careful for using such class files on older environments. For resolving this error you have to follow some simple tips as follows:
- Check you java version by running the command java - version
- Check your environment variable JAVA_HOME and the path associated with it
- Check your server installation if it was installed on an older version
- Check which path exists in the environment entries
These are the quick tips you would need to do in order to get rid of the error. Sometimes Read the rest of this entry »
This article is aimed at developers who are good at programming languages like Java and want a quick jump on the XSD bandwagon by understanding some important concepts like namespaces. Hope that this article helps to make you understand namespaces quite easily.
What is a namespace?
A namespace is an identifier for elements. XML and XSD use the concept of namespaces to define a relationship between the elements and their hierarchy. It means that when their are multiple elements to be defined then it might be possible that some of the elements may tend to have the same name. But having the same name often leads to collision just as the in the case of classes with same names although in different packages but referenced by name alone in a Java program. Hence the concept of namespaces is used in order to distinguish such elements.
Why are namespaces used?
XML and XSD are never meant for human reading. You have to remember that even though XML is a data representation markup language, it would be rare that you will actually be parsing through an XML file to use the data in your application through your own code.
Such parsing is often supplied through the use of API’s like SAX, DOM, JAXB, etc. You would have till now actually used these libraries while dealing with web services since it is field which uses XML, XSD to the maximum. The concept of namespace has no relevance until and unless an XML instance is associated with an XML Schema (XSD). This is because, XSD defines what do the elements in the XML instance actually mean. A standalone XML just makes the data easier to understand to you but to an XML parser it is nothing but a set of elements in some heirarchy.
For example if suppose you have the following XML format: Read the rest of this entry »
I did till today, and realized that many concepts are still unknown to me as well as some of my friends who have worked on Java EE for a long time now. I have learnt many frameworks along the course from the day I started my professional work in J2EE (now christened JEE). Java in its core form never came across me as I was eager to find out the challenges that I faced while working with JEE. It is sometimes interesting to see your much loved aspect, turning out on your face and looking like a complete stranger to you.
It was in the morning that my colleague asked me that he had taken an interview where he asked the question to the interviewee,
What is the difference between JVM and JRE?
Of course, it was Java Virtual Machine and Java Run Time Environment, I said without a second thought. But it doomed to me like never before, what next was their difference? Was it something that SUN had planned to demystify my confidence in the world of Java. Reluctantly, yet diplomatically I said to him that I knew the difference but I would like his point of opinion. He said something which I half heartedly believed, putting on a note in my mind the quest for the day to find the interesting answer to this seemingly easy but notorious question. The answer he relented was, Read the rest of this entry »
Will they take a J2EE professional or a JEE professional now is the thing I am worrying about. It is obvious for a technical person to know that J2EE and JEE are one and the same except for the HR persons! How do we go about convincing them? Many people including me, still are confused about the version and the mysterious number attached to the “Java” word. Let’s try to explore what actually goes on behind these mysteries. Check this out!
The product confusion
If you are still thinking that Java 2 meant version 2 of Java then you are being duped. Java 2 means version 1.4 of Java. I am still dumbfounded as to where Java 3 and Java 4 disappeared but I guess with the success of Java 5 they were buried in debris even before they born!
I was still in bewilderment until the web started to roar about Java 6. It took me a lot of time to actually sink in the fact whether Java 5 referred to version 1.5 of Java and Java 6 referred to version 1.6 of Java. This confusion was due to the use of Java 5.0 in some places. Are Java 5.0 and version 1.5 of Java one and the same?
The fact is that Sun makes use of dual naming convention for the same thing. One naming convention if for the product and one is for the developer. The official documents mentions Read the rest of this entry »
After my completion of SCDJWS I had written about the 3 steps to success in SCDJWS which has helped many who were new in the web services domain to help them get prepared and confident about preparing for the big exam! Following the same foot steps I am now presenting in front of you 3 steps to success in SCWCD. I scored a 90+ in the exam and so I take a a pride to provide you the guidance of how to get a 90+
Why are there always 3 Steps to success?
This probably would be the same doubt on the lines of why do we say “Ready…Steady…Go” and also the countdown of a start of a timer in “3..2..1“. Well, the 3 steps are same everywhere, only their definition changes. Similarly I always make it a point to divide my preparation routine into particularly 3 steps to make it sound quicker and much systematic. Finally, its the enthusiasm that counts that you put in each of the steps.
Stop all that blabber… How do I go about preparing for SCWCD?
Okay..okay. SCWCD (exam code - CX 310 081) is aimed particularly for the web developers and it takes into consideration that you must have developed web applications in the past and now want to try out with JSP/ Servlets. So there wont be any questions about how and what are the intricacies dealing with what a web application is, but concentrates on how would you build web applications using the web components that SUN provides.
SCWCD - The preparation
The 3 steps for success in SCWCD are: Read the rest of this entry »
Struts is a J2EE web application framework created and maintained by Apache Software Foundation Group (ASF). It is a controller framework based on the Front Controller pattern and used to create an MVC (Model View Controller) architecture.
What is a Front Controller Pattern?
A Front controller pattern follows the rule of having a single entity controlling the entire application. The single entity acts as a barrier between the client and the remote application. All requests targeted towards the application and first received by the single entity and then based on the controlling flow of the application, the requests are forwarded to the intended recipient module of the application.
The advantage of the Front Controller Pattern is in the simplicity of maintaining a single entity instead of multiple flows controlled by multiple entities. This results in streamlining the flow and proper filtering of the requests made to the application.
Why is Struts Framework essential in an MVC architecture? Read the rest of this entry »