[java ee programming] Homework 4006

2009-11-11 Thread emmanuel

Help Class,
Can anyone help with lab 4006?  I don't know why First and Last names were not 
displaying.

I have this codes in Name Class.

package org.apache.taglibs.standard.examples.beans;

public class Name {

private String firstName;
private String lastName;

public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}

-
I have this codes in Person Class.

package org.apache.taglibs.standard.examples.beans;

public class Person {

private Name name;

public Name getName() {
return name;
}
public void setName(Name name) {
this.name = name;
}
}

-
I placed this code at the end of Init.

 import org.apache.taglibs.standard.examples.beans.*;
Name name = new Name();
name.setFirstName("Emmanuel");
name.setLastName("Faneye");

Person person = new Person();
person.setName(name);

sce.getServletContext().setAttribute("person", person);

-

This code goes to the end of reponse.

  






  
 
 
  
   



Thanks for any help.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
-~--~~~~--~~--~--~---



[java ee programming] Homework 4006 - please help

2009-10-30 Thread Rafał Laczek

Hello Colleagues,

Bellow I send you Init, Name, Person classes.
I don't know how display the result.
I was trying for a few ways but without a satisfied result.

Please help me.

BR
Rafał Laczek
 



Init.java

private void init(ServletContextEvent sce) {
org.me.hello.Name name=new org.me.hello.Name();
name.setFirstName("Rafal");
name.setLastName("Laczek");

org.me.hello.Person person=new org.me.hello.Person();
person.setName(name);

sce.getServletContext().setAttribute("person", person);


Name.java

package org.me.hello;


public class Name {
public String firstName;
public String lastName;


public void setFirstName(String firstName){
this.firstName=firstName;
}

public void setLastName(String lastName){
this.lastName=lastName;
}

public String getFirstName(){
return firstName;
}

public String getLastName(){
return lastName;
}

}

Person.java
package org.me.hello;

public class Person {
public Name name;

public Person()
{
};

public void setName(Name n){
name=n;
}

public Name getName(){
return name;
}

}


Startuje sezon NBA
Zobacz najlepsze drużyny:
http://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2Fnbastartuje.html&sid=903



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
-~--~~~~--~~--~--~---