Save India From Corruption - Anna Hazare.
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Save India From Corruption - Anna Hazare.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Ankit Garg wrote:So you are actually passing the FlagBean instance that you created in your servlet to the java class?? I don't see any reason how this can happen
Save India From Corruption - Anna Hazare.
Andrew Monkhouse wrote:Perhaps you could show us the bit of your code in the doGet or doPost that is related to the call to your worker bean?
Save India From Corruption - Anna Hazare.
where you are getting that
Save India From Corruption - Anna Hazare.
Ravi Kiran V wrote:
so please tell me how can the communication from my servlet class to the java class can happen ??
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Save India From Corruption - Anna Hazare.
You'll need to pass the FlagBean instance that you create in your servlet to the normal java class for the value to be able to reach the normal java class...
Save India From Corruption - Anna Hazare.
Ravi Kiran V wrote:.... don't create new class of FlagBean inside the java class but just call the getter Method it (Am i right to understand this properly ?)
Inside my Java class
FlagBean fb = new FlagBean()
but just fb.getMethod()
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
You should call the getter of the object you have set the values in, perhaps passing that reference to your java class.
Save India From Corruption - Anna Hazare.
Ravi Kiran V wrote:Hi ,
I am having a jsp page for submitting values .
--Sam - Right this works
All these values are recievied by a servlet .
--Sam - I think we are good up to this point too
This servlet in turn calls a normal java file
(This is the flow of our application)
--Sam - This is where the problem is - so lets clear up a few things.
There is no such thing as calling a Java File - unless you are using Runtime class to execute the file or something.
What you can do though is create an Object of the plain Java class and call a method or call static method of this plain java class and pass your bean as a parameter to the method!
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Save India From Corruption - Anna Hazare.
Ravi Kiran V wrote:All of you thank you very much .
I have made all the methods and properties to static and its working (without creating an instance of that Bean class)
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Ravi Kiran V wrote:seems interesting sam . ( I did not test for simultaneous requests actually )
But can you please tell me what will be the problem actually .
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Save India From Corruption - Anna Hazare.
samir singha wrote:why don't you pass the bean object (fb in your case)created in your servlet to your java class through constructor or method parameter of your java class and get the value from bean object.
Don't get me started about those stupid light bulbs. |