First thing is to create your portlet.xml file. Make an entry for each new portlet. Be sure to use an example portlet.xml file as a template, it is a little more complex than web.xml (you will also need a web.xml file, but it doesn't need to contain any information about your portlets). You will need to change every occurance of "Servlet" to "Portlet" in your source code. Like getServletContext() -> getPortletContext(). The method calls are almost exactly the same with the same result, so you should have little trouble here.
The PortletSession object is the only thing that I can think of that differs slightly from it's servlet counter part. The setAttribute method has an extra parameter for setting the scope. Check the jetspeed javadocs for more info on that.
If you have written your servlet to follow the concept that a http get request handles display and a post request handles an action, you should be able to rename doGet to doView and change the parameters from ServletRequest and Response to RenderRequest and Response. Then change doPost to processAction with ActionRequest and Response as the parameters.
Some problems you might have: You cannot set the content type of a response in a portlet. That is ulitmately set by the portal. You will not have a PortletOuputStream to replace the ServletOutputStream. If you were using http get to submit forms, that will probably not work. I believe that a form needs to use the post method in order for the portal to actually call your processAction method (that has been the case with some other portal systems I have used).
I'm sure I have forgotten something, but this should get you started.
- converting an existing web application into a portlet ChadDavis
- Re: converting an existing web application into a portl... Brice Lambi
- Re: converting an existing web application into a p... Patrick Huber
- Re: converting an existing web application into... ChadDavis
- Re: converting an existing web application ... Patrick Huber
