473,320 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Need some basic help with javabean

Maybe someone can help me with this--I'm pulling my hair out over it and
don't have much to spare :)

I'm trying to learn javabeans & jsp, I'm just getting started with it, and
all I want to do is create a simple bean that will display some text on a
JSP.

Here's the bean:

C:\Tomcat\webappsROOT\WEB-INF\classes\movie
---------------------------------
package movie;
public class MovieBean
{
private String title;
public MovieBean() { this.title="Some Movie"; }
public String getTitle() { return this.title; }
public void setTitle(String title) { this.title = title; }
}

This should work, shouldn't it? getTitle is the accessor for the Title
property?

Here's the JSP:

C:\Tomcat\webappsROOT
---------------------
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<%@ page import="movie.*" %>
<jsp:useBean id="movie" class="movie.MovieBean"/>
<head>
<title>TestMovie Bean</title>
</head>
<body>
<h3>
<jsp:getProperty name="movie" property="Title"/>
</h3>
</body>
</html>

So all I want it to do is display "Some Movie". When I run it, I get:

Cannot find any information on property 'Title' in a bean of type
'movie.MovieBean'

This doesn't seem like a problem finding the bean, or is it? I'm able to run
other JSPs and servlets that don't use beans. I also tried putting the bean
in c:\tomcat\shared\classes\movie. I keep looking at it for some silly typo.
Or maybe my understanding of javabeans is totally flawed, and I shouldn't be
able to use it like this?

I'd appreciate any ideas, thanks!

--Doug

p.s. Tomcat 5.5.4

Jul 17 '05 #1
2 2387
Replace
<jsp:getProperty name="movie" property="Title"/>
with
<jsp:getProperty name="movie" property="title"/>

Doug Lowe ÐÉÛÅÔ:
Maybe someone can help me with this--I'm pulling my hair out over it and
don't have much to spare :)

I'm trying to learn javabeans & jsp, I'm just getting started with it, and
all I want to do is create a simple bean that will display some text on a
JSP.

Here's the bean:

C:\Tomcat\webappsROOT\WEB-INF\classes\movie
---------------------------------
package movie;
public class MovieBean
{
private String title;
public MovieBean() { this.title="Some Movie"; }
public String getTitle() { return this.title; }
public void setTitle(String title) { this.title = title; }
}

This should work, shouldn't it? getTitle is the accessor for the Title
property?

Here's the JSP:

C:\Tomcat\webappsROOT
---------------------
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<%@ page import="movie.*" %>
<jsp:useBean id="movie" class="movie.MovieBean"/>
<head>
<title>TestMovie Bean</title>
</head>
<body>
<h3>
<jsp:getProperty name="movie" property="Title"/>
</h3>
</body>
</html>

So all I want it to do is display "Some Movie". When I run it, I get:

Cannot find any information on property 'Title' in a bean of type
'movie.MovieBean'

This doesn't seem like a problem finding the bean, or is it? I'm able to run
other JSPs and servlets that don't use beans. I also tried putting the bean
in c:\tomcat\shared\classes\movie. I keep looking at it for some silly typo.
Or maybe my understanding of javabeans is totally flawed, and I shouldn't be
able to use it like this?

I'd appreciate any ideas, thanks!

--Doug

p.s. Tomcat 5.5.4

Jul 17 '05 #2
Thanks...that did the trick, I knew it was just some little detail like
that.

--Doug

"Igor Kolomiyets" <li**@inksystems.net> wrote in message
news:Zz*******************@news.indigo.ie...
Replace
<jsp:getProperty name="movie" property="Title"/>
with
<jsp:getProperty name="movie" property="title"/>

Doug Lowe ÐÉÛÅÔ:
Maybe someone can help me with this--I'm pulling my hair out over it and
don't have much to spare :)

I'm trying to learn javabeans & jsp, I'm just getting started with it, and all I want to do is create a simple bean that will display some text on a JSP.

Here's the bean:

C:\Tomcat\webappsROOT\WEB-INF\classes\movie
---------------------------------
package movie;
public class MovieBean
{
private String title;
public MovieBean() { this.title="Some Movie"; }
public String getTitle() { return this.title; }
public void setTitle(String title) { this.title = title; }
}

This should work, shouldn't it? getTitle is the accessor for the Title
property?

Here's the JSP:

C:\Tomcat\webappsROOT
---------------------
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<%@ page import="movie.*" %>
<jsp:useBean id="movie" class="movie.MovieBean"/>
<head>
<title>TestMovie Bean</title>
</head>
<body>
<h3>
<jsp:getProperty name="movie" property="Title"/>
</h3>
</body>
</html>

So all I want it to do is display "Some Movie". When I run it, I get:

Cannot find any information on property 'Title' in a bean of type
'movie.MovieBean'

This doesn't seem like a problem finding the bean, or is it? I'm able to run other JSPs and servlets that don't use beans. I also tried putting the bean in c:\tomcat\shared\classes\movie. I keep looking at it for some silly typo. Or maybe my understanding of javabeans is totally flawed, and I shouldn't be able to use it like this?

I'd appreciate any ideas, thanks!

--Doug

p.s. Tomcat 5.5.4

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Nikita A. Visnevski | last post by:
Hi everyone, I am rather new to Java beans. Just picked up a book last night and started reading about them. I am building an application that allows a user to define objects with dynamic...
1
by: Alex | last post by:
Hi all- I am having a little trouble storing resultset data from a javabean into an array located in a JSP page. Any other approaches, advice or links to information would be appreciated. Thanks...
1
oll3i
by: oll3i | last post by:
Cd u please give me the example of javabean with constrained values thank u
1
by: l-EE | last post by:
If I'm writting a bean - and I mean just a plain old Java Bean not an EJB or anything like that - is there any merit to seperating the interface out of the class? I do this with pretty much every...
3
by: AnithaTolgiri | last post by:
My question is how to sort a javabean on the basis of two fields. I have to create a javabean and then sort it by some String type field and then by another String type field.When I sort it for the...
1
by: mattmao | last post by:
Generally speaking, JSP and servlet are equivalent. I found one strange question: I've created a JavaBean class called UserinfoBean.class and put it inside /WEB-INF/classes/uts/ait/cmao/ It...
4
by: robtyketto | last post by:
Greetings, I've got my head spinning with some very simple java coding, Im a newbie to Java and utilising the code below for a javabean for some jsp Im working on. The problem is my code I've...
4
by: robtyketto | last post by:
Greetings, I'm a newbie to Java and I cant quite get my head around why it seems most integers appears to be formatted as strings and then later have to be parsed. The code below, passes in the...
2
by: devgupta01 | last post by:
Can I use formbean in place of javabean in struts framework..? Can you please explain difference between JavaBean and FormBean? Thanks in advance....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.