Which two approaches would result in the current date being added to the output of a JSP? (Choose two.)
Which two approaches would result in the current date being added to the output of a JSP? (Choose two.)
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.
Correct B,C
Correct is B,C
I've tested A. aproach and does not work in https://www.onlinejspcompiler.com/compileJSP
Answer - B, C ... D prints in console and A not works