This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes bean tag problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean tag problem" Watch "bean tag problem" New topic
Author

bean tag problem

shukla raghav
Ranch Hand

Joined: Aug 03, 2008
Posts: 200
i dont know why the folowing bean tag is not working

struts.xml



DoBeanTags.jsp



BeanTestAction.java



DoBean.jsp



SelectBean.java



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please see ItDoesntWorkIsUseless and TellTheDetails.

And this.
shukla raghav
Ranch Hand

Joined: Aug 03, 2008
Posts: 200
First all ! Mistake Accepted, i am really sorry for not framing my question properly.

Expected Output : Display the value of property itm i.e. Washing Machine from the SelectBean class. in DoBean.jsp
Actual Output : blank screen

The link that you ahve sent is very useful i thnk i have got my answer.OGNL is a bit confusing sometimes when it comes to retrieving values.

Every time i am adviced, for my mistakes, using such wonderful links i am amazed to see such an organized functioning of java ranch. Great Work !!! It is to Java Programmers what Google is to general public.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Glad you figured it out :)

In this case it isn't really OGNL itself that's the issue, but the lack of consistency in S2 regarding when to use the OGNL escape %{} and when it's implied. In this case, it's implied, but not necessarily obvious... Most S2 developers seem to prefer *always* using the OGNL escape--it makes things easier to understand.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: bean tag problem