action listener for struts html tag
hi i am doing a project using sturts. I have used struts HTML Select tag with a collection of values in select box. now i want to write an actionlistner for that select...ie if i select any value from the select list it should do some action like take me to different page...can anyone tell me how can i do that...
Thanks
hello mr.seoul thanks for your reply.....i dont know in which country you are working but in our country we need to learn and start programming at the same..time....so we get reallu frustrated with this.....anyway thats our problem, and its my fault to post such a simple question...
but mind u ......give an answer if u know that ......dont give these type of replies next time ......you are not the only person in this forum there are many guys to help us.....be careful
Soultech, I think you're being a bit harsh. Struts is a valid topic on this forum as it is a java framework related to JSP.
However having said that, the question does show a basic misunderstanding of JSP technology.
JSP = Java SERVER Pages. Java code only runs on the server.
All that gets sent to the client (browser) is an HTML file.
You can not write java action listeners to run and respond to events on the client.
For any client side interaction you will have to use javascript (which is NOT java) - probably an onclick/onchange event - the same as any other web page.
However you can only run javascript code from such events.
To run java again you have to submit a request to a server - normally done by submitting a form.