This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can I realize the purpose with JSP and javaBean?

 
xie yufei
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to Realize that when the order page submit, the success order page come up while the javaBean program deal with the user's order.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Xie,
It sounds like you want to have the JavaBean execute asynchronously while the JSP returns to the user. You could use a Thread object for that.
 
xie yufei
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you, Jeanne.

As the bean will excute for a long time, I just want the submit page can trigger the bean to do it's work while the submit sucess page come up.

In addition, the submit page need pass parameters to the bean.

Look forward to the reply, thanks!
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

As the bean will excute for a long time, I just want the submit page can trigger the bean to do it's work while the submit sucess page come up.


As Jeanne said, use a thread.

When the request comes in, create a new thread and pass the bean object to the thread. The thread in its run method would have the bean calling the necessary method to process.

The request thread, after this, returns and displays html to the user.

ram.
 
xie yufei
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ram for that you explain it in detail.
I'll try again!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic