General Programming Practices for Web Applications.

I am a newbie to doing web based application and would like to get inputs from others on how handle various situations. 1. What is the best method to generate HTML( Presentation + Data.) 2. As there is no strucure concept in Java(unlike C/C++), how are large elements of data passed between functions. Arrays - You have to hardcode/Know the corresponding column for each array element. Objects - Lot of get/set methods needed. 3. Persistence layer. - Do we have a separate set of classes to handle DB interaction, or do we do all of those in servlets?

I would appreciate if anyone already done some of these give some inputs with respect to pros and cons of each approach. Thanks. -Hemanth