| Author |
Struts 2.x : How to call method in the bean using bean tag
|
shukla raghav
Ranch Hand
Joined: Aug 03, 2008
Posts: 184
|
|
|
Is it possible to call a method in the bean class using the bean tag.
|
 |
shukla raghav
Ranch Hand
Joined: Aug 03, 2008
Posts: 184
|
|
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?
|
 |
dhoni Gibson
Ranch Hand
Joined: Feb 10, 2011
Posts: 30
|
|
|
can you please provide me the exception which you are getting and whole jsp code
|
 |
shukla raghav
Ranch Hand
Joined: Aug 03, 2008
Posts: 184
|
|
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
|
 |
 |
|
|
subject: Struts 2.x : How to call method in the bean using bean tag
|
|
|