wood burning stoves*
The moose likes Servlets and the fly likes Using servlets with java beans 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 "Using servlets with java beans " Watch "Using servlets with java beans " New topic
Author

Using servlets with java beans

Giselle Dazzi
Ranch Hand

Joined: Apr 20, 2003
Posts: 168
Hi all,
Do you know how I can call beans methods from a servlet.
I mean, Im trying to find out how to do a


from inside a servlet instead of a jsp page.
I tried instantiating the bean class and then calling the get method I want but since it's a new instance, I dont see the content it has been set by the session.
Thx in advance,


Giselle Dazzi<br />SCJP 1.4
cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
Hi Giselle,
The best way to see how you may call a javabean from a serlvet is to check the code of the servlet generated by your JSP page.
I'm sure you know that at translation time, JSP pages are converted into servlets..
So just cut and paste..
Regards,
Cyril


SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287
Tim Baker
Ranch Hand

Joined: Oct 04, 2003
Posts: 541
and if you don't know if your using tomcat look in tomcat/work


Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
Giselle Dazzi
Ranch Hand

Joined: Apr 20, 2003
Posts: 168
thx, I got it, here's the code I used:
 
jQuery in Action, 2nd edition
 
subject: Using servlets with java beans
 
Similar Threads
Server Wide Arraylist ?
Need Help With Accessing Multiple Access Database Tables Using JSP
Please reply fast
Beans (again)
Web Frameworks