Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Bean classes

 
Santosh Kumar Nayak
Ranch Hand
Posts: 149
Eclipse IDE IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We are having 2 bean classes say Bean1 and Bean2

In our JSP page we have the following:-


........
value="#{Bean1.ListName}"
......
<f:selectItems value="#{Bean1.existingListName}"/>



But from the GUI when we use method then the Bean2 gets called automatically.

Any idea as why the Bean2 class is getting called instead of Bean1 class.

 
D. Ogranos
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Santosh Kumar Nayak wrote:Hi,

We are having 2 bean classes say Bean1 and Bean2

In our JSP page we have the following:-


........
value="#{Bean1.ListName}"
......
<f:selectItems value="#{Bean1.existingListName}"/>



But from the GUI when we use method then the Bean2 gets called automatically.

Any idea as why the Bean2 class is getting called instead of Bean1 class.



If "#{Bean1.ListName}" is an EL expression (in which case it should be written "${Bean1.ListName}"), it means that you have put Bean2 as a scoped variable, instead of Bean1. In your java controller class you might have written "request.setAttribute("Bean1", Bean2)" accidentaly.

Btw. it would be helpful to adhere to standard naming conventions and write your variables and field names with a small letter as first char, it makes reading these expressions a lot easier.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!