Before check if it's duplicate, I just checked these questions: How do I convert [[Ljava.lang.String;@7defb4fb] to a String and Why does println(array) have strange output? ("[Ljava.lang.String;@3e25a5")
Well, when my action method it's called on debug mode, I have something like this:
RenderBandejasForm bandejaForm = (RenderBandejasForm) form;
String [] ts = bandejaForm.getTareasSeleccionadas();
The problem comes when I try to iterate this, ts value is something like [Ljava.lang.String;@64c064c
, so, how I'm suppose to loop this?
I tried to get something in outputs like:
System.out.println(Arrays.toString(ts));
getting the same weird output: [Ljava.lang.Long;@64c064c
I tried to loop through it too:
for (String temp : ts){
String test1 = temp;
}
the string test1 shows something different [Ljava.lang.Long;@differentNumbers
I think that I'm making calls to the memory object, and not calling the array right?
edited:
The method getTareasSeleccionadas() should print a String array, something like this: [66344,66345,66553] but I always get that output [Ljava.lang.Long;@64c064c
edited 2: Here is all the code of the function that I have:
/**
* Elimina una o más tareas.
*/
public ActionForward eliminarTareas(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
RenderBandejasForm bandejaForm = (RenderBandejasForm) form;
String [] ts = bandejaForm.getTareasSeleccionadas();
//here I start my tests
for (String temp : ts){
String test1 = temp;
}
String test2 = Arrays.deepToString(ts);
String test3 = Arrays.toString(ts);
//Here I finish'em
return this.bandeja(mapping, bandejaForm, request, response);
}