• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Bean classes

 
Ranch Hand
Posts: 227
IntelliJ IDE Eclipse 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.

 
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.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic