I am new to adobe cq.Please help me how to create a form and submit it to a servlet.
It really depends on what you want to do..
CQ has a built in Form framework, read http://dev.day.com/docs/en/cq/current/developing/developing-forms.html
If you really need to build a custom form that posts to a servlet, read http://edivad.wordpress.com/2011/07/18/cq-sling-servlets-resourcetype/
(Use Annotations for your Servlet instead of JavaDoc SCR properties if on 5.5+)
Retrieving data ...