Example & Tutorial understanding programming in easy ways.

What is Scriptlet tag? Explain with example?.

The scriptlet tag is used to write java class statements inside the jspService() method. In other words, writing java code in a Java Server Page is done through scriptlet tag. A scriptlet tag starts with <% and ends with %>.

example:  insert the following codes between the <body> tags.

<%

// This scriptlet declares and initializes "date"

System.out.println( "Evaluating date now" );

java.util.Date date = new java.util.Date();   %>

The time is now:

<%    // The following scriptlets generate HTML output

out.println( String.valueOf( date ));

out.println( "<br>Your machine's address is: " );

out.println( request.getRemoteHost()); %>

Read More →
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!