Help...JSP,Beans

Discussions

Web tier: servlets, JSP, Web frameworks: Help...JSP,Beans

  1. Help...JSP,Beans (2 messages)

    Hi

    I am using java.lang.Properties class to store some data in my java bean class. When i am compiling, it goes fine.
    But when i am invoking the JSP file which calls this bean,
    the JSP error page is thrown, which says :
    "
    java.util.Properties: method setProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object; not found
    "

    The relevant code from the bean class source is :

    import java.util.*;
    .....
    private String[] resourceId;
    private String[] resourceContact;
    private Properties resourceTable;
    .....
    resourceTable = new Properties();
    .....
    resourceTable.setProperty(resourceId[i],resourceContact[i]);
    .....


    Could anyone please figure out why this code is compiling..
    But throws a run time exception as given above.

    Thanks in advace,
    Jayanand.

    Threaded Messages (2)

  2. Help...JSP,Beans[ Go to top ]

    hope resourceId[i],resourceContact[i] are populated String[]
  3. Help...JSP,Beans[ Go to top ]

    Hi Amol,

    Yes I have populated them correctly. I think I identified the reason for this funny behaviour.

    I developed and tested the bean class using JDK1.2 whose
    JRE environment is version 1.2.2.

    But for my JWS2.0, the JRE is version 1.1.7B.
    Hence at JSP page processing time, JWS is using the JRE 1.1.7B, whose java.util.Properties has no method called
    setProperty()!!!!!! This method is a new addition in the JRE 1.2.2. Hence the error. I used java.util.Hashtable
    which is available and the error was solved.

    Thanks,
    Jayanand.