Question: what is the difference between request.setattribute and session.setattribute?
Answer: Request attribute is only available in the request object lifetime. filters, servlet, jsp, include, forward uses same request object. ... Whereas session attributes are available till the session ends or till the browser is closed. Hence the difference lies in the scope.