This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes Calling Bean Code From JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Calling Bean Code From JSP" Watch "Calling Bean Code From JSP" New topic
Author

Calling Bean Code From JSP

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1110
On my JSP page, I have some fields the user enters to try and schedule an appointment. What I would like is to have a button that would check the availability of the person being scheduled.
I know how to do this if I make the FORM ACTION another JSP page, but I want to just call my bean code that would do this lookup and then return the results to the current JSP page.
Can this be done?
My problem is I don't know how to SUBMIT the form without the FORM ACTION being another JSP page or a servlet.
Do I need to use Javascript to do this type of local processing where I can pick what the user has entered in the JSP/HTML form fields and then call the bean method (and return the results to the same JSP page)?
Any advice would be appreciated!!!
Thanks much.
-- Mike
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12998
    
    5
You are indeed stuck with Javascript if you want to modify an HTML page rather than totally regenerating it. Doing this sort of thing is a bit of a pain due to variations in how browsers handle things.
An alternative would be to use an Applet which could talk to a servlet.
Bill
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1110
Thanks for your reply.
I went ahead and just set my FORM ACTION to another JSP page.
-- Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling Bean Code From JSP
 
jQuery in Action, 3rd edition