I am trying to do following:
get the date format by:
SimpleDateFormat sdf = (SimpleDateFormat)SimpleDateFormat.getDateInstance(DateFormat.SHORT, request.getLocale());
String myFormat = sdf.toLocalizedPattern();
System.out.println("myFormat inside Action is:"+ myFormat);
it gives me the format suppose:M/d/yy
I do this in
jsp.
Now I need to get the format got on jsp into my action class. How do i access it in my Action class?
If I say:
request.setAttribute("myDateFormat_fromReq",myDateFormat_fromReq);
on my jsp and say:
tring myDateFormat_fromReq1 = (String)request.getAttribute("myDateFormat_fromReq");
in my Action class, it gives me null for this value got from the request.
What's wrong? any suggestions?