You can easily check if core java has a package or not by looking at the javadocs:
http://java.sun.com/javase/6/docs/api/
if you look in the package list in the top left, you will not find a javax.portlet package. So you need an external API. One I found using google is Apache pluto.
http://portals.apache.org/pluto/
> the error message is as follow after compilation:
>
> package javax.portlet doesnot exists.
>
> does JDK 1.6 have that package?
No,Portlets are defined under a specification JSR 168 you need portlet.jar
to extend a GenericPortlet class so that you code your portlet class.Therefore opt for a portlet container like Bea Weblogic portal,webspehere portal,Sun Java System Portal,Pluto,Liferay,jetspeed and so on....
However,by the end of June Sun has official declared it would finalize JSR 286(new Portlet Specfication) and promised it wud release implementation of it.
you may go to any Portal specific site above and download the portal dependecies those would definately include portlet.jar.
just as an example you can download liferay specific dependecies
http://sourceforge.net/project/downloading.php?groupname=lportal&filename=liferay-portal-dependencies-4.2.2.zip&use_mirror=nchc
this zip file incluse portlet.jar which is independent of Wat so ever portal container...
and hope you'd go through the below article to get insight information about portlets devolopment.
http://www.developer.com/java/web/article.php/3366111
http://developers.sun.com/portalserver/reference/techart/config-IDEs.html
http://www.theserverside.com/tt/articles/article.tss?l=ClusteringTomcat
Hope this might help :)
REGARDS,
RaHuL