What Anselm says is correct, Sajee... The client has to specify the parameters in the browser, whether in the form or in the browser's address field... After that, servlets can fetch them by using getParameter method...
But for getAtribute method, they have to be set by the server-side components with setAttribute(
String, Object)and later can be fetched by using getAttribute(String)...
Hope this helps you understand the concpet. For more understanding, you need to do hand-on practices as well...

Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0