How to instanciate Class Dynamically

I need to create instance and use class dynamically.
Suppose the codes instantiating an Object weather:
Weather weather=new Weather();but i want to do it dynamically, where the class name will be given as a String variable
in this case i will have
String className="Weather";then i want to replace the above Weather weather=new Weather(); to something like as:
Class.forName(className) instanceName=new Class.forName(className)() or somehow.
is it possible? Thank you for spending time to read my post.

Loading a Class by name and then creating an instance is easy enough. But because Java is a compiled language you can't just create a variable of a type unknown at compile time. The compiler needs to know what fields and methods are available up front, before any classes get dynamically loaded.
If you know the class you are going to load will be some subclass of "Weather", of if Weather is an interface and the class implements it, then you can create an instance and cast it to type Weather, then use the methods and fields of weather on it. If you don't have such information about the class you're going to load you need to access any objects created using reflection.

Similar Messages

  • How to load classes dynamically?

    Hi all!
    I have folowing problem.
    In my applet I need to load different classes form the same Web server. The main class is located in parent directory and different are in it's subdirectories. Security Manager allows to do this, but I find it difficult how to do it. Can you give me advise how to do it.
    Thanks beforehand...

    Create a package on the web side myserver.mypackage with subfolders ex1 ex2
    THere place your class files to dynamical loading
    Every class in package must starts from
    package myserver.mypackage; statment
    In paren directory for package creat a class where main applet class will be located
    Create an inctance for submain classes as
    (Class)Class.forName("myserver.mypackage.ex1.Class1").newInctance() - for class1 in ex1
    (Class)Class.forName("myserver.mypackage.ex2.Class1").newInctance() - for class1 in ex2
    It works. I'll send you example on e-mail.

  • How to load a Class Dynamically?

    hi,
    I have the following problem.I am trying to load a class dynamically.For this I am using ClassLoader and its Loadclass method.My code is like this,
    File file = filechooser.getSelectedFile();
    ClassLoader Cload = this.getClass().getClassLoader();
    String tempClsname= file.getName();
    Class cd =Cload.loadClass(tempClsname);
    Object ob =(Object)cd.newInstance();
    showMethods(ob);
    In showMethods what i am doing is getting the public methods of the dynamically loaded class,
    void showMethods(Object o){
    Class c = o.getClass();
    System.out.println(c.getName());
    vecList = new Vector();
    Method theMethods[] = c.getDeclaredMethods();
    for (int i = 0; i < theMethods.length; i++) {
    if(theMethods.getModifiers()==java.lang.reflect.Modifier.PUBLIC)
    String methodString = theMethods.getName();
    System.out.println(methodString);
    vecList.addElement(methodString);
    allmthdlst.setListData(vecList);
    Now whenever i work with this i m getting a runtime error of CLASS NOT FOUND Exception..I know its because of Classpath..But i don't know how to resolve it??pls help me in this regard...
    Also previously this code was working with java files in the directory in which this java file was present..How to make it work for java file in some other directory..pls help me in this regard...
    Thanks in advance..

    You sure didn't need to post this twice.
    http://forum.java.sun.com/thread.jsp?thread=522234&forum=31&message=2498659
    When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read and prevents accidental markup from array indices like [i].
    You resolve this problem by ensuring the class is in the classpath and you refer to it by its full name.
    &#167;

  • How to invoke a java class dynamically?

    Hi all,
    In my usecase I need to invoke a java class dynamically using any of the components like Button or link in jdeveloper.
    How could we invoke a java class which has a main method in it dynamically.
    Kindly come up with your help.
    Thanks,
    Phani.

    public class BackingBean {
    public BackingBean() {
    super();
    public void cb3_action() {
    File fileObj = new File("C:\\Jdeveloper software\\new.doc");
    IDocument myDoc = new Document2004();
    myDoc.addEle(Heading2.with("===== Headings ======").create());
    myDoc.addEle(Paragraph.with("This doc has been generated by the unit test testJava2wordAllInOne() in the class DocumentTest2004Test.java.").create());
    Table tbl = new Table();
    tbl.addTableEle(TableEle.TH, "Name", "Number of gols", "Country");
    tbl.setRepeatTableHeaderOnEveryPage();
    tbl.addTableEle(TableEle.TD, "Arthur Friedenreich", "1329", "Brazil");
    tbl.addTableEle(TableEle.TD, "Pele", "1281", "Brazil");
    myDoc.addEle(tbl);
    PrintWriter writer = null;
    try {
    writer = new PrintWriter(fileObj);
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    String myWord = myDoc.getContent();
    writer.println(myWord);
    writer.close();
    Hi john,
    these are my Backing bean and action now at the run time when I am pressing a button which has to invoke cb3_action() method.
    When I am clicking the button at the runtime I am getting the below error
    Error 500--Internal Server Error
    javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: word/w2004/Document2004
         at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
    In the above code if you observe I have used "IDocument myDoc = new Document2004();" line. Here this Document2004 is a class which is in one of the external
    jar files. xstream-1.3.1.jar , java2word-3.0_2011Aug02.jar , log4j-1.2.15.jar .
    these are the jar files I found in net using which I can create a word file and add all the components like table and format the txt etc..
    These jar files works in Tomcat, Jboss ,Struts
    I can even run this class and got the file created.
    But when I try to bind the method in ADF i am getting the error mentioned above.
    Kindly help me on this. Sorry for posting similar question two times on the blog.
    Sorry again if this question is wierd.
    Thanks,
    Phani.

  • How to create a dynamic class

    Hiya,
    I want to create classes dynamically. I know that this can be done by extending ClassLoader and defineClass method. My problem is i dont know what goes in byte[] coz my program needs to get the class name, attributes and methods from the user.
    For example something like visual modeler that loads up the UI than lets the user to create the classes, attributes and methods.
    The generic class called gentity is as follows:
    public class Gentity {
    private String gname;
    public Gentity(String mgname) {
    gname=mgname;
    public void setGname(String mgname)
    gname=mgname;
    public String getGname()
    {return(gname);
    This class will then be used in my main class which is as follows:
    public class GentityClassLoader extends ClassLoader
    Gentity customer=new Gentity("HSBC");
    public static void main(String argv[])
    byte b[]=new byte[1];
    GentityClassLoader obj = new GentityClassLoader();
    try{
    // this is my problem here, i dont know what goes in bytes
    Class cls = obj.defineClass(obj.customer.getGname(),b,0,b.length);
    Class x=obj.loadClass(obj.obj.getGname());
    obj.resolveClass(x);
    System.out.println(x.toString()+"asdf");
    }catch(Exception e)
    System.out.println("Error");
    Cheers,
    Deepak

    You start by reading the JVM spec.
    http://java.sun.com/docs/books/vmspec/html/VMSpecTOC.doc.html

  • How to assign a dynamic value to the value property of a button ?

    Hi Folks,
    I have a need, can i know how to assign a dynamic value to the value property of a button. Scenario is like follows...
    This is a struts based web application
    1. I have a file which consists of login user details (user name and his previlages) for a web application.
    2. I got those user details, into a List.
    3. When a user logged into the web app, in the home page there are few buttons. The type and number of buttons shown depends on the type of user/ user. (Buttons have different combination and the number of buttons available are not constant, they will vary from user to user).
    4. for each button, there will be a different action. I can pass the value of a button to an action class, but here button must have a dynamic value.
    Here is my test code:
    <%
    if (List != null)
    for (int i = 0; i <List.length; i++)
    %>
    <html:submit property="rduname" value= "<%=List%>" onclick="return submitRdu('<%=List[i] %>');"/>
    <%
    %>
    But my problem is how to assign a dynamic value to the value property of the button ( i know 'value= "<%=List[i]%>" ' will not work, just wanted show you guys).
    Thanks in advance,
    UV
    Edited by: UV_Dev on Oct 9, 2008 2:15 PM

    Let me try i know am not good at JSP but do we need double quotes here
    value= <%=List%>i think JSTL should help you about the dynamic thing                                                                                                                                                                                                                                                                                                                       

  • How to create a dynamic property in JavaFX

    public class Person() {
    private SimpleStringProperty _Name = new SimpleStringProperty();
    public final String NameGet() {
    return this._Name.getValue();
    public final void NameSet(String Name) {
    this._Name.setValue(ColumnName);
    public StringProperty NameProperty() {
    return this._Name;
    private SimpleStringProperty _SurName = new SimpleStringProperty();
    public final String SurNameGet() {
    return this._SurName.getValue();
    public final void SurNameSet(String SurName) {
    this._Name.setValue(ColumnName);
    public StringProperty SurNameProperty() {
    return this._SurName;
    How to create a dynamic property in JavaFX ?
    ObservableMap, ObservableMapValue, MapPropertyBase, MapProperty
    Which one should I use. Can you give an example?

    I'm not sure what you mean by "dynamic property"; can you be more explicit?
    Your code creates two properties that can be read, written, and observed for changes, though it's probably better to use the standard naming scheme for the methods (e.g they should be getName(), setName(...) and nameProperty()).
    An ObservableMap is an extension of the java.util.Map interface that can be observed; i.e. you can register a listener that will be notified if a key-value pair is added or removed from the map.
    ObservableMapValue is an interface that defines an observable reference to an ObservableMap; i.e. it has a get() method returning an ObservableMap and a set(...) method taking an ObservableMap. You can register a ChangeListener which is notified when the set(...) method is called. It additionally functions as an ObservableMap, so you can also register listeners that get notified when key-value pairs are added or removed from the underlying observable map.
    MapProperty and MapPropertyBase are effectively partial implementations of ObservableMapValue. SimpleMapProperty is a full implementation.
    If you just need a single ObservableMap (i.e. not an observable reference to one), then the FXCollections.observableHashMap() factory method will provide one.

  • How to design class hierarchy to make use of Bimorphic inlining

    I have a question regarding the optimum number of implementations you can have of an interface.
    I have 1 interface and 2 main implementations. All the methods except one very rarely invoked method in those two main sub-classes are frozen using final.
    interface Foo{
      void hotMethod1();
      void rarelyUsedMethod();
    class A implements Foo{
      final void hotMethod1(){.. .. ..}
      //Non final!!
      void rarelyUsedMethod(){.. .. ..}
    class B implements Foo{
      final void hotMethod1(){.. .. ..}
      //Non final!!
      void rarelyUsedMethod(){.. .. ..}
    }Then there are many (more than 20!) sub-classes of these 2 main sub-classes - dynamically generated bytecode.
    class Aee26671 extends A{
      void rarelyUsedMethod(){.. .. ..}
    class B33423 extends B{
      void rarelyUsedMethod(){.. .. ..}
    class C12ds423 extends A{
      void rarelyUsedMethod(){.. .. ..}
    and so on...All these second level sub-classes just override the rarelyUsedMethod().If in some caller method I do this:
    x(Foo foo){
      foo.hotMethod1();
    }Does the Hotspot compiler recognize that there are only 2 possible targets because A and B have their implementations marked as final?
    I've heard of Bimorphic inlining. But does it look just at candidate Sub-classes - in this case there are more than 2 sub-classes.
    Or, does it realize that the actual candidate implementations of the hot method are just 2 (A and B) because they are "final" and optimize it?
    PS: Does Hotspot do Bi or Polymorphic inlining?

    Hi Ashwin,
    as far as I understand, the bi-morphic case is really a special optimization that occurs when there are only two possible classes (not necessarily methods) involved. You can easily test that by adapting my newsletter: [Polymorphism Performance Mysteries Explained|http://www.javaspecialists.eu/archive/Issue158.html]
    Here is how I tested it:
    import java.util.Random;
    public class PolymorphismTest {
      private static final int UPTO = 100 * 1000 * 1000;
      public static void main(String[] args) throws Exception {
        int offset = Integer.parseInt(args[0]);
        Foo[] tests = generateTestData(offset);
        System.out.println("Warmup");
        test_all(tests);
        System.out.println("Actual run");
        printHeader(tests);
        test_all(tests);
      private static void test_all(Foo[] tests) {
        for (int j = 0; j < 10; j++) {
          run_tests(tests);
      public static void run_tests(Foo[] tests) {
        long time = System.currentTimeMillis();
        test(tests);
        time = System.currentTimeMillis() - time;
        System.out.print(time + "\t");
        System.out.flush();
        System.out.println();
      public static void test(Foo[] sources) {
        Foo t0 = makeRandomTest(sources);
        Foo t1 = makeRandomTest(sources);
        Foo t2 = makeRandomTest(sources);
        Foo t3 = makeRandomTest(sources);
        Foo t4 = makeRandomTest(sources);
        Foo t5 = makeRandomTest(sources);
        Foo t6 = makeRandomTest(sources);
        Foo t7 = makeRandomTest(sources);
        Foo t8 = makeRandomTest(sources);
        Foo t9 = makeRandomTest(sources);
        for (int i = 0; i < UPTO / 10; i++) {
          t0.hotMethod1();
          t1.hotMethod1();
          t2.hotMethod1();
          t3.hotMethod1();
          t4.hotMethod1();
          t5.hotMethod1();
          t6.hotMethod1();
          t7.hotMethod1();
          t8.hotMethod1();
          t9.hotMethod1();
      private static Foo makeRandomTest(Foo[] sources) {
        return sources[((int) (Math.random() * sources.length))];
      private static void printHeader(Foo[] tests) {
        System.out.print(tests[0].getClass().getSimpleName());
        System.out.print('\t');
        System.out.println();
      private static Foo[] generateTestData(int offset)
          throws Exception {
        switch (offset) {
          default:
            throw new IllegalArgumentException("offset:" + offset);
          case 0:
            return fillSources(A.class);
          case 1:
            return fillSources(A.class, B.class);
          case 2:
            return fillSources(A.class, B.class, Aee26671.class);
          case 3:
            return fillSources(A.class, B.class, Aee26671.class, B33423.class);
      private static Foo[] fillSources(
          Class<? extends Foo>... fooClasses)
          throws Exception {
        Foo[] sources = new Foo[1000];
        Random rand = new Random(0);
        for (int i = 0; i < sources.length; i++) {
          int offset = Math.abs(rand.nextInt() % fooClasses.length);
          sources[i] = fooClasses[offset].newInstance();
        return sources;
    }On my machine, the results are as follows:
    1 class: average=0, stdev=0
    2 classes: average=103, stdev=4
    3 classes: average=672, stdev=26
    4 classes: average=666, stdev=0.4
    As I thought, the bi-morphic optimization is only applied on a class instance basis, rather than a method basis.
    More information in my newsletter: [Polymorphism Performance Mysteries Explained|http://www.javaspecialists.eu/archive/Issue158.html]
    Regards
    Heinz

  • Loading Jar classes dynamically - 10 Duke points

    How can I load a jar class dynamically if it relies on say other interface? Example is, if I have three classes read from the jar file, Test.class, Test1.class and Testable.class
    and "class Test implements Testable..."
    If I load the Test.class, how do I tell my own class loader that Testable class is along the way, instead of getting a java.lang.NoClassDefFoundError: Testable
    Need example source that works for this type of problem.
    Cheers
    Abraham Khalil

    protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {     
    name = name.replace('/', '.').replace('\\', '.');
    try { 
    // check if system class
    return findSystemClass(name);
    catch (ClassNotFoundException e) {}
    catch (NoClassDefFoundError e) {}
    // check if class already loaded
    Class cl = null;
    JarClassEntry jarEntry = (JarClassEntry) classes.get(name);
    if (jarEntry != null) { // new class not loaded
    // load class bytes--details depend on class loader
    byte[] classBytes = loadClassBytes(name);
    if (classBytes == null) {
    throw new ClassNotFoundException(name);
    String className = name;
    if (className.endsWith(".class")) {
    className = className.substring(0, className.indexOf(".class"));

  • How to load classes at ejb module deployment

    Hi,
    Can someone tell me how to loaded a class when I deploy an ear module (the class is in the ear) ?
    Thanks in advance.
    Fred.

    Hi Fred,
    Can you explain your question a bit more? Are you asking how to do
    dynamic class loading for your application or just how to package
    classes appropriately?
    --ken                                                                                                                                                                                                                                                                                                                                                               

  • How to create a Dynamic Datatable with sorting functioanlity

    Hi,
    I am new to JSF and need some help can some one please tell me how to create a dynamic datatable with sorting functionality. I am reading data data from a database table and wants to build the datatable dynamically based on the columns returned. I know how to created a datatble with a fixed number of columns but can't figure out how to create a datatable dynamically with sort functionality. Any small example will help.
    Thanks

    Hi,
    Here is what I have so far and can't figure out how to add the sorting functionality. Any help is appreciated.
    Managed Bean:
    private List<MyDto> data ;
        public HtmlDataTable getDataTableOne ()
            if ( dataTableOne == null )
                populateCheckBoxes () ; // Preload.
                populateDynamicDataTableOne () ;
            return dataTableOne ;
        public void populateCheckBoxes ()
            data = new ArrayList<MyDto> () ;
            MyDto myDto1 = new MyDto () ;
            MyDto myDto2 = new MyDto () ;
            MyDto myDto3 = new MyDto () ;
            MyDto myDto4 = new MyDto () ;
            myDto1.setChecked ( true ) ;
            myDto1.setValue ( "myDto1" ) ;
            myDto2.setChecked ( false ) ;
            myDto2.setValue ( "myDto2" ) ;
            myDto3.setChecked ( false ) ;
            myDto3.setValue ( "myDto3" ) ;
            myDto4.setChecked ( true ) ;
            myDto4.setValue ( "myDto4" ) ;
            data.add ( myDto1 ) ;
            data.add ( myDto2 ) ;
            data.add ( myDto3 ) ;
            data.add ( myDto4 ) ;
        public void populateDynamicDataTableOne ()
            dataTableOne = new HtmlDataTable () ;
            UIOutput header = new UIOutput () ;
            header.setValue ( "" ) ;
            UIColumn tableColumn ;
            tableColumn = new UIColumn () ;
            HtmlOutputText textHeader = new HtmlOutputText () ;
            textHeader.setValue ( "" ) ;
            tableColumn.setHeader ( textHeader ) ;
            HtmlSelectBooleanCheckbox tCheckBox = new HtmlSelectBooleanCheckbox () ;
            tCheckBox.setValueBinding ( "value" , FacesContext.getCurrentInstance ().getApplication ().createValueBinding ( "#{row.checked}" ) ) ;
            tableColumn.getChildren ().add ( tCheckBox ) ;
            // Set output.
            UIOutput output = new UIOutput () ;
            ValueBinding myItem = FacesContext.getCurrentInstance ().getApplication ().createValueBinding ( "#{row.value}" ) ;
            output.setValueBinding ( "value" , myItem ) ;
            // Set header (optional).
            UIOutput header2 = new UIOutput () ;
            header2.setValue ( "" ) ;
            UIColumn column = new UIColumn () ;
            column.setHeader ( header2 ) ;
            column.getChildren ().add ( output ) ;
            dataTableOne.getChildren ().add ( tableColumn ) ;
            dataTableOne.getChildren ().add ( column ) ;
    MyDto.java
    public class MyDto
        private Boolean checked;
        private String value;
        public MyDto ()
        public void setChecked ( Boolean checked )
            this.checked = checked;
        public Boolean getChecked ()
            return checked ;
        public void setValue ( String value )
            this.value = value;
        public String getValue ()
            return value ;
    JSP
    <h:dataTable id="table" value="#{myRequestBean.data}" binding="#{myRequestBean.dataTableOne}" var="row" />Thanks

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • How to set up Dynamic Variants for job which is based on Pay Period

    Hi,
    We need to set up dynamic variant for payroll interface.  This interface is based on Pay periods and that is why we need to use different variant for each month.  Letus know how to set up dynamic variant which will take care of Pay Periods

    Hi,  Thnx for reply.
    We are not changing the control records, current period will be some old period in system. 
    payroll is not processed in SAP,

  • How to know the dynamic values for this :AND category_id_query IN (1, :3, )

    Hi Team,
    R12 Instance :
    Oracle Installed Base Agent User Responsibility --> Item Instances -->
    Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
    In the above page there are two table regions.
    Notes.
    -------------------------------------Table Region---------------------------
    Attachments
    -------------------------------------Table Region---------------------------
    --the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
    I want to know what are the document types are displayed in this page ?
    --We developed a custom program to attach the attachments to the  services contracts and the above seeded OAF page displays those ..as needed.
    But after recent changes..the Attachments--> table region is not showing the attachments.
    I have verified the query..and could not find any clue in that..
    but i need some help if you guys can provide..
    SELECT *
    FROM
    *(SELECT d.DOCUMENT_ID,*
    d.DATATYPE_ID,
    d.DATATYPE_NAME,
    d.DESCRIPTION,
    DECODE(d.FILE_NAME, NULL,
    *(SELECT message_text*
    FROM fnd_new_messages
    WHERE message_name = 'FND_UNDEFINED'
    AND application_id = 0
    AND language_code  = userenv('LANG')
    *), d.FILE_NAME)FileName,*
    d.MEDIA_ID,
    d.CATEGORY_ID,
    d.DM_NODE,
    d.DM_FOLDER_PATH,
    d.DM_TYPE,
    d.DM_DOCUMENT_ID,
    d.DM_VERSION_NUMBER,
    ad.ATTACHED_DOCUMENT_ID,
    ad.ENTITY_NAME,
    ad.PK1_VALUE,
    ad.PK2_VALUE,
    ad.PK3_VALUE,
    ad.PK4_VALUE,
    ad.PK5_VALUE,
    d.usage_type,
    d.security_type,
    d.security_id,
    ad.category_id attachment_catgeory_id,
    ad.status,
    d.storage_type,
    d.image_type,
    d.START_DATE_ACTIVE,
    d.END_DATE_ACTIVE,
    d.REQUEST_ID,
    d.PROGRAM_APPLICATION_ID,
    d.PROGRAM_ID,
    d.category_description,
    d.publish_flag,
    DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
    d.URL,
    d.TITLE
    FROM FND_DOCUMENTS_VL d,
    FND_ATTACHED_DOCUMENTS ad
    WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
    *) QRSLT*
    WHERE ((entity_name    ='OKC_K_HEADERS_V'-- :1
    AND pk1_value          IN ( 600144,599046) --:2
    AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    AND datatype_id       IN (6,2,1,5)
    AND (SECURITY_TYPE     =4
    OR PUBLISH_FLAG        ='Y')))
    --='000180931' -- 'ADP118'
    The above seeded query is the one which is used for table region to retrieve the data..
    how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    --Sridhar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Patricia,
    is it working for restricted key figure and calculated key figure ??
    Note Number Fisc Period Opening Days
    1 1 2
    2 1 3
    3 1 0
    because I have other restriction, so I create two restricted key figure..
    RK1  with restriction :  Total Number of Note,
    RK2  with restriction :  Total Opening Days ,
    then I Created a calculated key figure, average opening days in a period
    CK1 = RK2 / RK1..
    in this case, I am not sure if it will work or not..
    for example, during RK2 calclation, it might be this   2+3 = 5, the line with 0 will be ignored..
    during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
    could you please confirm..

  • How do I use dynamic JSP vars in a form tag with implicit sessions?

    I'm using iAS 6 SP4 and 'lite' sessions w/ sticky LB on Win2K for development and need to use a dynamic variable (via an = scriptlet) to specify the URL a form tag's ACTION method posts to. The implicit URL session encoding attempts to add the hidden input tags to the form but part of it is getting cut off. If I remove the dynamic var scriptlet from the form tag it works fine. How can I use dynamic vars and implicit URL session encoding?
    Here's my code sample:
    <FORM NAME='Create' METHOD='POST' ACTION='<%= servletRootStr %>CreateServlet' TARGET='_top'>
    Output is:
    <FORM NAME='Create' METHOD='POST' ACTION='http://my.server.com/NASApp/WebStuffApp/Create' TARGET='_top'>T NAME="GXHC_gx_session_id_" TYPE="HIDDEN" VALUE="GXLiteSessionID--8351372849698357580" ></INPUT><INPUT NAME="GXHC_GX_jst" TYPE="HIDDEN" VALUE="d692bc3d662d6164" ></INPUT>
    Because the <INPUT> tagon the first session var is cut off, up to the T, the page obviously fails. Can this be fixed with a config setting, or is it a bug in iPlanet??

    Thanks for helping me Anurag.
    The problem I tried to solve was that I want the result from my service methods
    in XML format. I thought a callback/polling was the best alternative, am I right?
    Since the callback option doesn´t work I will try to poll the service.
    Are there any other options for solving my problem??
    Thanks again!!
    /A
    "Anurag Pareek" <[email protected]> wrote:
    >
    Andrej,
    I guess you are trying to invoke a Webservice which defines a callback
    method
    from a JSP, and want the JSP to handle the callback made by the webservice.
    For a client to be able to handle a callback made by a Webservice, it
    has to be
    a web service in itself.
    Even some web service tools do not support 'Solicit responses' and hence
    they
    would not generate handlers for the callback methods by default. You
    can download
    a callback WSDL in such cases and implement it on the client side. The
    server
    side web service will then callback to that webservice.
    The other option to callbacks is to use polling methods. This can be
    done from
    any client such as Java client/ JSP client or a .NET client.
    Hope this helps. Let me know if you have any further questions.
    Regards,
    Anurag
    "Andrej" <[email protected]> wrote:
    I´ve tried this but with no success..
    How do I recieve the data in a servlet/JSP-page?
    Thanks.

Maybe you are looking for

  • Calling a WebServices From Java Stored Proc fails with Connection refused

    I have followed the example in Note:220662.1 on Metalink step by step. I am using two windows machines (2000 SP4). I have Oracle 9.2.0.5 EE on one of them and OC4J 9.0.4 standalone on the other(running on JVM 1.4.2_05-b04). The 2 servers "see" each o

  • Can print PS file but not make PDF

    Printing to a PostScript printer with a customized PostScript driver in WordPerfect 5.1 for DOS is what we do every day, but when we print the same job to a PS file we can't make a PDF in Adobe Acrobat Pro 9.4. What can we do to make a PDF? Here is t

  • Automatic creation of PR after MRP run

    Hi, can anyone please tell me what all fields are picked up in a Purchase Requisition(PR) in the scenario of automatic creation of PR after MRP run. If we are using more than 1 PR type in the system how is it determined during the MRP run that the PR

  • Restrict selection screen when using logical Database(HR ABAP)

    Hi,       I'm using <b>PNP</b> logical Database in my         report program. I want to restrict the deafult       selection screen.       Pls suggest me if knows. Kind regards, - Selva

  • Creating Variables in BI Publisher

    Hi All, We have created columns in BI Answers using "case when" statements, is the same possible in BI Publisher. ie, Can we use "Case when" in BI Publisher, If yes, Please let me know on how to create columns using formulae in BI Publisher? Thanks i