Does a filter instance handle multiple requests?
A web container creates a thread to handle each request so that a servlet instance handles multiple requests at the sime time. What about a filter instance? Does a filter instance also handles
multiple requests? or it handles only one at a time
Here's a quote from the Servlet spec (2.3):
After deployment of the web application, and before a request causes the container
to access a web resource, the container must locate the list of filters that must be
applied to the web resource as described below. The container must ensure that it
has instantiated a filter of the appropriate class for each filter in the list, and called its
init(FilterConfig config) method..............
Only one instance per filter declaration in the deployment descriptor is
instantiated per Java virtual machine of the container.
So, if the servlet engine follows the spec, there should only be one instance.
Similar Messages
-
How to handle multiple request in the servlet
how to handle multiple request in the servlet...
Example:
java forum...
i'm login in the java forum at this time 1000 members make login in this....how happended in servlet?
if we use thread how to implement in servlet ?Serlets are already threaded. The application container instantiates the servlet, then uses this instance in a new thread for every use.
This is the reason that you should use (almost) no instance variables in a Servlet, but rather that (almost) everything should be local to the method. -
How to handle multiple requests to the same servlet at one time?
Hi,
I am new to Servlets. I have doubt regarding ... Handling multiple requests to a servlet at a time.
If we send a single request to a servlet, as know that group of objects such as servlet, servletContext, servletConfig, request, response and etc are created in the server, And if 1000's of requests are sent to a same servlet at a time, and if server memory capacity is less, then 1000's of objects are created in a server which would be heavy burden to Server. How to handle the application and development in such situation?
Kind regards,
veerendraHi veerendra reddy ,
By default any web server can will have a thread pool to handle client req's.
In your point also heavy burden to server you are telling that depends on this.
we can configure this min & max size of this thread pool.
by default it will be 0-1000 for tomcat server.
I am not sure in which file this configuration will be.
But I hope in server.xml or some xml file consists this info.
If You what you can edit accordingly. to overcome your heavy burden to server.
Thanks & Regards
Nagendra -
How biztalk handle multiple request at a time ?
can TCP/IP adapter or biztalk handles multiple request at a time ?
If yes,then how it process multiple request ?
Can TCP/IP send ports sends multiple request ?
PrakashYes.
It processes multiple requests using THREADS. Each Connect starts off a thread that handles the receipt of the message, submission to BizTalk, wait for the response (matching two-way subscription) and then respond back to the client.
TCP/IP Send ports handle multiple requests by creating fresh sockets (RPC High-end ports). As an example, in your browser you open multiple tabs and access different sites, each tab results in your browser opening a fresh socket connection for the request.
Regards. -
Handling Multiple requests in SOAP Sender Adapter
Hi All,
We are working on scenario SOAP-IDOC.
We receive multiple requests from Source, PI should process them and deliver it to SAP system.
Now the issue is :
The messages are in separate SOAP requests i.e. 5 messages = 5 SOAP requests.
If sending a single message there is no issue.
If sending multiple messages at once then a time-out occurs.(HTTP 408 Timeout) If sending
5 SOAP requests in the same transmission then the first message will process ok but the other 4 will report an error. If the 5 SOAP requests are transmitted individually then they process ok.
Can any one throw some pointers on this? What are the settings I have to do in PI so that sender can avoid getting HTTP 408 timeout error?
Regards,
SriniHi Srinivasa,
Set icm/server_port_X parameter . You can change this in RZ10 .Goto tcode RZ10 select the instance profile and select the extended maintenance and click on Change Now click on Create Parameter Tab and write the profile parameter icm/server_port_X and press enter it will show you the default value if any and then put the new value and click on save and F3 and then again save.System needs to be restarted to reflect these changes.
Also check out the SOAP adapter FAQ on service market place. This would surely solve your problem(time out).
Rgds
joel -
Can an SCCM 2012 instance handle multiple Active Directories?
Hi All,
Historically (SCCM 2007 or
earlier version), each active directory
domain has need an SCCM instance. Has that changed/improved in SCCM 2012 so that each instance can handle multiple Active Directories?Historically (SCCM 2007 or
earlier version), each active directory
domain has need an SCCM instance.
That's not true BTW.
Torsten Meringer | http://www.mssccmfaq.de -
Hi,
I have a servlet which handles a simple process. The retrieved value is put in session and displayed in a jsp. When 2 instances of a same jsp (like in multi user access) pass on the request to this servlet, the retrieval is correct for both instances but the session value is null when redirected to one of the jsps. What could be wrong? Please help.
Thanks!A session is bound to a client, so it makes no difference if a hundred users call the servlet at the same time, they are all recieving the session variable seperately.
So if the variable at a later point turns up null, there is a bug somewhere in your code, it's as simple as that. Typo in the name when you retrieve the session variable maybe? Perhaps the session is invalidated somehow?
Could be anything really. -
How to handle multiple requests from single client??
hi all
I wrote a client server program to handle requests from client.I have 2 types of requests, one is to submit comments to the server other is to view comments on the server.I have tested the app and it works fine for either of them(independently) but they don't work both together i.e when i submit a comment and view it,it's stuck and when i close the program it gives SocketException :Connection reset.
on client side:
My request is just a string
on the server side:
I check the string and give the client what it wants.
I want to know if there's any other way to send requests other than passing it as a string.
I can post my code if needed.
thanks,
SreeHere is my client code,minimized it to the extent possible and it might give some compilation problems since i didn't include all the functions needed but i think you should be able to get an idea if i'm doing something wrong.
Can give you my server code if needed.
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
import java.net.UnknownHostException;
import javax.swing.JButton;
public class Test {
JButton submit_button;
JButton view_button;
Socket client;
JButton get_submit_button() {
if (submit_button == null) {
submit_button = new JButton();
submit_button.setText("Submit");
submit_button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
send_comments_to_server();
return submit_button;
Socket check_client_connection(){
String host = "C001192097"; //server host name
if(client == null || client.isClosed()){
try {
client = new Socket(host, 4321);
}catch (UnknownHostException exception){
System.err.println(host + ": unknown host.");
catch (IOException exception){
System.err.println("I/O error with " + host);
return client;
void send_comments_to_server(){
try
Socket client = check_client_connection();
DataOutputStream output_stream = new DataOutputStream(client.getOutputStream());
BufferedReader stream_input = new BufferedReader(new InputStreamReader(client.getInputStream()));
String comment_report = "comments";
Comments comment = new Comments();
User_Data user_data = new User_Data(); //function that returns client details such as host name and stuff
String user_info = "User Name: "+user_data.user_name+" "+"Host Name: "+user_data.host_name+" "+"Domain Name: "+ user_data.domain_name;
comment.user_info = user_info;
comment.summary = comment_report;
comment.comments = "passing comments";
String report = user_info+" "+comment_report+" ";
output_stream.writeBytes(report+"\n");
// output_stream.close();
// stream_input.close();
// client.close();
}catch(IOException e){
e.printStackTrace();
void receive_comments_from_server(){
String line;
StringBuffer comments = new StringBuffer();
try
Socket client = check_client_connection();
DataOutputStream output_stream = new DataOutputStream(client.getOutputStream());
BufferedReader stream_input = new BufferedReader(new InputStreamReader(client.getInputStream()));
String msg = "view comments";
output_stream.writeBytes(msg);
System.out.println("waiting for response");
while((line = stream_input.readLine()) != null){
comments.append(line);
System.out.println("Comments from server "+comments);
} catch (IOException e) {
e.printStackTrace();
JButton get_view_button() {
if (view_button == null) {
view_button = new JButton();
view_button.setText("View Comments");
view_button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
System.out.println("request sent");
receive_comments_from_server();
return view_button;
}thanks
Sree -
Dynamical Tree handling multiple requests
Hi,
I think I already explained well my need. I currently have an
implementation of a tree control that is dynamic. So, when I click
to open a node, it sends a request to server to ask for its
children.
Attached you have my tree code.
And here is a sample feedback I have from server in XML:
<response>
<status>OK</status>
<message/>
<data>
<item id="3" type="folder" label="Item 1.1"
isBranch="true"/>
<item id="4" type="folder" label="Item 1.2"
isBranch="false"/>
</data>
</response>
The problem is that if I the user clicks too fast to open two
branches, only the last request is added. THe other request is
lost, but its node keeps the down arrow. If I try to close it then,
it crashes the app.
My question is how do I make this code able to work with
simultaneous requests? I already tried via AsyncToken without
success. The main problem using tokens is how to pick the selected
item then. =\
Thanks in advance,
Best regards,
Guilherme BlancoZoram wrote:
So can u kindly advice me where should I use Servlets here in my application in order to overcome the problem.Dude, you need to study struts as well. There is an underlying servlet handling all the requests, and based on action name it decides which action class it needs to call. All this is done behind the scenes what you as a developer do is write your logic in the Action class (or may be call some services from it). So it would be easier for us, if you can share the code where you have written the logic as well your Action class code. -
How to enable Sql Dependency OnDataChange event to handle multiple request at a time
when we work with sql dependency then we work with OnDataChange event and this event notify us regarding data change in table. suppose my application monitor a
test table by using sql dependency. suppose huge number of data is getting insert and updated in
test table very frequently. so i do not know how sql dependency
OnDataChange event can handle this situation because OnDataChange event will fire as many as time data will be change in db table.
here is my snip for onchange event
void OnDataChange(object sender, SqlNotificationEventArgs e)
((SqlDependency)sender).OnChange -= OnDataChange;
BBALogger.Write("PartIndexer Service RegisterNotification called end", BBALogger.MsgType.Info);
if (e.Source == SqlNotificationSource.Timeout)
MailSend(); // notification mail send
BBALogger.Write("PartIndexer Service SqlNotificationSource.Timeout error", BBALogger.MsgType.Error);
Environment.Exit(1);
else if (e.Source != SqlNotificationSource.Data)
MailSend(); // notification mail send
BBALogger.Write("PartIndexer Service SqlNotificationSource.Data", BBALogger.MsgType.Error);
Environment.Exit(1);
else if (e.Type == SqlNotificationType.Change)
StartIndex();
BBALogger.Write("PartIndexer Service Data changed", BBALogger.MsgType.Info);
else
BBALogger.Write(string.Format("Ignored change notification {0}/{1} ({2})", e.Type, e.Info, e.Source), BBALogger.MsgType.Warnings);
RegisterNotification();
please help me to design my OnDataChange event such was if data is changed very frequently in test table then
OnDataChange can handle the situation. OnDataChange event should not be freeze and can log each data change in xml file.
i am just looking for guidance like how to design OnDataChange as a result it could handle and log data when huge number of user will change data in test table frequently. thanksHi,
You should be able to delete all nodes selected by an XPath expression... Have a look at this...
http://docs.oracle.com/cd/E28280_01/dev.1111/e15866/ui_ref.htm#i1290003
Cheers,
Vlad -
Handling multiple requests in servlets
Dear friends,
in my application i have a html form and a servlet
From LAN 60 students(clienst) will access the form simultaneously
i have to collect data from all clients and generate a report based on their inputs
how do i collect data from 60 clients
regards
Ram MohanYour using html and a servlet? I suggest JSP and a servlet. I also suggest reading book on JSP that also covers servlets. Keep in mind that in proper MVC design, the JSP pages only displays data and submits back to the servlet. It doesn't contain business logic. The servlet calls business logic, gets data from business logic, puts it in request scope, then dispatches to the appropriate JSP page. The JSP page reads the data from request scope and displays it. If your not too familiar with JSP and servlets, I suggest you first create a hello world JSP page, and a hello world servlet.
-
Does af:commandButton submit multiple requests at the same time?
Hi experts,
I have a question about af:commandButton behavior.
I have two commandButtons in a page. They are button1 and button2.
Button1 takes a few seconds to complete its request process.
So when I click button1, I can click button2 although button1 request is still being processed.
I checked how ADF faces handled this situation with servlet filter.
And I saw that button2 request was always submitted after button1 request was completed.
Due to this behavior, I would assume that commandButton is designed not to submit multiple requests at the same time and guarantees click order.
However I couldn't found any documents specifying this feature of commandButton.
If anyone knows it, could you share?
I know ADF Faces has busyStateListener to prevent user inputs during request round trip.
But I'd like to make it sure that I don't need to use busyStateListener if I just want to keep processing order.
Regards,
AtsushiHi,
Does anyone know the document specifying the behavior of af:commandButton in case I click two buttons in a page almost simultaneously?
Any help will be much appreciated.
Thanks in advance,
Atsushi -
Servlets handle multiple, concurrent requests
Hi, folks. Could someone give me a basic idea of how Servlets handle multiple, concurrent requests which are sent from user's web browser, or possibly, point me some useful web links, tutorials. Let me take a example to make sure that i have explained the question clearly: let's say there is a website that does air ticket booking service. Suppose there is a spare seat exists for a particular flight. There are two users logon to the website and they are both looking for this particular seat. So, once these user's HTML form requests are sent to server, how do i implement my servlet to handle these requests properly, in another words, make sure this seat is only allowed booked by a single user. thanks in advance.
This acturally raises me a another question which i
still have some uncertainties. In another assignment i
did last semester, that was we had multiple users
using our database and accessing, retirving and
updating database by using jdbc. And what i did was
let every user call a particular method within a
javabean for setting up database connection, then goes
for the specific that needs to be dealt with. So, what
i am wondering now is that can i possibly having a
different approach, like setting up only a single
connection(ie. a public Connection objec) which being
exist all the time so that all request can get
connection by calling this object's relevant method.
Hope i explained it clearly.
If I understand you correctly, then you would have to make the methods of this Connecting Object synchronized so that there was only ever one connection to the database at any one time.
If a database is transactional, that means it has attempted to deal with the problem of multiple connections and statements being executed at the same time on the same data. If you have one single Connecting Object then you don't have to worry about transactions, but you do need to make sure that there aren't multiple threads running, each trying to use your Connecting Object.
The synchronized keyword makes sure only one thread can use the synchronized method at any one time. -
Hi at all.... I'm a newbie with database oracle.,
I have the follow problem:
I installed Oracle Database 11g R2 XE on my guest operating system CentOS 6.5.
I have changed the hostname in my SO CentOS (where is installed oracle 11g R2 XE) after installation was completed successfully.
-) Before and during installation the hostname was localhost.
-) After installation I changed the hostname in VMCentOS
From the moment I changed the hostname, nothing starts up automatically. In particular, the listener and the database instance does not starts up automatically.
When I starts up the listener manually and I try to connect to database instance with SQLPLUS i get this error:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
I think that the problem is due to the changed hostname because I, for testing and debugging purpose, re-installed a new OS CentOS virtual machine, re-installed oracle database 11g and I have not got that problem. The database instance and the listener starts up automatically!
Can any one tell me if maybe the problem is related to the hostname changed? ... and Why?
P.S.: After changed the hostname I have also modified the listener.ora and the tnsnames.ora by modifying the HOST with the correct hostname.-) Output of command chkconfig (there isn't any line oracle-xe 0:off 1:off 2:on 3:on 4:on 5:on 6:off):
[oracle@VMCentOS /]$ chkconfig
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
abrt-ccpp 0:off 1:off 2:off 3:on 4:off 5:on 6:off
abrtd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off
atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
blk-availability 0:off 1:on 2:on 3:on 4:on 5:on 6:off
bluetooth 0:off 1:off 2:off 3:on 4:on 5:on 6:off
cpuspeed 0:off 1:on 2:on 3:on 4:on 5:on 6:off
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off
dnsmasq 0:off 1:off 2:off 3:off 4:off 5:off 6:off
firstboot 0:off 1:off 2:off 3:on 4:off 5:on 6:off
haldaemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off
htcacheclean 0:off 1:off 2:off 3:off 4:off 5:off 6:off
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ip6tables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
irqbalance 0:off 1:off 2:off 3:on 4:on 5:on 6:off
jexec 0:off 1:on 2:on 3:on 4:on 5:on 6:off
kdump 0:off 1:off 2:off 3:on 4:on 5:on 6:off
lvm2-monitor 0:off 1:on 2:on 3:on 4:on 5:on 6:off
mdmonitor 0:off 1:off 2:on 3:on 4:on 5:on 6:off
messagebus 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ntpdate 0:off 1:off 2:off 3:off 4:off 5:off 6:off
portreserve 0:off 1:off 2:on 3:on 4:on 5:on 6:off
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off
quota_nld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
restorecond 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rngd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
smartd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
snmptrapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
spice-vdagentd 0:off 1:off 2:off 3:off 4:off 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sysstat 0:off 1:on 2:on 3:on 4:on 5:on 6:off
udev-post 0:off 1:on 2:on 3:on 4:on 5:on 6:off
vmware-tools 0:off 1:off 2:on 3:on 4:on 5:on 6:off
vmware-tools-thinprint 0:off 1:off 2:on 3:on 4:on 5:on 6:off
wdaemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off
winbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
wpa_supplicant 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[oracle@VMCentOS /]$
Moreover in /etc/sysconfig there isn't any file oracle-xe!!!
At this point, I suspect that something in the installation I mistook. -
How does Disco handle multiple hierarchies in dimension from OWB?
Hi,
I have a ROLAP cube developed with OWB. All the dimensions have only one hierarchy at the moment. I derive the EUL from this cube.
One of the dimensions now need another hierarchy. Does anyone know how Discoverer handles multiple hierarchies in a dimension? How would you be able to choose which hierachy to use in a Disco worksheet? Can you actually use multiple hierarchies or only the hierachy set as the default?
ThanksHi,
Yes, you can set up multiple hierarchies in Discoverer for the same EUL items. When you drill down you have the option to select which hierarchy you use.
Rod West
Maybe you are looking for
-
Possible to write a function that takes any type as parameter ?
I need to write a function that will take 2 parameters ( of any type - VARCHAR etc ) and return a boolean. ( Im trying to write a function that will do NULL processing. something like.. if ( P1=P2 OR ( P1 IS NULL AND P2 IS NULL ) ) then return true ;
-
Post Author: EdHaberstroh CA Forum: Charts and Graphs I would like to report the net change or percent change between columns in crosstab report. is that possible?
-
Safari 4.0.3 download "sa.aspx" files automatically
After upgraded to the new Safari v4.0.3, when load in some sites, they'll always download some "sa.aspx" files automatically, one reloads(refresh) one downloads, like "sa.aspx, sa-1.aspx, sa-2.aspx....", that's real big fat trouble!!! Safari 4.0.2 an
-
How to get a connection which does not participate in the main usertransaction
Hi All I am on WLS 6.1 sp2 on win2k. I have a requirement which is like this: I use connection pools/txdatasources/JTA in my application. Now when a JTA transaction (UserTransaction) is active - I want to take a connecti
-
Best Practices for pulling data out of Documentum (w/Crystal and Universe)
I was curious to see if we had any best practices to see if we can pull data out of Documentum. Thanks Ian S