how to use request dipatcher and setAttribute?

He guys,

I need to pass parameter from servlet to a jsp page.

I have a login form which is an html page. It has an input field(username) and a password field.

When the submit button is clicked the username is passed in the url to the servlet. I'm using doGet().

I need to pass this parameter(username) to a jsp page.

I know it can be achieved through requestdispatcher, but how to do it?

Please help me with code sample.

[464 byte] By [alok1983a] at [2007-11-26 15:20:03]
# 1
In servlet..RquestDispatcher rd=req.getRequestDispatcher("url of your jsp")rd.forward(req,res);In jspU can get your values likereq.getParameter("ur parameter name");regardsshanu
mshanua at 2007-7-8 11:47:06 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
thanx
alok1983a at 2007-7-8 11:47:06 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...