This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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?
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
Joined: Jan 07, 1999
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.
Joined: Nov 03, 2002
Thats what I thought too, however if you declare code in one, it cannot be accessed by the other. Any thoughts?