File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling bean methods from jsp page

 
Mike Floyd
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all, i would to call a method of a bean included in my jsp page.
The method take 2 arguments.
The difficult is that i must to use the JSTL tags.
How i can to do?
The method serves to me to control the data input element of a html page!
Please help me!
Thanks
 
David Ulicny
Ranch Hand
Posts: 724
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do this by use
<jsp:setProperty /> or <jsp:getProperty/>

Look at the documentation
http://java.sun.com/products/jsp/tags/syntaxref.fm13.html
 
Mike Floyd
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cannot be done with either the EL (JSTL) or <jsp:setProperty/>. These mechanisms are intended to access the properties of Java Beans (in other words, methods that follow the bean property pattern) and not to call arbitrary methods.

For that, you need to resort to scriptlets or scriplet expressions. Which should raise a red flag in your mind that says: "Why am I calling this method in my JSP? Am I perhaps doing processing that belongs elsewhere? Or should I be using a custom tag for this purpose?"
[ January 27, 2005: Message edited by: Bear Bibeault ]
 
Mike Floyd
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i know that isn't functional merge the script and the jstl tags.
Can you gimme some indication to control the data from an html form?
i has a java method into a bean that works for this, but i prefere to abandone the old script to develop all my application with jstl.
thanks
bye
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic