by Dinesh Thakur Category: JSP Elements

When we send any request to the JSP program from the browser window, we pass the request URL in the browser window. In this process to send the data along with the request, the programmer also requires adding the query string to request URL explicitly. But this task is highly of technical. For that a graphical user interface is required which can generate a request which mayor may not hold the data. For this purpose, the programmer can use either HTML form or hyperlink to generate the request with or without data. The example of HTML to JSP communication is given below:




    <title>HTML TO JSP COMM</title>



  <font color="blue" size="8"><b>Date & Time is :</b></Font></center>

  <h3 align="center"><%java.util.Date d=new java.util.Date();out.println(d.toString());%>




     Html To JSP Communication

Explanation of the above program

In order to display the date and time within the scriptlet tag (<%-------%>) we use the Date class, which prints the current date and time in the browser window. This Date class present in the util package, that's why it needs to be imported.

<% java.util.Date d=new java.util.Date();

out.println(d.toString()) ;%>

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.