Solved

Problems running a simple Hello World JSP/Bean

Posted on 2007-12-01
1
818 Views
Last Modified: 2013-12-15
I am trying to teach myself some JSP to see about redoing our company website sometime down the road.  I have installed apache tomcat and tested it with a simple servlet which ran fine.  Next I wanted to make a trial JSP page that uses a java bean to say hello world -- looked at a few tutorial and I cam up with this:

Java Structure:
Project Test
package my
Java file TestBean.java (code included below)
JSP file BeanTester.jsp (code included below)

I am using Jbuilder Turbo (eclipse based) IDE.  

I compile the file as  a war and deploy it to tomcat like I did the servlet which worked fine.

the resultant page that I get back is entirely blank -- I will post the source below as well.
I am not sure what I am doing wrong -- if it is tomcat that is set up wrong, the code is wrong somehow, or something else that I haven't even thought of.  
TestBean.java code:
 

package my;
 

public class TestBean {

	private String greeting = "Hello Wiorld";

	public String getWelcome(){

		return greeting;

	}

}

________________________________________________________________

JSP code 
 

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

    pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
 

<head>

	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

	<title>Insert title here</title>	

</head>
 

<body>

<jsp:useBean id="testBean" class="my.TestBean" />

  <h1> <c.out value="${testBean.welcome}" /> </h1>

</body>

</html>

_______________________________________________________________

source page when I run http://localhost:8080/test/BeanTester.jsp
 
 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
 

<head>

	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

	<title>Insert title here</title>	

</head>
 
 
 

<body>
 

  <h1> <c.out value="Hello Wiorld" /> </h1>

</body>

</html>

Open in new window

0
Comment
Question by:VoodooFrog
1 Comment
 
LVL 26

Accepted Solution

by:
mrcoffee365 earned 500 total points
Comment Utility
<c.out value="Hello Wiorld" />

should be

<c:out value="Hello Wiorld" />


0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now