aspose file tools*
The moose likes JSP and the fly likes Calling functions in a bean. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Calling functions in a bean." Watch "Calling functions in a bean." New topic
Author

Calling functions in a bean.

Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
this has probably been asked umpteen billion times, but:
Is there anyway to call a function from a jsp using xml tags without said call being in an expression or scriptlet tag?
-Speaking of which, do you access the bean within an expression type like this:
<jsp:usebean name="example" class="some.class.bean"/>
<jsp:expression> example.function(parameter); </jsp:expression>
Would this work?


http://www.goodercode.com
SCJP 1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61202
    
  66

Here's a great way to check this (and any other JSP "how does this work" questions).
Code it up and hit the page. Then go find the .java file that the container created on the behalf of your JSP page. By looking at the container-generated code you can see exactly how your useBean directive (as well as anything else in a JSP) works.
Tomcat puts the generated Java files in a folder structure under $CATALINA_HOME/work. Resin puts them under WEB-INF/work in your web app hierarchy. I'm not sure where other containers store the files, but finding these and perusing them is one of the best JSP tools you don't have to buy.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling functions in a bean.