Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Servlets priority

Posted on 2003-11-16
6
Medium Priority
?
467 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 160 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
A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

 
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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

688 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