Calling a servlets multiple times from a servlet
Hi All,
Advanced Thanks,
I have a servlet which calls another servlet to display some records. Second servlet will access some data from XML files and forwards to a JSP file. What i want is I need to call the second servlet multiple times from the the first servlet. I used RequestDispatcher to call the servlet but I can call only one time after a an exceptions is occurred like cannot forward after response is committed.
I need this scenario in the saem way because each time second servlet is called I am forwarding response to user each time records are accessed based on the request value.
request.getRequestDispatcher("sample").forward(request, response);
Any one please give me a suggestion?
Thanks in advance
What are those servlets supposed to do? Sounds like that they are doing too much, e.g. acting like business classes or utility classes or so. Refactor your code.
Similar Messages
-
Message Driven Bean reading multiple times from a jms queue
Hi,
I am facing a strange problem with my message driven bean. Its configured to read message from a jms queue. But sometimes it read the same message multiple times from the jms queue.
We are using weblogic server 8.1 sp5.
Please find below our descriptor files
ejb-jar.xml
<ejb-jar>
<display-name>ClarifyCRM_Process_Manager_13.1</display-name>
<enterprise-beans>
<session>
<display-name>ProcessManager</display-name>
<ejb-name>ProcessManager</ejb-name>
<home>com.clarify.procmgr.ejb.ProcessManagerHome</home>
<remote>com.clarify.procmgr.ejb.ProcessManagerRemote</remote>
<ejb-class>com.clarify.procmgr.ejb.ProcessManagerEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
<message-driven>
<display-name>ProcessManagerListener</display-name>
<ejb-name>ProcessManagerListener</ejb-name>
<ejb-class>com.clarify.procmgr.ejb.ProcessManagerMDB</ejb-class>
<transaction-type>Bean</transaction-type>
<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>ProcessManager</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
weblogic-ejb-jar.xml
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>ProcessManager</ejb-name>
<stateless-session-descriptor>
<pool>
<max-beans-in-free-pool>100</max-beans-in-free-pool>
<initial-beans-in-free-pool>10</initial-beans-in-free-pool>
</pool>
</stateless-session-descriptor>
<enable-call-by-reference>False</enable-call-by-reference>
<jndi-name>ProcessManagerHome</jndi-name>
<dispatch-policy>PMExecuteQueue</dispatch-policy>
<remote-client-timeout>0</remote-client-timeout>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>ProcessManagerListener</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>100</max-beans-in-free-pool>
<initial-beans-in-free-pool>10</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>clarify.procmgr.jms.queue.Execution</destination-jndi-name>
<connection-factory-jndi-name>clarify.procmgr.jms.factories.ExecConnection</connection-factory-jndi-name>
</message-driven-descriptor>
<enable-call-by-reference>True</enable-call-by-reference>
<dispatch-policy>PMListenerExecuteQueue</dispatch-policy>
<remote-client-timeout>0</remote-client-timeout>
</weblogic-enterprise-bean>
</weblogic-ejb-jar> The MDB is sometimes reading multiple times from clarify.procmgr.jms.queue.Execution
Also i would like to add here that the connection factory we are using clarify.procmgr.jms.factories.ExecConnection is having the following properties
ServerAffinity Enabled=true
XA connection factory enabled=false.
Please help me out here!!Maybe, your MDB "sometimes" throws an Exception in onMessage.
Check if this happens when you set <max-beans-in-free-pool>1</max-beans-in-free-pool>. -
Problem Calling a WebService multiple times
Hi Guys,
I am a relatively new user of DS 12.2 doing a proof-of-concept to call an in-house WebService for a batch of customer records - lets say 1000.
The WS has an input schema where it's parameters are within a nested table such that it can be called for many customers in a single call if desired. WS input schema (made-up example)=
-WS
--$REQUEST_SCHEMA **added by DS on import
---CustVerification
src_nr
src_state
I have successfully been able to create a Data-Flow that builds the input-schema such that 1 WS call is made with a nested input of all 1000 customers. This works and the output from the single call is correct (many records relating to the many inputs etc). Input schema =
- <CustVerification>
- <Details>
<src_nr>1234<src_nr />
<src_state>KY</src_state>
</Details>
- <Details>
<src_nr>1234<src_nr />
<src_state>KY</src_state>
</Details>
- <Details>
<src_nr>1234<src_nr />
<src_state>KY</src_state>
</Details>
</CustVerification>
Now the problem - I am wanting to do this flow so that it calls the WS once PER customer i.e. 1 entry in many of the nested CustVerification structures.
I have, again, been able to produce the correct XML schema (at least it looks correct) which repeats the Input Schema for each customer record. HOWEVER, when hooking this up to the function call of the WS as before, I either get only 1 single call like before with the last entry in the file run through it..... or, after playing with the query's input schema to add an extra root level and changing FROM clauses to map to the function call schema I then get a huge ACCESS_VIOLATION dump which mentions "LoadDFXML::put_string()+2427 byte(s)" and other such XML-related but non-helpful messages.
New input schema is:
- <CustVerification>
- <Details>
<src_nr>1234<src_nr />
<src_state>KY</src_state>
</Details>
</CustVerification>
- <CustVerification>
- <Details>
<src_nr>1234<src_nr />
<src_state>KY</src_state>
</Details>
</CustVerification>
- <CustVerification>
- <Details>
<src_nr>1234<src_nr />
<src_state>KY</src_state>
</Details>
</CustVerification>
So.... am I missing something simple in how I call a WS multiple times as opposed to once with multiple inputs? Could this be a setting/property somewhere? IS this linked with how I do a QueryTransform in a certain way to get the function called the right number of times? Anything else??
Thanks for any advice/help.
Flip.Thanks for the responses guys.... I actually got past the error with a change to the NRDM structure (as mentioned in the first reply, I think a small problem here really changes things).
So - what I had to do to get this working properly was to add a new 'dummy' level into the structure - this kept it clean to denote that the 1 large bulk of messages were going to be sent through the WS many times. So - structure looks like this:
Input_Query:
- <ROOT>
- <CustVerification>
- <Details>
<src_nr>1234<src_nr />
<src_state>KY</src_state>
</Details>
</CustVerification>
- <CustVerification>
- <Details>
<src_nr>1234<src_nr />
<src_state>KY</src_state>
</Details>
</CustVerification>
- <CustVerification>
- <Details>
<src_nr>1234<src_nr />
<src_state>KY</src_state>
</Details>
</CustVerification>
</ROOT>
Then, in the Output schema for the function call, I had to create a dummy extra schema level also - say 'WS_Call', and put the function call within this structure. The FROM mapping has to be set so that both the input_query level AND the input_query.root level are mapped to the WS_Call schema.
And then it works!
Summary -- its a bugger.... but playing with the structure levels (and adding your own at times) and FROM clauses can work!
Cheers,
Flip. -
SWF requested multiple times from server
Hi,
We have implemented an SWF in our homepage, using normal object tags. The SWF source is called from our database.
Loading works fine, and the SWF plays OK on the page. However, using firebug or httpwatch, we can see that the same SWF is requested multiple times from the server. We only have 1 instance of the SWF on our page. At the moment I can see 6 requests to the full SWF file (about 360kb) and another 8 requests to the same file, but with a lower filesize (about 98kb).
How is this possible? We tried using different browsers but they are giving the same results. Google doesn't answer my question, so maybe one of you can help me out here?
Thanks in advance!what's your url?
-
Hi friends,
I am running the stored proceadure from crystal report. And it is executing two or three times. I can come to know through debug points which i placed in sotered proc.
It is very urgent...any help is appreciated.
Thanks,
VijayI am having the same issue. I have a very simple XI crystal report that calls a stored procedure. I have checked the report option you mentioned - it is not checked and i have removed all subreports to take away any question about them. It is still calling the procedure multiple times.
My oracle stored procedure is getting executed THREE times in one run of my crystal report!
I have created a crystal report based on a Oracle stored procedure and ODBC driver. This report is published on a Business Objects Server XI Release 2.
In trying to figure out why the report was having efficiency issues, I have modified the procedure to write to another table so I can see what is happening in the report. After executing the crystal report, I found that the procedure is called THREE times. Here is the output from the table that I write to after the Crystal Report is executed from Enterprise:
0 DEBUG - 28-JUL-2008:09:43:50: Starting STPR
100 DEBUG - 28-JUL-2008:09:43:52: Done with 1
240 DEBUG - 28-JUL-2008:09:43:52: End Program - Right after opening Cursor
240 DEBUG - 28-JUL-2008:09:43:52: Right before opening Cursor
0 DEBUG - 28-JUL-2008:09:43:53: Starting STPR
100 DEBUG - 28-JUL-2008:09:43:55: Done with 1
240 DEBUG - 28-JUL-2008:09:43:55: End Program - Right after opening Cursor
240 DEBUG - 28-JUL-2008:09:43:55: Right before opening Cursor
0 DEBUG - 28-JUL-2008:09:43:56: Starting STPR
100 DEBUG - 28-JUL-2008:09:43:58: Done with 1
240 DEBUG - 28-JUL-2008:09:43:58: End Program - Right after opening Cursor
240 DEBUG - 28-JUL-2008:09:43:58: Right before opening Cursor
When calling the report directly in Crystal, I get mixed results, sometimes it is the same, sometimes the procedure is called once but I see debug lines for the first two of the four rows in the second call and sometimes it is only called once.
Is there something that can make sure the procedure is called once and only once. We are running into database efficiencies.
Thanks! -
Calling stored procedure multiple times in the JDBC receiver
Hi,
I am calling the stored procedure(SP) to update a DB table in the JDBC receiver.
SP has 10 input parameters, and SP can receive one value for each parameter at a time.
In my case, i will have multiple rows to insert using SP.i.e multiple values for each parameter.
Its working correctly for a single value for each parameter, but when i have multiple values i want to call the SP multiples times.
Is this possible and how?
Thanks,
Varghese.Varghese,
I think you can have multiple statements in the JDBC Adapter's XML, as in http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm.
Here the StatementName1 node can be inserted into your JDBC XML as often as you want.
Kind regards,
Koen -
Calling same form multiple times
Hi, i need to call a single form with different table names as parameters depending on conditions.
for eg here is the approach
if flag1_is_set
call form1 multiple times with table1, table2....... as parameters
"and i can avoid this
" form 1 using table 1
" form 1 using table 2
" form 1 using table 3
" form 1 using table 4
" form 1 using table 5
elseif
flag2_is_set
form 1 using table 2
elseif
flag3_is_set
form 1 using table 3.
but i cannot call forms like this. can someone suggest
an equivalent implementation on how to do this.
if i dont implement in the above mentioned approach i have to code the same thing with minor changes multiple times
thanks.
your help would be appreciated.
kranthi.You might try passing a field symbol (itab) in the tables.
And assign the filed symbol with your itab as per the condition.
Check if the program below gives you any idea.
REPORT Z_RAM_DYN_TAB_IN_FORM.
PARAMETERS : P_TAB1 TYPE C.
DATA: lt_users2 type standard table of usr02.
DATA: lt_users1 type standard table of usr01.
FIELD-SYMBOLS: <fs_itab> type standard table.
SELECT * into table lt_users1 FROM usr01.
SELECT * into table lt_users2 FROM usr02.
IF P_TAB1 eq 'X'.
ASSIGN lt_users1 to <fs_itab>.
ELSE.
ASSIGN lt_users2 to <fs_itab>.
ENDIF.
PERFORM test_form TABLES <fs_itab>.
FORM test_form TABLES x_itab .
FIELD-SYMBOLS: <fs_wa> type any.
FIELD-SYMBOLS: <fs_field> type any.
LOOP AT x_itab ASSIGNING <fs_wa>.
DO 5 times. "Write first 5 fields of itabs.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_wa> to <fs_field>.
WRITE : <fs_field>.
ENDDO.
WRITE :/.
ENDLOOP.
Thanks,
Ram
Message was edited by: Ram Manohar Tiwari -
Calling a vi multiple times makes the timer "crash"
I use a subvi for writing data from a profibusnetwork. In this vi I can set a timer for the "update" to write away the data. I use a global variable to remember the last time the writing was done. The problem I encounter here is that when I use this subvi multiple times only the data I want updated fastest will be written away.. My question is: Is it possible to use just this one vi multiple times instead of renaming it for every datasource I want to write away?
Thx in advance,Use a while loop with an uninitialised shift register instead of a global,
and build it into a function marked "re-entrant". This way different data
exists in each different copy of it in the code.
henk007 wrote in message
news:[email protected]..
> I use a subvi for writing data from a profibusnetwork. In this vi I
> can set a timer for the "update" to write away the data. I use a
> global variable to remember the last time the writing was done. The
> problem I encounter here is that when I use this subvi multiple times
> only the data I want updated fastest will be written away.. My
> question is: Is it possible to use just this one vi multiple times
> instead of renaming it for every datasource I want to write away? -
Extracting body with header and trailer multiple times from a multirow file
Hello Everyone,
I am new to OSB and currently working on a project where I need to extract data from a flat file containing multiple rows of body and a single header and trailer in the following fashion:
Original File:
<Header></Header>
<Details></Details>
<Details></Details>
<Trailer></Trailer>
Desired format using OSB:
<Header></Header>
<Details></Details>
<Trailer></Trailer> ... in a single file, multiple times
Please help me in carrying out this functionality. It's really urgent and important.
Thanks,
SaurabhSome may argue this is not the right forum - database general might have been a little been than downloads - but now the thread is here I'll try an answer.
As I see it It depends on your spooling tool.
Lets assume you are using sqlplus.
I that case the sql prompt command may serve your purpose
Alternatively
select 'header' from dual
union all
select field1||','||field2||','field3 .... /*must single string expression but may concatentate field */ from somtable
union all
select 'trailer' from dual;may suit.
However I fear either I have not understood the question or if I have understood the question that you may have difficulties implementing this.
Edited by: bigdelboy on 19-Apr-2009 14:32 -
Rendered Property calling managed bean Multiple Times
Hi
We have a problem within a command button in a jspx, which includes a rendered tag which references a managed bean method via EL.
e.g.
rendered="#{PERUserInfo.trainee}"
When I debug the jspx, the PERUserInfo.trainee method is called 4 times instead of once.
We have noticed similar findings when using managed bean methods via the rendered property. i.e. calls getters multiple times.
Any idea why this is happening?
We are using JDeveloper v10.1.3, JHS v10.1.3 SU1.
All comments appreciated.
Cheers
DenisDenis,
There can be many reasons why your bean method is called multiple times; but I would consider this perfectly normal in any JSF application considering all the lifecycles and (possible) Partial Page Rendering that happens.
The question is, by the way, more appropriate on the JDeveloper forum since it is not directly related to JHeadstart itself.
Hope this helps,
Evert-Jan de Bruin -
Calling smartform multiple times from driver program
Hi Experts,
In a internal table i have multiple records, and my requirement is i need to call the smartform by looping the internal table and i'm geting output N times based on the N record in the internal table
But my output i need to club all these output into single output i.e Instead of getting a print preview screen N times... i need to get the output during the last record of the internal table displaying all the pages.
I tried searching the SDN, but the answers were not convincing for my requirement.
Please advise. Thanks
Regrds
Balaji RHi Sravanthi
Thanks for your quick reply.
I found your code interesting....
but in my requirement spool will not be created..
In my requirement
I receiving the print preview for each record of the internal table, say 5 page for 5 records in the internal table.
Now i need to change that only at the end of the itab..... i need to get the print preview with all the 5 pages...
Please advise..
Thanks -
If my daughter doesn't have wifi and we face time, will she use data on her end?
Note that not all carriers allow FaceTime over a cell connection, and some that do require you to sign up for specific service plans. As to data usage, a report on The Unofficial Apple Weblog indicated that a 47-minute FaceTime call over 3G used about 65 megabytes of data. You can estimate your usage from there.
Regards. -
SubmitForm calls the url multiple times
when I execute the following
function SendServer(){
this.submitForm({
cURL:"http://localhost:50676/aWeb/ProcessPDF.ashx",
bPDF: true});
from a form it performs several submits.
I'd like to have a
app.alert( "sent form....
SendServer();
app.alert("data sent to ....
but the allerts show before the form is ever sent and also execute multiple timesThat's odd, and the oJavascript parameter wouldn't make any different here, even if you were submitting as FDF, which is the only time it's relevant.
As a test, set the cURL parameter to use a mailto type URL, something like:
mailto:[email protected]
Does it attempt to submit twice now? -
Getting the same return string while reading multiple times from a GPIB instrument
I'm having problems reading data from a GPIB instrument.
I'm using a sequence similiar to this:
1. Send a "MEASCALRES?" command to the calibrator to measure the current pressure.
2. Read the result string sent from the calibrator.
3. Send a "SYST:ERR:NEXT?" query to check if an error has occured.
4. Recieve the error string from the calibrator.
When running the program, the error string sometimes contains the same data as the pressure reading. For example, if the calibrator's pressure output string was "1.0000000e2", the error string might be "1.0000000e2" or sometimes just "20, No Errors", with the extra "2" added to the normal "0, No Errors".
The problem a
ppears to occure randomly, a rough estimate would be that it happens one time out of 50 readings.
Are there any relevant GPIB card settings I can change to fix the problem?It looks to me that more data is send or data end is signalled to early by hte iocard.
Maybe you should check the gpib bus cable speed. The default is much too fast for almost all instruments. Put it on 2 microseconds (the slowest speed). And we always disable autopolling, to prevent asynchronous actions.
greetings from the Netherlands -
Call a vi multiple times to check progress
My basic setup is that I have a caller vi calling a subvi. However as the caller vi is looping i would like it to call the subvi and not wait for it to finish its execution. Except i would like it to go to the next loop and then call the previous instance of the subvi to check on the progress.
I have attached some example vi sto show m point, where the caller_vi.vi calls the subvi.vi to bgein exectution. Basically i would like it to call the subvi to run independantly and while it is running the caller vi can keep calling it to check on the vairables 'x=1' and 'numeric3'. However if the subvi has finished running then it should begin another execution again when called from the caller vi
Thanks
Ps. I have played around with the reentrant options and Run vi methods to no avail so far
Attachments:
Caller_vi.vi 9 KB
subvi.vi 6 KBYeah the vi's I attached weren't the latest copies. So I have attached them again.
As for what I need:
What I would like is to call and run the subvi.vi from the caller_vi.vi and not wait for it to finish execution but return to the caller_vi.vi (For this I believe the run vi invoke node would be used with a false 'Wait until Done'...something similar to what is inside the case structure at the bottom of the Block Diagram)
While the subvi.vi is running the caller_vi.vi should continue doing loops and therefore when it is doing another loop it should call the subvi.vi again.
From this new call I need it get the values for 'x+1' and 'Numeric3' only if the subvi.vi has not finished executing Otherwise it should run the subvi.vi again. SO if subvi.vi is finished then run again if subvi.vi is not finished then what is the value of 'x+1' and 'Numeric3'
Obviously I have not called the subvi.vi in the correct manner or else my program would have worked but the previous steps shows what I would like to get
I hope that makes things clearer
Attachments:
subvi.vi 7 KB
Caller_vi.vi 9 KB
Maybe you are looking for
-
Display specific value from List of Values(LOV)
Hi All, Is this possible in BOXI R2 that i created a List of Values like below: 1. P1AF 2. P1XA 3. P2AF 4. P2XA 5. P2XD 6. P3AF 7. P3XA 8. P3XD and i would like to show only 1 & 2 values for specific users. Or switch on /off some values without acces
-
Invalid data found when base64 decoding a String
When I tried to start my server, my server stops automatically. Following are my server0 logs when the server0 stopped automatically when I tried to start my WEB-AS. <!LOGHEADER[START]/> <!HELP[Manual modification of the header may cause parsing prob
-
Bridge will not launch in Mac OSX 10.6.8
Adobe Creative Suite 5.5 Design Standard (Mac OS) works fine except for Bridge which will not launch from Photoshop or from Applications, after 2 Uninstall/Reinstalls,and same attempts with new user account. Can anyone help?
-
Preview in browser, IE problem
When I do a preview in browser in dw (CS4) to IE 7 on XP, it 'locks up' trying to down load a .png. it never completely loads. this happens on several pages, including ones that I have not changed. I don't have this problem in Safari, the pages pr
-
Problems with Drive Mapping using Oracle Drive
It seems as though we are having some trouble with oracle drive. The install was a piece of cake, as was the configuration. The problem arises when at times we connect with the proper credentials, Oracle Drive logs the user in, but then the appropria