• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2.x : How to call method in the bean using bean tag

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to call a method in the bean class using the bean tag.
 
shukla raghav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
another question. refer to the code below



In the <s:param> i am passing value="phone", i want this value to be picked up from the value stack like value="%{phone}". But his is not working what should i do?

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you please provide me the exception which you are getting and whole jsp code
 
shukla raghav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well let me make things a bit clear. The name of my action class is UserDetailAction. UserDetail action has two members name and phone. the action hits this action class and the result is returned to a success.jsp.

In success.jsp, a bean class - ContactBean is called. The ContactBean has 4 members 1. phone 2. country_code 3. area_code 4. subscriber_code.

Now when action hits the UserDetailAction.java, the member name and phone are set and put in the value stack. when the success.jsp is called i want to pass UserDetailAction.phone to ContactBean.phone via using param tag. UserDetailAction.phone is now at the value stack so i wish to access it and send it to the bean.hence the following code



there is no exception that is generated only null is set to the ContactBean.phone
reply
    Bookmark Topic Watch Topic
  • New Topic