I created an Application based on JavaBeans but with an error

Started JavaBeans today.

Ended up with an error at the end of the day..

May be I m still missing something

 

The program uses a simple java beans under a package. I used a jsp page to pass value to the bean and it to display its content.

 

Here goes the code:

//SimpleBean.java file name

 

Class file for bean

package mybeans;

 

 

class SimpleBean {

                private String message;

               

                public void setMessage(String input)

                {

                                message=input;

                }                             

                public String getMessage()

                {

                                return message;

                }

}

 

Jsp file code

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

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

<title>Using Simple Bean</title>

</head>

<body>

Lets see if it works

 

<jsp:useBean id="msg" class="mybeans.SimpleBean" />

<jsp:setProperty name="msg" property="message" value="Saying Hellllllllo" />

<jsp:setProperty name="msg" property="message" value="With JavaBean" />

<jsp:getProperty name="msg" property="message" />

 

</body>

</html>

 

Directory structure that I used…

 

simplebean.jsp in the Tomcat\webapps\ROOT directory

 

simpleBean.java, SimpleBean.class were placed in the followind directory structure : Tomcat\classes\mybeans

 

..

But the execution of the code gave an error message…

Oh bad luck

 

Guess xml mapping not done..

Will have to check it out and see how to fix a java bean error.

 

 

Out from the coding world…

Earlier today, I woke up at 1 pm. Ah it feel so good.

 

Got to work hard

Catch you soon.

Let see if there is a solution for this error.

 

Love Marshall

Comments

Popular posts from this blog

I feel shame for Facebook Groups like "Growing INDIA, Growing Ourselves & making INDIA a better place to live in". They are capitalizing the Delhi Rape Case. Read how dirty is the Indian Politics where They ignore a Rape in Gujrat under Modi rule and Blame ladies like Sheila Dixing and Sonia for rapes. Stay Alert my Friends

Unwanted spam calls from +91-731-xxx-xxx