Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can set bean value from jsp?

 
daffny nila
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a form. This is what forms are for: getting information from the browser back to the server.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic