0

i have a string array like

String[] resultYears = {"2013/07", "2013/08", "2013/09", "2013/10", "2013/11", "2013/12", "2014/01"};

when i get this through response in my jsp,

<% String[] resultYears = (String[]) request.getAttribute("resultYears");%>

i am getting the remainders of their respective values. How can i get same as above string value?

Ankur Shanbhag
  • 7,746
  • 2
  • 28
  • 38

3 Answers3

1

Try this way in your JAVA Class

String[] resultYears = {"'2013/07'", "'2013/08'", "'2013/09'", "'2013/10'", "'2013/11'", "'2013/12'", "'2014/01'"};
request.setAttribute("resultYears", resultYears);
Naveen Kumar Alone
  • 7,536
  • 5
  • 36
  • 57
0

Try the strings using single quotes like this

"'2013/08'"
msfk
  • 137
  • 1
  • 15
0

How about instantiating a Date object with the YYYY/MM desired and do a .getTime() on it, then pass that through the request in String value. On the far end, translate it back into a pretty, human readable format.

Lurk21
  • 2,307
  • 12
  • 37
  • 55