cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Array parameters of native types?

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

former_member186016
Active Contributor
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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

former_member485701
Active Participant
0 Kudos

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