Hi, I think your problem is here: * Person person= new Person();* * sce.getServletContext().setAttribute("name",person);*
*Response.jsp* * <jsp:useBean id="mybean2" scope="application" class="org.apache.taglibs.standard.examples.beans.Person" />* You declare the context attribute with the name "name" and when you use it in jsp page, you call it by the id mybean2. The attribute name and the bean id in the jsp page must be the same. Try changing one of them. 2009/10/18 Mario Quiroz <zacek3...@gmail.com> > Hi again I guess the last mail didin't arrive well. > My problem is that I'm doing wrong the EL lab the next it's part of my > code, since I ran the code it never shows anything. I tried printing only > the name but nothing happens. > Can anybody tell me what's wrong with my code?. > Thnks. > > > *Person class* > > *public class Person {* > * private Name name; > private Name lname;* > * public Person(){ > init(name); > }* > * public void setLname(Name lname) { > this.lname = lname; > }* > * public Name getLname() { > return lname; > } > > public void init(Name name){ > setName(name); > //setLname(lname); > }* > * public void setName(Name name) { > this.name = name; > }* > * public Name getName() { > return name; > }* > > *Name class* > *public class Name {* > * private String firstname; > private String lastname;* > * public Name(String fname, String lname){* > * setFirstname(fname); > setLastname(lname); > }* > * 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; > }* > ** > *Init class* > * private void init(ServletContextEvent sce) { > * > * Person person= new Person();* > * sce.getServletContext().setAttribute("name",person);* > > *Response.jsp* > > * <jsp:useBean id="mybean2" scope="application" > class="org.apache.taglibs.standard.examples.beans.Person" /> > <!-- > > --> > <c:out value="${person.name.name}"/>* > > > -- > Ing. Mario Quiróz > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---