This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Can a Servlet be both a loaded Servlet and a Javabean in useBean? 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 » Servlets
Bookmark "Can a Servlet be both a loaded Servlet and a Javabean in useBean?" Watch "Can a Servlet be both a loaded Servlet and a Javabean in useBean?" New topic
Author

Can a Servlet be both a loaded Servlet and a Javabean in useBean?

Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
I want my Servlet to both be a servlet and also be able to be used as a bean in the tag:
<jsp:useBean id="formHandler" class="FormHandler scope="request" />
I have two questions:
1. Can this be done?
2. If a form is posted and it's sent to my servlet, if the servlet is also used on the page in the "useBean" tag, and it sets non-static variables in itself, will the useBean version of it be able to get those? Can I make them the same object?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Can a Servlet be both a loaded Servlet and a Javabean in useBean?
 
Similar Threads
Mapping Beans to Servlets
Display pdf file contents through jsp
useBean and class inheritance
usebean query
JSP Debugging