Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xsl and jsp

 
Kris Rasmussen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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 ]
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic