×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: ActionScript
Posted by: Shafiqul Islam
Added: Jan 15, 2022 6:52 AM
Views: 389
Tags: no tags
  1. <%--
  2.     Document   : usebean
  3.     Created on : Jan 14, 2022, 10:46:57 PM
  4.     Author     : Shafiqul Islam
  5. --%>
  6.  
  7. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  8. <!DOCTYPE html>
  9. <html>
  10.     <head>
  11.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  12.         <title>JSP Page</title>
  13.     </head>
  14.     <body>
  15.         <h1> Use bean Example</h1>
  16.         <jsp:useBean id="useBean" class="usebean.MessageBean" scope="request"></jsp:useBean>
  17.         Initial message using jsp:getProperty: <br></br>
  18.         <jsp:getProperty name="useBean" property="message"></jsp:getProperty> <br></br>
  19.         Initial message using jsp expressiong:<br></br>
  20.         <%= useBean.getMessage()%>
  21.         <jsp:setProperty name="useBean" property="message" value="New Message2022"></jsp:setProperty> <br></br>
  22.         Message using after setting message: <br></br>
  23.         <jsp:getProperty name="useBean" property="message"></jsp:getProperty> <br></br>
  24.         Message using By jsp expression after setting message: <br></br><!-- comment -->
  25.         <%= useBean.getMessage() %> <br></br><!-- comment -->
  26.         <% useBean.setMessage("message set using  jsp express"); %>
  27.         <%= useBean.getMessage()%>
  28.    
  29.        
  30.     </body>
  31. </html>
  32.