Home Jsp Create a greeting in jsp
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Create a greeting in jsp

Advertisement
This is sample jsp code that creates a sample Birthday Greeting in jsp. In the code given below we have used an image with some text message.

Create a greeting in jsp

     

This is sample jsp code that creates a sample Birthday Greeting in jsp. In the code given below we have used an image with some text message. To show image we have used a html tag <img src="" alt="">. Here 'alt' attribute is used to set the text message which is shown if image can not be shown for any reason.

 

 

 

 

 

greeting_jsp.jsp

<HTML>
  <HEAD>
    <TITLE>Creating a Greeting</TITLE>
  </HEAD>
  <BODY bgcolor="#F8E0F7">
    <H1><Font color="#088A08">B'Dy Greeting only 4 u.....</Font></H1>
	 <img src="funny.gif" alt="Big Boat">
	 <br>
	 <b>created by: </b>
	  <%
	        //Display the greeting
		out.println("www.roseindia.net");
		
     %>        
  </BODY>
</HTML> 

Save this code as a .jsp file named "greeting_jsp.jsp" in your application directory ('user' in our example) in tomcat and run this jsp page with url http://localhost:8080/user/greeting_jsp.jsp in address bar of the browser.

Download Source Code

Advertisement

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 11, 2008

Ask Questions?    Discuss: Create a greeting in jsp   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com