GTU WTAD Practical 27 : jsp usebean example

GTU WTAD Practical 27 :   You want to reduce the amount of Java coding in your JSP using a JavaBean component. (Hint:  Use useBean with the name of your bean).

GTU WTAD Practical 27

This Program Explain how to use JavaBeans in your regular jsp code. Here i have taken simple example to demonstrate use of JavaBeans.

Jump to GTU WTAD Practical 28

File Name : index.jsp

File Location : Tomcat_Apache\webapps\gtu27\

<html>
	<head>
		<title>GTU WTAD Practical 27</title>
	</head>
	<body>
	
	<h2 align="center"> GTU WTAD Practical 27 :   You want to reduce the amount of Java coding in your JSP using a JavaBean component. (Hint:  Use &ltjsp:useBean&gt with the name of your bean).   </h2>
	<br><br>
	
	<jsp:useBean id="date" class="java.util.Date" /> 
	
	<h2>Todays Date is : <font color="red"> <%= date %> </font> </h2>


	</body>
</html>

 

 Output

GTU WTAD Practical 27

 

Leave a Reply