You need to understand the HTTP paradigm first. You can set a request attribute in a servlet and then can use it in a JSP, but you cannot do it from JSP to Servlet, because the first request goes out of scope and the servlet will be receiving a new request.
The JSPs were created to get rid of the unsightly and unmaintainable out.println("<html>..</html>"). Your browser can understand only HTML. So when you make a request no-1 from the browser, your request parameters are passed to your servlet in the web container. The servlet, controls the flow and does some stuff and finally forwards the request to your JSP. The JSP engine converts the JSP to a servlet with all the out.println(<html></html>
statements. finally output html sent back to the client from the _jsp_converted servlet and your request no 1 is complete (request/response). Any attributes you have set in the JSP have gone out of scope now. When the request no 2 invoked the same process repeats. If you set it in a session scope then it will be available until the session is invalidated.
Hope it explains it.