This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes beans in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "beans in servlet" Watch "beans in servlet" New topic

beans in servlet

Abhijeet Gholkar

Joined: Jun 11, 2002
Posts: 25
Hi guys
Can i use beans in servlet, as they are used in jsp.
<I><jsp:useBean id="test" class="test" scope="sesson"/>
<jsp:setProperty name="test" property="*"/></I>
If yes please tell me were can i get information about it.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
The servlet API does not have any magic tags like those in JSP so you would have to write out the method calls necessary to get and set parameters. You would also have to provide for creating and saving the bean.
Take a look at what your JSP page is generating as Java source to get an idea of what you would have to create.
I agree. Here's the link:
subject: beans in servlet
Similar Threads
help on taglib and properties file in struts?
Doubt about how configuring init parameters in JSP
access a servlet usin its name
Problem with scripting-invalid