Quote:
Originally Posted by nkoplm
hello,
here is an example of my problem:
I have a file index.jsp, and within that file I have
<% String PageName = "Home"; %>
<jsp:include page="menu.jsp" />
Now I would like to have access to the PageName variable within menu.jsp so i can do things like
<%= PageName %>
in menu.jsp but as it stands now the variable is not passed to the included file.
how can i do this?
|
I don't know about the specific language that you are using as you haven't stated what is is.
but here's how we would do it in shell
Code:
include menu.jsp
export Page="Home"
by exporting the variable we make it possible for other apps or in this case pages to read it and use the variable.
if you give me the name of the programing language then mabey I can help a bit more by getting you the equivalent of the shell.
the only downside is that usually when you make a variable available to the other page or program is that it is also available to other programs that may be attempting to do something malicious and with web pages this can mean that hackers can exploit this.
but as i say I can probably find you a safe equivalent if you give me the name of the language that you are using.
Edit:
future note when asking for help state the language other wise it makes it very difficult for us to point you in the direction of someone who can help if the replier cannot.