I am working on a JSP project. I have a page that calls another JSP.
Now the problem is, how to pass or use a variable in the called JSP page in its calling page?
I am working on a JSP project. I have a page that calls another JSP.
Now the problem is, how to pass or use a variable in the called JSP page in its calling page?
Your design should be
See Also
You can save the variable in the HTTPSession or ServletContext object.
And in the calling JSP page, use or check session attribute for the variable.
session.setAttribute(objectId, Object);
to set the variable.
session.getAttribute(objectId);
to get the variable.
I have a page that calls another jsp page
The problem lies here in this sentence.
Try to follow MVC. Use JSP
just for rendering the View, and Servlet
as a Controller.
Here, simple.souther.us, you find simple and awesome tutorials for newbies.