I\'m learning java and try to pass some variable from servlet to jsp page. Here is code from servlet page
@WebServlet(\"/Welcome\")
public class WelcomeServl
You set an attribute in a session. You have to retrieve it from a session:
Object sss = session.getAttribute("MyAttribute");
And since you are dispatching the request, you actually don't need a session. You can set the attribute in a request object in your servlet:
request.setAttribute("MyAttribute", "test value");
Then read it as you are already doing in you JSP.