• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling more than one method from a Servlet.  RSS feed

 
Darren Jackson
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ive got a class on a server that runs a task and returns some items to the user.

The user then needs to input values for these items into the same class, but a different method.

Ive currently got a servlet that runs the first part of this class no problem, returning the items.

My question is, what is the best way to call the next method?

Can I do it from the same servlet, becuase this is what I want to do?

The way the current serlvet works is that it uses a doGet() method to return the results, but I cannot see how I can now make the same servlet run another method...

Can some please suggest a simple way of doing this as im sure that I do not need to create another servlet to run the next method.

Thank you

Darren.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way the current serlvet works is that it uses a doGet() method to return the results, but I cannot see how I can now make the same servlet run another method...


Are you talking about after the response is sent to the browser?

Of course you'll need another servlet. The next submission will be an entirely different request.

You might want to describe the big picture of what you are doing. It sounds like you have some structural misconceptions.
 
Darren Jackson
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Are you talking about after the response is sent to the browser?

Of course you'll need another servlet. The next submission will be an entirely different request.

You might want to describe the big picture of what you are doing. It sounds like you have some structural misconceptions.


I think you have answered my question.

Im making a MIDlet that calls some servlets which in turn talks to a database and return two items for a user.

The user then needs to comment unpon these items, which is what the seconds method in the class does, and decides if the first method should be run again.

I think you have already told me what I need to know as it is a different request.

Thanks you.

Darren
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!