Java Programming Projects
Servlets - Java Server Pages
The following lines show simple examples of dynamic content generated by jsp tags. Parts of the tags are shown below the examples.
This page, with its .jsp extension, is the source for a web application, which is compiled as a war and deployed on a Glassfish server.
As with all the other examples, the page style is consistent with the rest of the site and html code allows for navigation between Glassfish and non-Glassfish pages.
Dynamically calculate the length of a stringUsing the jsp standard tag library we can take the entered string and calculate the number of characters in it.
String: Enter your text here!
String Length: 21
The date today is: Tue Aug 03 07:56:48 UTC 2021
<%= (new java.util.Date())%>
Show network data
Your IP address is: 18.104.22.168
<% out.println(request.getRemoteAddr()); %>