Access java method in a submit of a jsp

B

bolinhu

Hi

I'm having a problem with a form that has 3 submits in a jsp and I want
that each one of them to access different methods in a java class. How
can I do that?

Thanx
 
J

Joe Attardi

I'm having a problem with a form that has 3 submits in a jsp and I want
that each one of them to access different methods in a java class. How
can I do that?

A little more information on your environment. What is your JSPs
submitting to? A servlet? Are you using Struts?
If you give some more details we can help you out.
 
B

bolinhu

My jsp is just refreshing the actual page with some variables
actualized, because 2 of the 3 submits I have don't work yet. The ideia
is to acces in the other 2 submits some methods is a java class(a
servlet maybe, I haven't implemented it yet) to access a databse and
return some objects from there.
 
J

Joe Attardi

My jsp is just refreshing the actual page with some variables
actualized, because 2 of the 3 submits I have don't work yet. The ideia
is to acces in the other 2 submits some methods is a java class(a
servlet maybe, I haven't implemented it yet) to access a databse and
return some objects from there.

You should probably have your form submit to a servlet. Then, in the
doGet() or doPost() method of the servlet, you can determine what
method to call, and just call it. Then redirect to your JSP from there.
 

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,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top