Win a copy of Rust Web Development this week in the Other Languages forum!

Shasi Sekar

Greenhorn
+ Follow
since Aug 22, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shasi Sekar

thank you Anayonkar,

I figured it out. i was missing it to get the methods for the second time from the instance that is got.

Thanks for the missing link
9 years ago
Thanks for your immediate reply

"Class A generates two classes B and C" --> my typo .... it creates instances. Also the instance of C can only be got from B.

"The class of B is constant" --> this too is a typo --> should be "The class name of B is constant"

The last part is right,

class name of C is not constant. it might be D or E.

Both B and C would compile because Class B and C are generated dynamically where class B has the info of class C or D ....

As you said reflection is right. and i saw the methods Class and Method.

but if i say class.newInstance(); it returns an object ,

here is my problem..... after getting the instance thro' invoke method or newInstance .... i need to typecast it to class C

I have the class name as C in a string object, That is it
String classname = "C"
ie. if i say

Object x = (classname)class.newInstance();
classname is not resolved to a type.

My hurdle here is type casting.

9 years ago
Hi All,

i need to know how to get the class dynamically or type cast to a dynamic class

below is the scenario

I have a class A. Class A generates two classes B and C (for example) depending on the input given to class A.
The class of B is constant and class name of C is dynamically generated. Class B has getter and setter for Class C, which returns Object (not C).

Now in class A I create a instance of Class B and access the getter of class C using reflection (I have the class Name in a prop file).

Since the getter method returns object, I am not able to access the methods of class C.

I need to dynamically typecast the object to Class c. I have the class name as String,but running out of ideas to do it.


Any suggestion/idea is most welcome

9 years ago
Jeff Verdegan, thanks for your immediate reply

That's right its stored in a entry format. But my question is how a key recognizes its object after storing, Or for a hash map ,all keys and values are in the same bucket, How a key identifies its value object OR how a key refers to its object

Thanks
Shasi Sekar
9 years ago
Hi All,

I digged into servlet source code and was not able to find what check is made, so that the init and destroy methods are called only once. It would be great if any body helps me to understand better

Thanks in advance
Shasi Sekar
9 years ago
Hi All,

I tried to dig into java with its source code. I found that Hash map stores its keys and values in an entry array. But i still didn't understand how the mapping is maintained between the key and its corresponding object.
Can anybody give me a clear picture on this

Thanks in advance
Shasi Sekar
9 years ago
yes there is a tomcat service running and shown in services dialog

But i want the web service service to be shown in the services dialog as the way tomcat is shown
10 years ago
thanks bill for your comment.

Yes it is a http service and i had deployed into tomcat6.0 and its working fine.

The requirement is, i need to convert this service into a windows service i.e this service is to be seen in the screen which appears when i type "services.msc" in windows.

Hope this is clear enough about the requirement

Thanks in advance
Shasi
10 years ago
I developed a web service and hosted it successfully in a web server.Now i need to host this service as a windows service.

Any ideas into convert a web service in to windows service.Any suggestions or reference would do good

Thank you
Shasi
10 years ago
yes you are very right.That's what i have done
10 years ago
yes Ritchie, you are right.But i had sorted the values already using comparator and wanted a map with FIFO.
10 years ago
i got it ... need to use linked hash map.
10 years ago
Hi All,

I have a doubt on sorting a map

i explain the steps i followed.

1. put the keys and values in different collections
2.sort the values
3.iterate through sorted values,then iterate through the key set.
4.get the value from the unsorted map w.r.t to the key iteration
5.compare the value with the iterated value.
6.put the key and value into a sorted map if the comparison succeeds.

when i print the key an value after the successful comparison, i get the out put as required,i.e the output is sorted w.r.t. values.
but when the same output is inserted into a sorted map. I get the output as sorted w.r.t. keys.


what am i missing here.Is there a map which give the output in first in first out pattern


I code is below

Regards,
Shasi Sekar
10 years ago
I tried a sample of JAXB app
.
After googling i defined a empty Objectfactory class with an class level annotation for xmlRegistry.

I did xjc from command prompt against the schema i had, all the class were generated in folder named "generated".

Now my question is ... what is the object returned by

unmarshler.unmarshal(schemafile);

and how should i proceed further


Regards,
Shasi Sekar
10 years ago
check whether you defined the faces-context.xml
if yes --> check whether the reference is made in the web.xml

and finally check how you load the index page and the servlet mapping for initialize the faces context.

Basically the faces context is not getting initialized

cheers
Shasi
10 years ago
JSF