Methods in JSP's

T

Trevor M. Lango

I would like to be able to have an html control that invokes some
arbitrary method.

I tried the following:

<input type="button" onclick="<% someMethod( ); %>">

Which generates the following code:

out.write("<input type=\"button\" onclick=\"");
someMethod( );

Which is not what I intended, as someMethod( ) gets called independetly
of the button being clicked.

Any ideas or suggestions?
 
I

Igor N. Kolomiyets

You cannot invoke server side method with the client side event handler.
 
A

Andy Fish

Trevor,

just to expand on the previous replies. you will need to have the button
invoke some javascript which navigates to another JSP, or post a form to
another JSP.

if you really don't want to do this, your
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top