• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

xsl and jsp

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using resin to distribute a combination of xsl and jsp with xtp pages. I would like to be able to access an attribute defined in my xtp page from within my xsl page via java. I realize i could do this with a scriplet but I need to do it with actuall jsp as I need to make a call to a database with the attribute as input. Can anyone explain if this is possible or how I can do it?

Thanks,
Kris
[ November 03, 2002: Message edited by: Kris Rasmussen ]
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a little confused as to what exactly you want to do here. Can you give a simple example of where your attribute is set, and where you want to use it ? Thanks.
 
Kris Rasmussen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I actually just figured it out myself, but I have another question at the end of this one so please read on.
I was trying to do this.

sometag
<<
<%int somevariableineedlater=$value-of(@param);;%>
>>
I didn't realize you could put xsl tags inside the jsp code like that.
I am still a little confused by the difference between <% and <jsp:scriptlet>. Is the <jsp:scriplet> tag compiled and executed once to create the static page while the <% tag executes the code everytime the page is accessed?
Thanks,
Kris
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am still a little confused by the difference between <% and <jsp:scriptlet>
As far as I know, they are exactly the same. jsp:scriptlet is just an XML/XSL-friendly version.
They both indicate some code which is compiled in to the servlet generated from the JSP page, and run for every request.
 
Kris Rasmussen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thats what I thought too, however if you declare code in one, it cannot be accessed by the other. Any thoughts?
 
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic