You can't use out.println() to display the value in the input text. It's a bit different from a language like php where you can just embed the PHP script inside HTML. You need to use <%= someObject.getCurrentDateTime() %>. Remember, there's an equal sign after the percentage sign and there's no semicolon. Scriptlet is rarely used nowadays and it's considered a bad practice to use it.