Which EL code snippet will generate the string for the previous week?

You are building a web application with a scheduling component. On the JSP, you need to show
the current date, the date of the previous week, and the date of the next week. To help you
present this information, you have created the following EL functions in the ‘d’ namespace:
name: curDate; signature: java.util.Date currentDate()
name: addWeek; signature: java.util.Date addWeek(java.util.Date, int)
name: dateString; signature: java.util.String getDateString(java.util.Date)
Which EL code snippet will generate the string for the previous week?

You are building a web application with a scheduling component. On the JSP, you need to show
the current date, the date of the previous week, and the date of the next week. To help you
present this information, you have created the following EL functions in the ‘d’ namespace:
name: curDate; signature: java.util.Date currentDate()
name: addWeek; signature: java.util.Date addWeek(java.util.Date, int)
name: dateString; signature: java.util.String getDateString(java.util.Date)
Which EL code snippet will generate the string for the previous week?

A.
${d:dateString(addWeek(curDate(), -1))}

B.
${d:dateString[addWeek[curDate[], -1]]}

C.
${d:dateString[d:addWeek[d:curDate[], -1]]}

D.
${d:dateString(d:addWeek(d:curDate(), -1))}

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *