pal sahab

Greenhorn
+ Follow
since Feb 11, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by pal sahab

Hi,

Definition of Java Bean : A Java Bean is a reusable software component that can manipulated visually in a builder tool.

Now coming out of formal world

A Java class is called java bean = Normal java class + Some rules to follow

and some minimal rules are

1.The bean class must provide a zero-argument constructor
2.The bean must support persistence, by implementing the Serializable or Externializable interface.

so basically your class is a java bean, but with no use.The variables chef,waiter,cleaner are not properties but they are simple class level variables.
I hope this explains your query.


Hi

The answer given is correct, because the main requirement for a java bean is to have a no argument constructor which this bean had.The java bean with setters only is just like write only bean.

This is to reference to BE THE CONTAINERON page # 358 in HF SCWCD book.

Prob:

<jsp:useBean id="person" type="foo.Employee" scope="request" >
<jsp:setProperty name="person" property="name" value="Fred" />
</jsp:useBean>
Name is : <jsp:getProperty name="person" property="name" />

1. What happens if the servlet code looks like:

foo.Person p = new foo.Person();
p.setName("Evan");
request.setAttribute("person",p);

Where Person is abstract class and Employee extends Person and is concreate class.

Explanation given :

Fails at request time.The "person" attribute is stored at request scope,so the <jsp:useBean> tag won`t work since it specifies only a type.The CONTAINER knows that if you have only a type specified ,there must be an existing bean attribute of the name and scope.

My Doubt

According to my understanding if the attribute ("person") is already in request scope then the <jsp:useBean> will try to find the attribute by something like this in generated _jspService method by the container.

person = (foo.Employee)_jspx_page_context.getAttribute("person",PageContext.Request_Scope);

so if person if not null then there is no point of failure at request time and <jsp:getProperty> will print the name.

Can anybody please explain where iam wrong?

Regards
Sumit Kumar
Hi

I have downloaded Eclipse 3.2 and just wrote a simple java program in it.
but when i run the program it SEARCHES FOR MAIN TYPES IN A PROGRESS WINDOW then it prompts for a RUN TYPE IN A SEPERATE WINDOW. then it shows error :

Error occurred during initialization of VM
java.lang.UnsatisfiedLinkError: setErrorMode


Can anyone help me out?

thnks
hello

iam new to j2ee, i am somehow manage to add jboss server into eclipse ganymede. now i want to develop web application using struts framework, and i have really no idea how to start with it, i have done lots of GOOGLING and iam confused and stuck now.
please some body guide me..

thnks and regards...
15 years ago
hi
thnks for rply, i will try this also.
bye
15 years ago
hi

iam new to j2ee. i have downloaded eclipse 3.0.4 and jboss-4.2.0.GA (2) server, but iam unable to add jboss server to eclipse.
please help me...
iam using windows platform(windows xp).
15 years ago