Monday, 22 October 2018

Show / Print a variable value in input type field in Servlet.

Generally in Servlet we use HTML in Java (Java --->HTML), but in above we have to write Java ----> HTML -----> Java. So, we can write this in following manner

A simple Sevlet code can be like -

out.println("<table border='1' cellspacing='3' cellpadding='2'>");

If we want double quote instead of single quote in HTML properties value then code will be -

out.println("<input type=\"hidden\" name=\"place\" value=\"any value\">");

And finally when we want any variable value in value property of input type, then code will be -

out.println("<input type=\"hidden\" name=\"place\" value=\""+ variable +"\">");

No comments:

Post a Comment

Change image source dynamically on hyperlink

 Changing image source dynamically using JQuery. Here in this example I have created there hyperlink and stored all images in the same folde...