Re: How to access JSP variables inside Tiles
I'm pretty sure you can't. Is there a reason that can't be a tile? The whole purpose of tiles is to be a way more efficient and flexible version of JSP Includes. If you incorporated the contents of that include in a tile, there's a good chance that you won't have to worry about trying to figure out what's accessible from where. (*Chris*) On 10/5/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: Hi Chris, I am still not able to make it work. Which is my outermost tile? I think, my tiles are not embedded into each other. Also, can I use the JSP variable declared in printable.jsp into another tile like = "somepage.jsp">This is link Thanks for your time. Thanks Vinod --- Chris Pratt <[EMAIL PROTECTED]> wrote: > Then you should be able to go to the outermost tile > and use > after > you've imported the tiles > taglib and all the tile variables to be available to > the jsp and jstl tags. > (*Chris*) > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: > > > > Hi Chris, > > Thanks for your quick response. I could not make > it > > to work. sorry, I am new to this stuff. In which > tile > > should I include ? I want > to > > import all the variables available in tile > > "printable.jsp" and put them in request scope, so > that > > I can use them in all of the tiles. > > > > Thanks > > Vinod > > > > --- Chris Pratt <[EMAIL PROTECTED]> wrote: > > > > > If they are tile scope variables, you either > need to > > > put > > > at the top of the page > to > > > put them in page scope or > > > use the tiles tags to insert the values (like > > > > > name="href"/>) > > > (*Chris*) > > > > > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> > wrote: > > > > > > > > Hi Chris, > > > > I made the printable.jsp page as a tile > and > > > > included it in the layout-tiles.jsp page. But > > > still I > > > > can't access the variables declared in tile > > > > "printable" in another tile. > > > > > > > > I try to access the href variable like > > > > = "contact.jsp">This is > link > > > > > > > > but I get Undefined variable: href > > > > out.print( href ); > > > > > > > > Thanks > > > > Vinod > > > > > > > > > > > > --- Chris Pratt <[EMAIL PROTECTED]> > wrote: > > > > > > > > > That's because it's a JSP include, not a > tile. > > > JSP > > > > > knows nothing about the > > > > > tile scope and since the inclusion gets done > by > > > the > > > > > JSP processor, not the > > > > > tiles plugin, the tile variables aren't > > > available. > > > > > Make that a tile instead > > > > > and you shouldn't have a problem. > > > > > (*Chris*) > > > > > > > > > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> > > > wrote: > > > > > > > > > > > > Hi All, > > > > > >I have included printable.jsp page > in > > > the > > > > > > layout-tiles file. I have some jsp > > > > > > variables (such as href, onchange etc see > > > below in > > > > > > file) in printable.jsp, which i want to > > > > > > use inside tiles such as top.jsp, > bottom.jsp > > > but i > > > > > > cannot use those variables as they are not > > > > > > available. I get some undefined variable > > > message. > > > > > This > > > > > > may be more of scope issue but I don't > > > > > > know, how to get these variables > accessible > > > inside > > > > > > tiles. Thanks for the help. > > > > > > > > > > > > ***start of > > > layout-tiles.jsp** > > > > > > > > > > > > > > > > > > > > > > attribute="title"/> > > > > > > <%@ include > > > file="include/printable.jsp" > > > > > %> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > **end of > > > layout-tiles.jsp > > > > > > > > > > > > ***start of printable.jsp (under include > > > > > directory) > > > > > > * > > > > > > <% > > > > > > String printParm = > > > > > > (String)request.getAttribute("print"); > > > > > > boolean printThis = ( printParm != > > > null > > > > > && > > > > > > printParm.equals( "1" )); > > > > > > String href = ( printThis ? > > > "nohref" > > > > > : "href" > > > > > > ); > > > > > > String onchange = ( printThis ? > > > > > "noonchange" : > > > > > > "onchange" ); > > > > > > String onblur = ( printThis ? > > > "nonblur" > > > > > : "onblur" > > > > > > ); > > > > > > %> > > > > > > ***end of printable.jsp ** > > > > > > > > > > > > > > > > > > > > > > __ > > > > > > Do You Yahoo!? > > > > > > Tired of spam? Yahoo! Mail has the best > spam > > > > > protection around > > > > > > http://mail.yahoo.com > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > > To unsubscribe, e-mail: > > > > > [EMAIL PROTECTED] > > > > > > For additional commands, e-mail: > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ___
Re: How to access JSP variables inside Tiles
Hi Chris, I am still not able to make it work. Which is my outermost tile? I think, my tiles are not embedded into each other. Also, can I use the JSP variable declared in printable.jsp into another tile like = "somepage.jsp">This is link Thanks for your time. Thanks Vinod --- Chris Pratt <[EMAIL PROTECTED]> wrote: > Then you should be able to go to the outermost tile > and use > after > you've imported the tiles > taglib and all the tile variables to be available to > the jsp and jstl tags. > (*Chris*) > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: > > > > Hi Chris, > > Thanks for your quick response. I could not make > it > > to work. sorry, I am new to this stuff. In which > tile > > should I include ? I want > to > > import all the variables available in tile > > "printable.jsp" and put them in request scope, so > that > > I can use them in all of the tiles. > > > > Thanks > > Vinod > > > > --- Chris Pratt <[EMAIL PROTECTED]> wrote: > > > > > If they are tile scope variables, you either > need to > > > put > > > at the top of the page > to > > > put them in page scope or > > > use the tiles tags to insert the values (like > > > > > name="href"/>) > > > (*Chris*) > > > > > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> > wrote: > > > > > > > > Hi Chris, > > > > I made the printable.jsp page as a tile > and > > > > included it in the layout-tiles.jsp page. But > > > still I > > > > can't access the variables declared in tile > > > > "printable" in another tile. > > > > > > > > I try to access the href variable like > > > > = "contact.jsp">This is > link > > > > > > > > but I get Undefined variable: href > > > > out.print( href ); > > > > > > > > Thanks > > > > Vinod > > > > > > > > > > > > --- Chris Pratt <[EMAIL PROTECTED]> > wrote: > > > > > > > > > That's because it's a JSP include, not a > tile. > > > JSP > > > > > knows nothing about the > > > > > tile scope and since the inclusion gets done > by > > > the > > > > > JSP processor, not the > > > > > tiles plugin, the tile variables aren't > > > available. > > > > > Make that a tile instead > > > > > and you shouldn't have a problem. > > > > > (*Chris*) > > > > > > > > > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> > > > wrote: > > > > > > > > > > > > Hi All, > > > > > >I have included printable.jsp page > in > > > the > > > > > > layout-tiles file. I have some jsp > > > > > > variables (such as href, onchange etc see > > > below in > > > > > > file) in printable.jsp, which i want to > > > > > > use inside tiles such as top.jsp, > bottom.jsp > > > but i > > > > > > cannot use those variables as they are not > > > > > > available. I get some undefined variable > > > message. > > > > > This > > > > > > may be more of scope issue but I don't > > > > > > know, how to get these variables > accessible > > > inside > > > > > > tiles. Thanks for the help. > > > > > > > > > > > > ***start of > > > layout-tiles.jsp** > > > > > > > > > > > > > > > > > > > > > > attribute="title"/> > > > > > > <%@ include > > > file="include/printable.jsp" > > > > > %> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > **end of > > > layout-tiles.jsp > > > > > > > > > > > > ***start of printable.jsp (under include > > > > > directory) > > > > > > * > > > > > > <% > > > > > > String printParm = > > > > > > (String)request.getAttribute("print"); > > > > > > boolean printThis = ( printParm != > > > null > > > > > && > > > > > > printParm.equals( "1" )); > > > > > > String href = ( printThis ? > > > "nohref" > > > > > : "href" > > > > > > ); > > > > > > String onchange = ( printThis ? > > > > > "noonchange" : > > > > > > "onchange" ); > > > > > > String onblur = ( printThis ? > > > "nonblur" > > > > > : "onblur" > > > > > > ); > > > > > > %> > > > > > > ***end of printable.jsp ** > > > > > > > > > > > > > > > > > > > > > > __ > > > > > > Do You Yahoo!? > > > > > > Tired of spam? Yahoo! Mail has the best > spam > > > > > protection around > > > > > > http://mail.yahoo.com > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > > To unsubscribe, e-mail: > > > > > [EMAIL PROTECTED] > > > > > > For additional commands, e-mail: > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > __ > > > > Do You Yahoo!? > > > > Tired of spam? Yahoo! Mail has the best spam > > > protection around > > > > http://mail.yahoo.com > > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: > > > [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > >
Re: How to access JSP variables inside Tiles
Then you should be able to go to the outermost tile and use after you've imported the tiles taglib and all the tile variables to be available to the jsp and jstl tags. (*Chris*) On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: Hi Chris, Thanks for your quick response. I could not make it to work. sorry, I am new to this stuff. In which tile should I include ? I want to import all the variables available in tile "printable.jsp" and put them in request scope, so that I can use them in all of the tiles. Thanks Vinod --- Chris Pratt <[EMAIL PROTECTED]> wrote: > If they are tile scope variables, you either need to > put > at the top of the page to > put them in page scope or > use the tiles tags to insert the values (like > name="href"/>) > (*Chris*) > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: > > > > Hi Chris, > > I made the printable.jsp page as a tile and > > included it in the layout-tiles.jsp page. But > still I > > can't access the variables declared in tile > > "printable" in another tile. > > > > I try to access the href variable like > > = "contact.jsp">This is link > > > > but I get Undefined variable: href > > out.print( href ); > > > > Thanks > > Vinod > > > > > > --- Chris Pratt <[EMAIL PROTECTED]> wrote: > > > > > That's because it's a JSP include, not a tile. > JSP > > > knows nothing about the > > > tile scope and since the inclusion gets done by > the > > > JSP processor, not the > > > tiles plugin, the tile variables aren't > available. > > > Make that a tile instead > > > and you shouldn't have a problem. > > > (*Chris*) > > > > > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> > wrote: > > > > > > > > Hi All, > > > >I have included printable.jsp page in > the > > > > layout-tiles file. I have some jsp > > > > variables (such as href, onchange etc see > below in > > > > file) in printable.jsp, which i want to > > > > use inside tiles such as top.jsp, bottom.jsp > but i > > > > cannot use those variables as they are not > > > > available. I get some undefined variable > message. > > > This > > > > may be more of scope issue but I don't > > > > know, how to get these variables accessible > inside > > > > tiles. Thanks for the help. > > > > > > > > ***start of > layout-tiles.jsp** > > > > > > > > > > > > > > attribute="title"/> > > > > <%@ include > file="include/printable.jsp" > > > %> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > **end of > layout-tiles.jsp > > > > > > > > ***start of printable.jsp (under include > > > directory) > > > > * > > > > <% > > > > String printParm = > > > > (String)request.getAttribute("print"); > > > > boolean printThis = ( printParm != > null > > > && > > > > printParm.equals( "1" )); > > > > String href = ( printThis ? > "nohref" > > > : "href" > > > > ); > > > > String onchange = ( printThis ? > > > "noonchange" : > > > > "onchange" ); > > > > String onblur = ( printThis ? > "nonblur" > > > : "onblur" > > > > ); > > > > %> > > > > ***end of printable.jsp ** > > > > > > > > > > > > > __ > > > > Do You Yahoo!? > > > > Tired of spam? Yahoo! Mail has the best spam > > > protection around > > > > http://mail.yahoo.com > > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: > > > [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > __ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access JSP variables inside Tiles
Hi Chris, Thanks for your quick response. I could not make it to work. sorry, I am new to this stuff. In which tile should I include ? I want to import all the variables available in tile "printable.jsp" and put them in request scope, so that I can use them in all of the tiles. Thanks Vinod --- Chris Pratt <[EMAIL PROTECTED]> wrote: > If they are tile scope variables, you either need to > put > at the top of the page to > put them in page scope or > use the tiles tags to insert the values (like > name="href"/>) > (*Chris*) > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: > > > > Hi Chris, > > I made the printable.jsp page as a tile and > > included it in the layout-tiles.jsp page. But > still I > > can't access the variables declared in tile > > "printable" in another tile. > > > > I try to access the href variable like > > = "contact.jsp">This is link > > > > but I get Undefined variable: href > > out.print( href ); > > > > Thanks > > Vinod > > > > > > --- Chris Pratt <[EMAIL PROTECTED]> wrote: > > > > > That's because it's a JSP include, not a tile. > JSP > > > knows nothing about the > > > tile scope and since the inclusion gets done by > the > > > JSP processor, not the > > > tiles plugin, the tile variables aren't > available. > > > Make that a tile instead > > > and you shouldn't have a problem. > > > (*Chris*) > > > > > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> > wrote: > > > > > > > > Hi All, > > > >I have included printable.jsp page in > the > > > > layout-tiles file. I have some jsp > > > > variables (such as href, onchange etc see > below in > > > > file) in printable.jsp, which i want to > > > > use inside tiles such as top.jsp, bottom.jsp > but i > > > > cannot use those variables as they are not > > > > available. I get some undefined variable > message. > > > This > > > > may be more of scope issue but I don't > > > > know, how to get these variables accessible > inside > > > > tiles. Thanks for the help. > > > > > > > > ***start of > layout-tiles.jsp** > > > > > > > > > > > > > > attribute="title"/> > > > > <%@ include > file="include/printable.jsp" > > > %> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > **end of > layout-tiles.jsp > > > > > > > > ***start of printable.jsp (under include > > > directory) > > > > * > > > > <% > > > > String printParm = > > > > (String)request.getAttribute("print"); > > > > boolean printThis = ( printParm != > null > > > && > > > > printParm.equals( "1" )); > > > > String href = ( printThis ? > "nohref" > > > : "href" > > > > ); > > > > String onchange = ( printThis ? > > > "noonchange" : > > > > "onchange" ); > > > > String onblur = ( printThis ? > "nonblur" > > > : "onblur" > > > > ); > > > > %> > > > > ***end of printable.jsp ** > > > > > > > > > > > > > __ > > > > Do You Yahoo!? > > > > Tired of spam? Yahoo! Mail has the best spam > > > protection around > > > > http://mail.yahoo.com > > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: > > > [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > __ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access JSP variables inside Tiles
If they are tile scope variables, you either need to put at the top of the page to put them in page scope or use the tiles tags to insert the values (like ) (*Chris*) On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: Hi Chris, I made the printable.jsp page as a tile and included it in the layout-tiles.jsp page. But still I can't access the variables declared in tile "printable" in another tile. I try to access the href variable like = "contact.jsp">This is link but I get Undefined variable: href out.print( href ); Thanks Vinod --- Chris Pratt <[EMAIL PROTECTED]> wrote: > That's because it's a JSP include, not a tile. JSP > knows nothing about the > tile scope and since the inclusion gets done by the > JSP processor, not the > tiles plugin, the tile variables aren't available. > Make that a tile instead > and you shouldn't have a problem. > (*Chris*) > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: > > > > Hi All, > >I have included printable.jsp page in the > > layout-tiles file. I have some jsp > > variables (such as href, onchange etc see below in > > file) in printable.jsp, which i want to > > use inside tiles such as top.jsp, bottom.jsp but i > > cannot use those variables as they are not > > available. I get some undefined variable message. > This > > may be more of scope issue but I don't > > know, how to get these variables accessible inside > > tiles. Thanks for the help. > > > > ***start of layout-tiles.jsp** > > > > > > attribute="title"/> > > <%@ include file="include/printable.jsp" > %> > > > > > > > > > > > > > > > > > > **end of layout-tiles.jsp > > > > ***start of printable.jsp (under include > directory) > > * > > <% > > String printParm = > > (String)request.getAttribute("print"); > > boolean printThis = ( printParm != null > && > > printParm.equals( "1" )); > > String href = ( printThis ? "nohref" > : "href" > > ); > > String onchange = ( printThis ? > "noonchange" : > > "onchange" ); > > String onblur = ( printThis ? "nonblur" > : "onblur" > > ); > > %> > > ***end of printable.jsp ** > > > > > > __ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access JSP variables inside Tiles
Hi Chris, I made the printable.jsp page as a tile and included it in the layout-tiles.jsp page. But still I can't access the variables declared in tile "printable" in another tile. I try to access the href variable like = "contact.jsp">This is link but I get Undefined variable: href out.print( href ); Thanks Vinod --- Chris Pratt <[EMAIL PROTECTED]> wrote: > That's because it's a JSP include, not a tile. JSP > knows nothing about the > tile scope and since the inclusion gets done by the > JSP processor, not the > tiles plugin, the tile variables aren't available. > Make that a tile instead > and you shouldn't have a problem. > (*Chris*) > > On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: > > > > Hi All, > >I have included printable.jsp page in the > > layout-tiles file. I have some jsp > > variables (such as href, onchange etc see below in > > file) in printable.jsp, which i want to > > use inside tiles such as top.jsp, bottom.jsp but i > > cannot use those variables as they are not > > available. I get some undefined variable message. > This > > may be more of scope issue but I don't > > know, how to get these variables accessible inside > > tiles. Thanks for the help. > > > > ***start of layout-tiles.jsp** > > > > > > attribute="title"/> > > <%@ include file="include/printable.jsp" > %> > > > > > > > > > > > > > > > > > > **end of layout-tiles.jsp > > > > ***start of printable.jsp (under include > directory) > > * > > <% > > String printParm = > > (String)request.getAttribute("print"); > > boolean printThis = ( printParm != null > && > > printParm.equals( "1" )); > > String href = ( printThis ? "nohref" > : "href" > > ); > > String onchange = ( printThis ? > "noonchange" : > > "onchange" ); > > String onblur = ( printThis ? "nonblur" > : "onblur" > > ); > > %> > > ***end of printable.jsp ** > > > > > > __ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access JSP variables inside Tiles
That's because it's a JSP include, not a tile. JSP knows nothing about the tile scope and since the inclusion gets done by the JSP processor, not the tiles plugin, the tile variables aren't available. Make that a tile instead and you shouldn't have a problem. (*Chris*) On 10/4/06, Vinod Kumar <[EMAIL PROTECTED]> wrote: Hi All, I have included printable.jsp page in the layout-tiles file. I have some jsp variables (such as href, onchange etc see below in file) in printable.jsp, which i want to use inside tiles such as top.jsp, bottom.jsp but i cannot use those variables as they are not available. I get some undefined variable message. This may be more of scope issue but I don't know, how to get these variables accessible inside tiles. Thanks for the help. ***start of layout-tiles.jsp** <%@ include file="include/printable.jsp" %> **end of layout-tiles.jsp ***start of printable.jsp (under include directory) * <% String printParm = (String)request.getAttribute("print"); boolean printThis = ( printParm != null && printParm.equals( "1" )); String href = ( printThis ? "nohref" : "href" ); String onchange = ( printThis ? "noonchange" : "onchange" ); String onblur = ( printThis ? "nonblur" : "onblur" ); %> ***end of printable.jsp ** __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]