Exam 1z0-900 All QuestionsBrowse all questions from this exam
Question 23

Which two approaches would result in the current date being added to the output of a JSP? (Choose two.)

    Correct Answer: B, C

    To include the current date in the output of a JSP, you need to use either a scriptlet or an expression that correctly generates and prints the date. The option <% out.printIn(new java.util.Date()); %> uses a scriptlet to print the date and is a correct approach. The option <%= new java.util.Date() %> uses an expression that evaluates and prints the date, making it another correct approach. Other options contain errors such as incorrect methods or outputting to the console instead of the JSP output stream.

Discussion
ciellaf5Options: BC

Correct B,C

devmsalehOptions: BC

Correct is B,C

pedrolima

I've tested A. aproach and does not work in https://www.onlinejspcompiler.com/compileJSP

orjavaOptions: BC

Answer - B, C ... D prints in console and A not works