This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Thread programming in a Struts application

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi... Can we use Java Threads in a struts web application as we do in a stand Alone application. As all the control would be under Web/Application Server , it is efficient/allowable to induce threads in a struts web application . Please Suggest.
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which struts version you were using?
What do you want to do with threads / why do you need it actually?
 
Bartender
Posts: 9582
13
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spawning threads is discouraged because it is safer to allow the container to manage threads. Have a look at this discussion for some alternatives.
 
Roger Jam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Mohan and Joe..thanks for your suggestions. Sorry i was not able to get back here after posting. My requirement was to send a request to data base after some update is done depending on a condition.Client wants this to be independent. He wants to proceed to other links without depending on this operation result or time . I thought of using threads,but i didnt get any assured/suitable information whether i can use threads or any other alternatives. My application is struts based and we are using JBOSS server.Please suggest.
 
Joe Ess
Bartender
Posts: 9582
13
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One strategy I've used is to use a JMS queue to communicate with a stand-alone process. The request just has to place all the required information on the queue. The JMS queue is useful because it can queue up requests should the stand-alone process fail at any time. The stand-alone process reads from the queue, executes whatever processing it has to do then it sends an email with the report as an attachment.
 
Can't .... do .... plaid .... So I did this tiny ad instead:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!