How to Become an Expert
For most skills you need to learn, there are four steps that will help you become an expert. Most often you will go through these steps in sequence, yet with iterations up and down the steps on the way too. Here they are:
1.Learn it
2.Do it
3.Discuss it
4.Teach it
Learn it
Before you can master a skill you must learn it in theory. You can do this via books, tutorials, via education, or by messing around with it.
Do it
Once you have learned the skill in theory, you need to apply the skill in reality. By applying your skill in reality, you learn where the theory you learned is right, and where it is wrong. Yes, often universities will teach you theory that doesn't work in reality, or that doesn't apply in your situation.
Discuss it
Once you have used your skill for a longer period, and find that you were able to solve pretty much any problem thrown at you, which required this skill, it is time to discuss the skill with other experienced people. Discuss what the best ways to apply the skill is, where the limits of the theory are, what could be added etc. In short, discuss how to push the skill even further (e.g. an API. How to make it better / different etc.).
Through discussion you will learn a lot from other people, even if you thought you new it all.
Teach it
Teaching your skill to others is a really great way to polish the last corners of your skill. There may be many things to just do, without thinking about why you do them like that. Having to explain your ways and methods forces you to think about why you do what you do.
Additionally, there may be corners of your skill that you have never needed to master (say, corners of the web service specification). Having to teach your skill will force you to also master these corners too, making you better than you were before.
How to Become an Expert Developer
Now that I've talked about becoming an expert in general, I'll talk a bit more about how to become an expert developer.
As a developer you will most likely be developing software for a specific industry (at least for a while), and using a specific platform. If not, if you are switching tools and industry constantly, like some web developers do, you will most likely never become a real expert. You will become a Jack-of-All-Trades, which is also useful in some situations. If you are not focused on platform and industry, and you want to become an expert, you need to focus.
I started my career in 1998 doing web applications, and I found myself constantly changing tools, meaning I didn't really become good a the tools. I was just fighting to learn new tools all the time. Then I decided to focus on an object oriented language, and a platform, and chose Java. .NET was not yet out then. Since 1999 I have worked with Java only.
On your path to expertize, you will have to chose a platform, and possibly an industry too. Industry is less important, but having business domain knowledge really strengthens your profile.
When learning a platform you will start out with the language. For instance, the Java language. After the language you need to learn the platform (all the API's and tools). In Java, the platform is divided in two: The standard edition and the enterprise edition.
Once you begin to master your platform, you should start learning platform independent skills, like design patterns, distributed system design, architecture, usability etc. As you get better, you will spend more and more time learning these skills. This is a good thing. These skills are more easily transferable to a new technology platform.
Finally, you may move away from software development all together, moving into different business areas like project management, an architect job etc. Just remember, that once you stop using your developer skills, you will slowly stop being an expert.
Here is a diagram of your "path to expert developer". You start at the bottom, and move up the layers. The blue layers are platform independent layers. The other colored layers are platform specific layers. Even if your platform isn't on here, you would probably be able to fill it in yourself.