Solved

Servlets priority

Posted on 2003-11-16
6
442 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
  • 3
  • 2
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 40 total points
Comment Utility
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
Comment Utility
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
Comment Utility
If you're looking for a processing 'pipeline'  methodology/pattern, then a sequence of Struts Action may fit the bill
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 92

Expert Comment

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

Author Comment

by:dannysh
Comment Utility
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
Comment Utility
>>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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
network + 7 73
Securing Jmx Console and web console 2 45
eclipse formatting 6 38
Cipher Configuration on Apache HTTPD 4 16
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now