*
The moose likes JSP and the fly likes usebean problem newbie Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "usebean problem newbie " Watch "usebean problem newbie " New topic
Author

usebean problem newbie

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
I try to minimize the use of scriptlets in jsp using beans .My requirement is that i pass 2 fields and in return i get 2 values.Return value is from the database as per the input parameters .I am able to set the values and retrive that values successfully but how i call the function which performs database operation without using scriptlet.

aliasname is found after comparing vid with database.
Where i put code for database operation.
Thanks
Mukesh Mittal
Ranch Hand

Joined: Jan 13, 2006
Posts: 31
You can use servlet
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60745
    
  65

To expand a little, the best way to simplify your JSP pages -- and avoiding scriptlets is a great first step -- is to follow good web application programming structure.

The most accepted practice is to structure your application using the "Model 2" pattern in which servlets intercept the submission, perform work (such as DB operations) and forward on to a JSP to render the view.

This article may be helpful in describing the patterns and how they came about.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: usebean problem newbie
 
Similar Threads
Solved : Java CheckBox to insert data
Help deploying simple web service using Axis/Tomcat
Weird Static method behavior
Http Client post method data incomplete
Display Select Query Result in JTable