0

As per attached image, I have main jsp page which name is (Index.jsp) and I am including another jsp file inside it whose name is (Menu.jsp).

<jsp:include page="menu.jsp" flush="true"></jsp:include>

At the start of the application, I am setting few variable value to Menu.jsp and i need to access those value in Index.jsp.

Is there any way we can do that ?

enter image description here

TrexTroy
  • 303
  • 7
  • 22
  • Store the information in request attributes. Or make your menu a tag file, with OUT tag variables: http://docs.oracle.com/javaee/1.4/tutorial/doc/JSPTags5.html. It's quite strange that your main page depends on variables set by the menu page, though. These variables should probably be set by the controller. – JB Nizet Dec 21 '15 at 18:33
  • Possible duplicate of [How to pass parameter to jsp:include via c:set? What are the scopes of the variables in JSP?](http://stackoverflow.com/questions/16619015/how-to-pass-parameter-to-jspinclude-via-cset-what-are-the-scopes-of-the-varia) – DwB Jan 04 '16 at 14:24

1 Answers1

0

I recommend to read more about request scope in JSP pages. The answer to similar question you can find here: How to pass parameter to jsp:include via c:set? What are the scopes of the variables in JSP?

Community
  • 1
  • 1
Redwerk
  • 56
  • 2