Skip to Content
avatar image
Former Member

How to create Array parameters of native types?

I want to create a method in my controller that accepts a parameter of type byte[]. Problem is the array checkbox only enables when I have a Java Class as the data type. Why is that?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 26, 2007 at 03:01 AM

    Hi Tom,

    This is as designed. If you want to use the arrays of native Type, please use corresponding wrapper class.

    e.g. for byte use java.lang.Byte, for int use Integer.

    Regards,

    Ashwani Kr Sharma

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 26, 2007 at 02:34 AM

    Hi ,

    In controller java file in the end there is a block

    //@@begin others

    //@@end

    You can directly declare your method in this block.

    and if you want to use this method in some other controller then create a method in this controller which calls it.

    Feel free to ask queries.

    Regards,

    Praveen

    Message was edited by:

    Praveen Kumar Pandey

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 26, 2007 at 02:56 AM

    Hi Tom,

    This is not possible when you are trying to create methods using the method tab in controllers.

    Similary You might have noticed that <b>throws</b> clause is also not possible.

    If you need to declare some thing like this you need to declare the method in the code editor between the area mentioned below

    /*The following code section can be used for any Java code that is

    not to be visible to other controllers/views or that contains constructs

    currently not supported directly by Web Dynpro (such as inner classes or

    member variables etc.).

    Note: The content of this section is in no way managed/controlled

    by the Web Dynpro Designtime or the Web Dynpro Runtime. */

    //@@begin others

    // create your method here

    public void test(String arr[])

    {

    }

    //@@end

    Regards

    Ayyapparaj

    Add comment
    10|10000 characters needed characters exceeded