This was my line in demo.jsp demo
Hello there!!! The time is <%= new java.util.Date()%>
which when i opened in firefox doesn't show the time. instead displays the same line: "The time is <%= new java.util.Date()%>"
This was my line in demo.jsp demo
Hello there!!! The time is <%= new java.util.Date()%>
which when i opened in firefox doesn't show the time. instead displays the same line: "The time is <%= new java.util.Date()%>"
It looks like you're putting <%= new java.util.Date()%> in the wrong place, and it is being treated as text rather than code, it should look something like this:
<td width="100%"><b> Current Date
and time is: <font color="#FF0000">
<%= new java.util.Date() %>
</font></b></td>
If you post a code sample, it'll help a lot.
Some examples here too: http://www.roseindia.net/jsp/jsp_date_example.shtml
Dave
I'm assuming that your JSPs are compiling.
The <%= %> notation implicitly invokes the instance's toString() method. Since constructors in Java don't return a reference to the newly created instance, you're trying to do this:
new java.util.Date().toString() //! illegal
Try this instead:
<% java.util.Date now = new java.util.Date() %>
<%= now %>