Solved

Servlets priority

Posted on 2003-11-16
6
457 Views
Last Modified: 2013-11-24
Hi all
Is it possible to priorities servlets?
I have two different servlets, I want to be able to control which clients handled first.
One of the servlets is more important.
0
Comment
Question by:dannysh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 40 total points
ID: 9758760
The servlets will be called in the order your program flow decides. If you mean can you prioritise the order in which they load on startup then you can change the loadonstartup tag of the servlet in your web.xml. The lower the figure the earlier the load. Here's an example:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
 <servlet>
  <servlet-name>deegreewms</servlet-name>
  <servlet-class>org.deegree_impl.enterprise.WMSServlet</servlet-class>
  <init-param>
   <param-name>capabilities</param-name>

<param-value>file:///C:/daten/software/geotools/deegreewms/WEB-INF/xml/sample_wms_capabilities.xml</param-value>

  </init-param>
  <init-param>
   <param-name>debug</param-name>
   <param-value>ERRORS_AND_COMMENTS</param-value>
  </init-param>
  <load-on-startup>
   1
  </load-on-startup>
 </servlet>
 <servlet-mapping>
  <servlet-name>deegreewms</servlet-name>
  <url-pattern>/wms</url-pattern>
 </servlet-mapping>
</web-app>


0
 
LVL 92

Expert Comment

by:objects
ID: 9759799
Am not aware of anything to achieve that, and thinking I'm not sure how you would achive it. Generally client requests are recieved by the server sequentially and each processed seperately, they don't wait for the previous request to be handled.
What is it exactly that you'd like to do instead?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9760025
If you're looking for a processing 'pipeline'  methodology/pattern, then a sequence of Struts Action may fit the bill
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 92

Expert Comment

by:objects
ID: 9761998
load-on-startup has nothing to do with priority of client requests.
0
 

Author Comment

by:dannysh
ID: 9762033
Hi Objects yes I know.
I close this question by mistake, sorry. I will open it again

http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20800063.html
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9763244
>>load-on-startup has nothing to do with priority of client requests.

I hope you or dannysh didn't think that I suggested that ;-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 101
Unhandled exception type Exception 18 63
jmss example java 2 46
Tomcat 9 + java 8 error while trying to deploy a war file 2 844
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question