aspose file tools*
The moose likes Struts and the fly likes can set bean value from jsp? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "can set bean value from jsp?" Watch "can set bean value from jsp?" New topic
Author

can set bean value from jsp?

daffny nila
Greenhorn

Joined: Jan 31, 2010
Posts: 9
I am new to struts and want to know,

Is it possible to set, the value of any set method in the bean, from jsp?

I have a beanslist and iterate them in the jsp. when a row is clicked i want to set the setSelectedBean(Bean bean){} method in the bean. i will process that in action class by calling getSelectedBean().

thanks
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

daffny nila wrote:when a row is clicked i want to set the setSelectedBean(Bean bean){} method in the bean.

I'm not sure what you are trying to do. After a JSP page is rendered into the browser, it works as normal HTML, you can't do any JSP specific processing after that i.e. you can't use anything like jsp:setProperty on the click of the user. What exactly do you want to achieve?? You may use an AJAX request if you want to do some processing on the click of the mouse without submitting the page...
daffny nila
Greenhorn

Joined: Jan 31, 2010
Posts: 9
thanks for the reply.


I have a form bean which displays, list of beans in a table. in that i should select a bean and delete. when i click on a row in the form bean , setSelected should be set to that bean so that i can delete it.now i am not able to find which has been clickded and the first row is getting deleted ,( i use formBean.getSelectedBean() to get the bean in the action class).


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Use a form. This is what forms are for: getting information from the browser back to the server.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can set bean value from jsp?
 
Similar Threads
returning value from jQuery
servlet , bean , jsp Communication
Bean Problem
setting value of bean on jsp using spring tag library
how to access hidden value set in jsp in EJB method