Call method http_client - request - set_header_field
Hi all,
i am passing NAME & VALUE as two export parameter for the below method.
here , what i should pass to VALUE parameter. is it a URL?
what is the meaning of '_/airport.asmx'_ in VALUE parameter.
call method http_client ->request ->set_header_field
exporting
name = '~request_uri'
value = '/airport.asmx'.
Regards
pabi
POST
Pages generated by an HTTP POST operation are always cached. The Web browser uses POST operations whenever an HTML FORM statement specifies METHOD="POST" .
GET
Pages generated by GET operations are never cached because the Internet Transaction Server (ITS) explicitly sets a no-cache option in the HTTP header when the page is sent to the Web browser. It does not matter what caching options are set in the Web browser. The Web browser uses GET operations for hypertext links and FRAMESET documents.
check these links
http://help.sap.com/saphelp_47x200/helpdata/en/ee/23df3a750f6a02e10000000a11405a/frameset.htm
http://help.sap.com/saphelp_47x200/helpdata/en/78/985281c06b11d4ad310000e83539c3/frameset.htm
http://help.sap.com/saphelp_47x200/helpdata/en/99/0455ada80a11d1801000c04fadbf76/frameset.htm
Similar Messages
-
Call method http_client- response- get_header_fields for PDF and for TIFF
Hi,
I am using a Function Module..
APAR_EBPP_GET_INVOICE_DETAIL to display the TIFF images on the Biller Direct side.
The above function module is used to retrieve the PDF documents from the document repository.
In Similar way I am trying to do the TIFF Images too.
But in this method
call method http_client->response->get_header_fields
changing fields.
For PDF the table fields is as follows
NAME VALUE
1 ~response_line----
|HTTP/1.1 200 (OK) |
2 ~server_protocol----
|HTTP/1.1 |
3 ~status_code----
|200 |
4 ~status_reason----
|(OK) |
5 content-length----
|7136 |
6 content-type----
|application/pdf |
7 server |Microsoft-IIS/6.0 |
8 x-powered-by |ASP.NET |
9 date |Tue, 24 Feb 2009 18:09:35 GMT |
10 connection |close |
For TIFF the table fields are as follows:
1 ~response_line----
|HTTP/1.1 500 (internal server error) |
2 ~server_protocol----
|HTTP/1.1 |
3 ~status_code----
|500 |
4 ~status_reason----
|(internal server error) |
5 content-length----
|105 |
6 content-type----
|text/plain |
7 server----
|Microsoft-IIS/6.0 |
8 x-powered-by |ASP.NET |
9 date |Tue, 24 Feb 2009 18:26:39 GMT |
10 connection |close |
The error message is Internal Server error..
This is in HTTP2_Get Function Module.
What would be the reason for HTTP/1.1 500 Internal Server error.
Any suggestions are welcome..
Thanks,
ChaitanyaHi Niranjan,
can you please check if you have imported the whole chain of certificates. Certificates usually diplayed in 3 levels in the Explorer. like
Verisign - L1
>>> Versign-- L2
>>>>>>>>>>>>XYZ.com -- L3
Extract all the 3 certificates and Put in Strust and do exit soft and hard in SMICM and restart the service.
Its better to create a RFC destination of Type H and Do the Connection test for HTTPS configuration. If the connection test comes OK then u can be sure of the configuration. -
Error calling methods CL_GUI_FRONTEND_SERVICES
Hi all,
I have a requirement in BAPI (integrating solman to portal) to download file from app. server to local directory. I used the below FM to get temp directory of presntation server.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_TEMP_DIRECTORY
CHANGING
TEMP_DIR = LV_TEMP_DIR
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4.
CALL METHOD cl_gui_cfw=>flush.
It works fine in R3, but when i called it from portal it shows Access not possible using 'NULL' object reference with a short dump .
st22 shows
Error in ABAP application program.
The current ABAP program "CL_GUI_FRONTEND_SERVICES======CP" had to be
terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
An exception occurred. This exception is dealt with in more detail belo
. The exception, which is assigned to the class 'CX_SY_REF_IS_INITIAL',
neither
caught nor passed along using a RAISING clause, in the procedure
"GET_TEMP_DIRECTORY" "(METHOD)"
Since the caller of the procedure could not have expected this exceptio
to occur, the running program was terminated.
The reason for the exception is:
Attempt to access a component using 'NULL' object reference (points
to nothing).
An object reference must point to an object (an instance of a class)
before you can use it to access components (variable:
"CL_GUI_FRONTEND_SERVICES=>HANDLE").
Either the reference has not yet been set, or it has been reset to
'NULL' by a CLEAR statement.
When i put external break point and the dump comes during execution of CALL METHOD cl_gui_cfw=>flush.
Is it not possible to use CL_GUI_FRONTEND_SERVICES in RFC ??.
thanks and regards
JijoHi,
the dump is because you cannot use that function from a BSP application, which runs in internet or intranet. The procedure in this case is different:
DATA: flights TYPE flighttab,
flight LIKE LINE OF flights,
appl TYPE string,
filetype TYPE string,
output TYPE string,
output2 TYPE xstring,
response TYPE REF TO if_http_response,
l_len TYPE i,
seatsmax TYPE string,
seatsocc TYPE string.
appl = 'application/msexcel'.
filetype = 'attachment;filename=mi archivo.xls'.
SELECT * FROM sflight
INTO TABLE flights
UP TO 20 ROWS.
LOOP AT flights INTO flight.
seatsmax = flight-seatsmax. CONDENSE seatsmax.
seatsocc = flight-seatsocc. CONDENSE seatsocc.
CONCATENATE output
flight-carrid cl_abap_char_utilities=>horizontal_tab
flight-connid cl_abap_char_utilities=>horizontal_tab
flight-fldate cl_abap_char_utilities=>horizontal_tab
flight-planetype cl_abap_char_utilities=>horizontal_tab
seatsmax cl_abap_char_utilities=>horizontal_tab
seatsocc cl_abap_char_utilities=>horizontal_tab
cl_abap_char_utilities=>cr_lf
INTO output.
ENDLOOP.
response = runtime->server->response.
response->delete_header_field( name = if_http_header_fields=>cache_control ).
response->delete_header_field( name = if_http_header_fields=>expires ).
response->delete_header_field( name = if_http_header_fields=>pragma ).
response->set_header_field( name = if_http_header_fields=>content_type
value = appl ).
response->set_header_field( name = 'content-disposition'
value = filetype ).
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = output
mimetype = 'text/unicode; charset=utf-16le'
IMPORTING
buffer = output2.
CONCATENATE cl_abap_char_utilities=>byte_order_mark_little
output2 INTO output2 IN BYTE MODE.
l_len = XSTRLEN( output2 ).
response->set_data( data = output2
length = l_len ).
navigation->response_complete( ).
This is the code for downloading an Excel file. -
CALL METHOD cl_gui_frontend_services= file_save_dialog
Hi,
I want to use 'CALL METHOD cl_gui_frontend_services=>file_save_dialog', to choose a path for saving my txt files. I only want the user to be able to choose the path and not have to supply a filename aswell. My filenames are standard in the program and I don't want them to be changed by the user.
Is there another method which is designed for this or is there a simple parameter I have missed?
Thanks and regards,
Simon.AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_f.
PERFORM f_search_help_pa_f1.
FORM f_search_help_pa_f1 .
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = sy-repid
dynpro_number = sy-dynnr
CHANGING
file_name = pa_f
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f_search_help_pa_f1
Try this
Regards -
Error sending method invocation request(oc4j 10g(10.1.3.1))
Dear,
I have two applications a.ear and b.ear. They both are deployed on same oc4j container (10g(10.1.3.1))
Both applications use each others session beans. In order to make communications between these two applications possible I set global-jndi-lookup-enabled attribute in <application-server> element in server.xml file, to be true.
One of the applications use hibernate 3.1. According to some of posts from your forum, I replaced antlr.jar from toplink\jlib folder with one form with the one provided by the Hibernate 3 distribution.
In order to integrate Hibernate with Container managed transactions, I set in hibernate.cfg.xml:
hibernate.transaction.factory_class parameter to: org.hibernate.transaction.CMTTransactionFactory and
hibernate.transaction.manager_lookup_class to: org.hibernate.transaction.OC4JTransactionManagerLookup.
Everything works well since I save/update data in database. I save or update data, calling method from remote session bean.
I am getting java.lang.NullPointerException. Here is my error log:
2007-02-23 13:03:32.687 WARNING J2EE EJB-08002 [WorkflowManager] thread HTTPThreadGroup-12 encountered an exception while trying to end the transaction: oracle.oc4j.rmi.OracleRemoteException: An exception occurred during transaction completion: ; nested exception is:
javax.transaction.RollbackException
WARN processException, Unhandled Exception thrown: class com.ed.ecomm.edcore.exception.RepException
2007-02-23 13:03:32.750 ERROR ServletException cause
mermig > 13:03:32.765 ERROR SecurityFilter - EXCEPTION:
Error sending method invocation request; nested exception is:
java.lang.NullPointerException
javax.servlet.ServletException: Error sending method invocation request; nested exception is:
java.lang.NullPointerException
at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:423)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:410)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:259)
at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:50)
at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at com.ed.mermig2plus.web.filters.AuthorizationFilter.doFilter(AuthorizationFilter.java:115)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at com.ed.ecomm.edcore.web.filters.MonitoringFilter.doFilter(MonitoringFilter.java:180)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at com.ed.ecomm.edcore.web.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:93)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at com.ed.ecomm.edcore.web.filters.DoFilterPrivilegedAction.run(DoFilterPrivilegedAction.java:65)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:320)
at com.ed.ecomm.edcore.web.filters.jaas.OracleJAASProvider.performAction(OracleJAASProvider.java:166)
at com.ed.ecomm.edcore.web.filters.SecurityFilter.performAction(SecurityFilter.java:595)
at com.ed.ecomm.edcore.web.filters.SecurityFilter.doFilter(SecurityFilter.java:292)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:410)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:619)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:534)
Can you help me? I can not find anything about this exception
The same works for me in 10.1.2.0.2
Thanks and regards,
-- SmiljkaOC4J can work with many different DataSources implementations to work against many different databases. We have not hardcoded it work only against an Oracle database. We have reworked the Data Source area in 10.1.3 to make it simpler and more consistent.
I'd recommend having a read of the the J2EE Services Guide for 10.1.3 (http://download-west.oracle.com/otn/java/oc4j/1013/doc/web.1013/b14427.pdf)
and have a look at chapter 4 where our new and improved DataSource implementation s discussed.
-steve- -
Can I Call method on one JVM from another through a dll?
Let me explain.
I have this java jar file that I can only have one instance of running at any given time. I'm using a shared data segment in a dll to store a bool indicating whether the program is already running or not. If it's already running, I have to not run the second instance and give focus to the current running instance.
The jar file calls a native method "canInstantiate()" on a dll to see if there's already an app running. If there isn't, the env and obj are stored in the shared data segment of the dll and we return true. If there is already an instance of the program running, I want canInstantiate call a function on the current instance of the jar (like a callback) to tell it to request focus. It's not working. Can someone tell me if my code is right?
The .h file
#include "stdafx.h"
#include <jni.h>
#include "CardServer.h"
#pragma data_seg("SHARED") // Begin the shared data segment.
static volatile bool instanceExists = false;
static JavaVM *theJavaVM = NULL;
static JNIEnv* theJavaEnv= NULL;
static jobject instanceObject = NULL;
static jmethodID mid = NULL;
static jclass cls = NULL;
#pragma data_seg()
#pragma comment(linker, "/section:SHARED,RWS")
jdouble canInstantiate(JNIEnv *env, jobject obj);
jdouble instantiate(JNIEnv *env, jobject obj);
jdouble uninstantiate(JNIEnv *env, jobject obj);
void grabFocus();
</code>
The .cpp file:
<code>
#include "MyFunctions.h"
#include <string.h>
#include <stdlib.h>
#include "stdafx.h"
#include <iostream.h>
jdouble canInstantiate(JNIEnv *env, jobject obj)
printf("In canInstantiate!!");
if (!instanceExists)
printf("No instance exists!!");
return (jdouble)0.0;
else
printf("An instance already exists!!");
grabFocus();
return (jdouble)1.0;
jdouble instantiate(JNIEnv *env, jobject obj)
printf("**In CPP: Instantiate!!\n");
cout << "At start, env is: " << env << endl;
cout << "At start, obj is: " << obj << endl;
if (instanceExists == false)
instanceExists = true;
theJavaEnv = env;
instanceObject = obj;
theJavaEnv->GetJavaVM(&theJavaVM);
cls = (theJavaEnv)->FindClass("TheMainClassOfTheJar");
if (cls == 0) {
fprintf(stderr, "Can't find Prog class\n");
exit(1);
mid = (theJavaEnv)->GetMethodID(cls, "grabFocusInJava", "(I)I");
if (mid == 0) {
fprintf(stderr, "Can't find grabFocusInJava\n");
exit(1);
printf("About to call grabFocusInJava\n");
grabFocus();
printf("CPP: After the grab focus command in instantiate!!\n");
cout << "At end, env is: " << env << endl;
cout << "At end, obj is: " << obj << endl;
return 0.0;
else
printf("CPP: Finished Instantiate!!\n");
return 1.0;
jdouble uninstantiate(JNIEnv *env, jobject obj)
printf("CPP: In uninstantiate!!\n");
if (instanceExists == true)
instanceExists = false;
theJavaVM = NULL;
instanceObject = NULL;
printf("CPP: Finishing uninstantiate!!\n");
return 0.0;
else
printf("CPP: Finishing uninstantiate!!\n");
return 1.0;
void grabFocus()
printf("In CPP::GrabFocus!!\n");
instanceObject = theJavaEnv->NewGlobalRef(instanceObject);
cls = (theJavaEnv)->FindClass("CardFormatter");
if (cls == 0) {
fprintf(stderr, "Can't find Prog class\n");
exit(1);
printf("Got the cls id again!!\n");
if (cls == 0)
printf("IT'S INVALID!!\n");
mid = (theJavaEnv)->GetMethodID(cls, "grabFocusInJava", "(I)I");
if (mid == 0) {
fprintf(stderr, "Can't find grabFocusInJava\n");
exit(1);
theJavaEnv->CallIntMethod(instanceObject, mid, 2);
printf("Called grabFocusInJava\n");
</code>
thanks in advanceCan I Call method on one JVM from another through a dll
...The rest of your question merely expands on your title.
And the answer to that question is no.
When you call a method you are executing a "thread of execution." A thread of execution exists only in a single process. It can not exist in another process.
If the dll is doing some interesting things then you could call a method that sets a flag. Data can move between instances. But you would then have to have a thread in that different process monitoring that flag. And sharing data in a dll is not a normal process, so it would have to be coded appropriately.
If all you want to do is set the current focus to the existing application, then that can be done with existing windows functionality. You don't need to do anything special in your dll. You can probably search these forums to find the exact code. If not there are countless examples in windows repositories (like MSDN) on how to do that. -
Dear Experts,
I am using below piece of code in my program to control color of excel sheet while downloading same way I need to select the rows of R and need to format the cells
with currency with 2 decimal places.
Can any one please give me code for this.
Thanks in advance
karthik
*Color of Records .
DESCRIBE TABLE it_display LINES rec_lin .
grid_end = rec_lin + 5 . " .
CLEAR : start , end .
CONCATENATE 'A' head_pos INTO start .
CONCATENATE 'T' grid_end INTO end .
CONDENSE start NO-GAPS .
CONDENSE end NO-GAPS .
CALL METHOD OF excel 'Range' = range
EXPORTING #1 = start #2 = end.
CALL METHOD OF range 'Select' = select.
GET PROPERTY OF excel 'Selection' = selection .
CALL METHOD OF selection 'Font' = font .
SET PROPERTY OF font 'ColorIndex' = '41' .Hi,
tried following code:
data: value type string.
DATA: event TYPE REF TO if_htmlb_data,
tv_event type ref to cl_htmlb_event_tableview .
event = cl_htmlb_manager=>get_event( request ).
IF event IS NOT INITIAL AND event->event_name = htmlb_events=>tableView.
tv_event ?= event.
CASE event->event_server_name.
when 'MyEventRowSelection'.
value = tv_event->GET_CELL_VALUE(
row_index = tv_event->selectedrowindex
column_index = 2
But VALUE is empty.
Plz let me know the mistake in the syntax or elsewhere. -
Error when calling method INIT in class cl_hrxss_rem for salary statements
after configuring the our hrform to work with the new ess system in ecc 6.0 we configured the hrfor decision tree to $cedt$ and pointed the form variant to the edtin feature.
Now we are getting a class error.
com.sap.pcuigp.xssfpm.java.FPMRuntimeException: Error when calling method INIT of class CL_HRXSS_REM
at com.sap.pcuigp.xssfpm.java.MessageManager.raiseException(MessageManager.java:111)
at com.sap.pcuigp.xssfpm.java.MessageManager.raiseException(MessageManager.java:121)
at com.sap.xss.hr.rep.fcrfw.FcRepFramework.reportBapiRet2Error(FcRepFramework.java:525)
at com.sap.xss.hr.rep.fcrfw.FcRepFramework.callRfcExecAction(FcRepFramework.java:374)
at com.sap.xss.hr.rep.fcrfw.FcRepFramework.initModel(FcRepFramework.java:292)
at com.sap.xss.hr.rep.fcrfw.wdp.InternalFcRepFramework.initModel(InternalFcRepFramework.java:256)
at com.sap.xss.hr.rep.fcrfw.FcRepFrameworkInterface.initModel(FcRepFrameworkInterface.java:136)
at com.sap.xss.hr.rep.fcrfw.wdp.InternalFcRepFrameworkInterface.initModel(InternalFcRepFrameworkInterface.java:198)
at com.sap.xss.hr.rep.fcrfw.wdp.InternalFcRepFrameworkInterface$External.initModel(InternalFcRepFrameworkInterface.java:258)
at com.sap.xss.hr.rem2.selection.VcRem2Selection.onInit(VcRem2Selection.java:245)
at com.sap.xss.hr.rem2.selection.wdp.InternalVcRem2Selection.onInit(InternalVcRem2Selection.java:249)
at com.sap.xss.hr.rem2.selection.VcRem2SelectionInterface.onInit(VcRem2SelectionInterface.java:161)
at com.sap.xss.hr.rem2.selection.wdp.InternalVcRem2SelectionInterface.onInit(InternalVcRem2SelectionInterface.java:144)
at com.sap.xss.hr.rem2.selection.wdp.InternalVcRem2SelectionInterface$External.onInit(InternalVcRem2SelectionInterface.java:220)
at com.sap.pcuigp.xssfpm.wd.FPMComponent.doProcessEvent(FPMComponent.java:564)
at com.sap.pcuigp.xssfpm.wd.FPMComponent.doEventLoop(FPMComponent.java:438)
at com.sap.pcuigp.xssfpm.wd.FPMComponent.wdDoInit(FPMComponent.java:196)
at com.sap.pcuigp.xssfpm.wd.wdp.InternalFPMComponent.wdDoInit(InternalFPMComponent.java:110)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:108)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:430)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:362)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:748)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:283)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingPortal(ClientSession.java:733)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:668)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:73)
at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.sendDataAndProcessActionInternal(AbstractApplicationProxy.java:860)
at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.create(AbstractApplicationProxy.java:220)
at com.sap.portal.pb.PageBuilder.updateApplications(PageBuilder.java:1246)
at com.sap.portal.pb.PageBuilder.createPage(PageBuilder.java:354)
at com.sap.portal.pb.PageBuilder.init(PageBuilder.java:547)
at com.sap.portal.pb.PageBuilder.wdDoRefresh(PageBuilder.java:591)
at com.sap.portal.pb.PageBuilder$1.doPhase(PageBuilder.java:822)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processPhaseListener(WindowPhaseModel.java:755)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doPortalDispatch(WindowPhaseModel.java:717)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:136)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:313)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:684)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
ThanksHi,
Maintain the EDTIN feature
&CEDT$
And UR problem solve -
I am getting a error while using CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
The error is class "CL_SSF_XSF_UTILITIES is unknown. How to correct that?? please help I am new to object oriented programming??
Edited by: priya singh on Nov 18, 2008 2:14 PMThis is my code.
REPORT ZSAVE_FUNCTION .
D A T A D E C L A R A T I O N S *
DATA: v_bitmap TYPE xstring, "graphic data
v_file TYPE string, "file name
v_length TYPE i. "length of binary file
DATA: BEGIN OF it_bitmaps OCCURS 0,
object TYPE tdobjectgr, "object
name TYPE tdobname, "name
id TYPE tdidgr, "id
tdbtype TYPE tdbtype, "graphic type
END OF it_bitmaps.
DATA: itab TYPE TABLE OF x.
*class cl_ssf_xsf_utilities definition.
public section.
methods : get_bds_graphic_as_bmp
DATA: L_GRAPHIC_XSTR TYPE XSTRING.
*method cl_ssf_xsf_utilities
S E L E C T I O N - S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_object TYPE tdobjectgr, "object
p_btype TYPE tdbtype, "graphic type
p_name TYPE tdobname, "name
p_id TYPE tdidgr. "id
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: p_file TYPE rlgrap-filename. "file name
SELECTION-SCREEN END OF BLOCK b2.
*A T S E L E C T I O N - S C R E E N O N V A L U E - R E Q U E S T *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
*-- Creating f4 help for the parameters
PERFORM get_f4_object_name.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*-- Getting the current value entered
PERFORM get_current_value.
*-- Value Request Functionality For Input File Name
PERFORM f4_value_request.
S T A R T O F - S E L E C T I O N *
START-OF-SELECTION.
*--Getting the graphic as a BMP file
PERFORM get_graphic_bmp.
*--Convert the Xstring format to binary format
PERFORM convert_to_binary.
*--Download the graphic
PERFORM download_graphic.
*& Form get_current_value
Get the current file path entered
FORM get_current_value .
DATA: BEGIN OF li_dynp_value_tab OCCURS 0.
INCLUDE STRUCTURE dynpread.
DATA: END OF li_dynp_value_tab.
DATA: l_program_name LIKE d020s-prog,
l_dynpro_number LIKE d020s-dnum.
l_program_name = sy-cprog.
l_dynpro_number = sy-dynnr.
REFRESH li_dynp_value_tab.
li_dynp_value_tab-fieldname = 'P_FILE'.
APPEND li_dynp_value_tab.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = l_program_name
dynumb = l_dynpro_number
TABLES
dynpfields = li_dynp_value_tab
EXCEPTIONS
invalid_abapworkarea = 04
invalid_dynprofield = 08
invalid_dynproname = 12
invalid_dynpronummer = 16
invalid_request = 20
no_fielddescription = 24
undefind_error = 28.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE li_dynp_value_tab INDEX 1.
p_file = li_dynp_value_tab-fieldvalue.
ENDFORM. " get_current_value
*& Form f4_value_request
Provinding the f4 for the given path
FORM f4_value_request .
*-- if the file is to be downloaded to presentation server
CALL FUNCTION '/SAPDMC/LSM_F4_FRONTEND_FILE'
EXPORTING
pathname = p_file
CHANGING
pathfile = p_file
EXCEPTIONS
canceled_by_user = 1
system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f4_value_request
*& Form GET_GRAPHIC_BMP
Get the graphic as a BMP file
FORM get_graphic_bmp.
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = p_object
p_name = p_name
p_id = p_id
p_btype = p_btype
RECEIVING
p_bmp = L_GRAPHIC_XSTR
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " GET_GRAPHIC_BMP
*& Form CONVERT_TO_BINARY
Converting the xstring to binary format
FORM convert_to_binary .
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = v_bitmap
IMPORTING
output_length = v_length
TABLES
binary_tab = itab.
ENDFORM. " CONVERT_TO_BINARY
*& Form DOWNLOAD_GRAPHIC
Download the graphic
FORM download_graphic .
v_file = p_file.
CONCATENATE p_file '.BMP' INTO v_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_length
filename = v_file
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " DOWNLOAD_GRAPHIC
*& Form GET_F4_OBJECT_NAME
Get F4 values for object names
FORM get_f4_object_name .
DATA: dynpfld_mapping TYPE STANDARD TABLE OF dselc WITH HEADER LINE,
return_tab TYPE STANDARD TABLE OF ddshretval WITH HEADER LINE.
*--Selecting the values to be provided as f4 help
SELECT tdobject
tdname
tdid
tdbtype
FROM stxbitmaps
INTO TABLE it_bitmaps.
*--To update the values in the remaining fields
dynpfld_mapping-fldname = 'F0001'.
dynpfld_mapping-dyfldname = 'P_OBJECT'.
APPEND dynpfld_mapping.
dynpfld_mapping-fldname = 'F0002'.
dynpfld_mapping-dyfldname = 'P_NAME'.
APPEND dynpfld_mapping.
dynpfld_mapping-fldname = 'F0003'.
dynpfld_mapping-dyfldname = 'P_ID'.
APPEND dynpfld_mapping.
dynpfld_mapping-fldname = 'F0004'.
dynpfld_mapping-dyfldname = 'P_BTYPE'.
APPEND dynpfld_mapping.
*--Providing f4 help with the selected values
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'TDOBNAME'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_NAME'
value_org = 'S'
TABLES
value_tab = it_bitmaps
dynpfld_mapping = dynpfld_mapping
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " GET_F4_OBJECT_NAME -
Remote XML causes Exception Permission denied to call method XMLHttpRequest.open
Im using google page creator to host my domain, they don't
allow javascript or xml files (the correct mime type/content type
isnt presented so the browser just downloads the file). They do
however support html. I have uploaded the main html page to their
and the javascript files and xml files to my isp that allow .js
& .xml. However, when I call it I get a nice exception.
Exception caught while loading
http://www.logics.eclipse.co.uk/portfolio.xml:
Permission denied to call method XMLHttpRequest.open.
Any ideas how to get this working - full source to test is at
http://www.logics.co.uk/test.html
Cheers
Chris
Full source:
<script type="text/javascript" src="
http://www.logics.eclipse.co.uk/xpath.js"></script>
<script type="text/javascript" src="
http://www.logics.eclipse.co.uk/SpryData.js"></script>
<script type="text/javascript">
var dsCategories = new Spry.Data.XMLDataSet("
http://www.logics.eclipse.co.uk/portfolio.xml",
"portfolios/portfolio/site", { distinctOnLoad: true, sortOnLoad:
"site" });
var dsPortfolio = new Spry.Data.XMLDataSet("
http://www.logics.eclipse.co.uk/portfolio.xml",
"portfolios/portfolio");
</script>
<div spry:region="dsCategories dsPortfolio"
class="SpryHiddenRegion">
<div spry:repeat="dsCategories">
<div>{dsCategories::site}</div>
<div spry:repeat="dsPortfolio"
spry:test="'{dsCategories::site}' == '{dsPortfolio::site}'"
spry:setrow="dsPortfolio"><a href="{dsPortfolio::screenshot}"
target="_blank"><img src="{dsPortfolio::thumbnail}"
style="border: none;" alt=""/></a></div>
</div>
</div>I'm getting really frustrated by the inability to pull files
from another domain. I downloaded DW and am testing with Spry to
pull property info from a remote site which has dynamic xml files.
It seems incredibly silly to allow http requests to load data if
you can't do it across domains. I just don't see the point. I just
checked your test url fingersuk and I see you stil don't have a
fix.
It seems pointless to me that you need to set up a CF or PHP
script to pull the remote files to your local server as a proxy!
Surely that defeats the purpose of the whole Spry http request
idea. It's creating more work instead of saving it. Maybe I'm
missing something, it's late and I'm tired and frustrated!
Is it possible to use a domain policy XML file or something
with Spry to include an IP in a sites 'trusted realm'?
btw, the link posted by ajpowellatl is dead,
cheers,
Mike -
Call methods (which are in the servlet) in my response page
Hello !
I want to call methods which are in the servlet ( its name is ServletRecap) BUT the call is made in the response page which is generated by the servlet ServletRecap !
I just want to allow the user to update his choice in the response page.
example: i choice A in the initial form but i change my mind and now i want to choice B in the response page : the choice have to be update in the database.
the insertion in the DB is made by a method in the servlet : so i have to recall the method in the response page!
Please, anybody have an idea ?
my servlet :
public class ServletRecap extends HttpServlet {
// param�tres d'instance
private String urlErreurs = null;
private ArrayList erreursInitialisation = new ArrayList<String>();
private String[] param�tres = {"urlFormulaire", "urlReponse", "urlControleur", "lienRetourFormulaire"};
private Map params = new HashMap<String, String>();
// init
@SuppressWarnings("unchecked")
public void init() throws ServletException {
// on r�cup�re les param�tres d'initialisation de la servlet
ServletConfig config = getServletConfig();
// on traite les autres param�tres d'initialisation
String valeur = null;
for (int i = 0; i < param�tres.length; i++) {
// valeur du param�tre
valeur = config.getInitParameter(param�tres);
// param�tre pr�sent ?
if (valeur == null) {
// on note l'erreur
erreursInitialisation.add("Le param�tre [" + param�tres[i] + "] n'a pas �t� initialis�");
} else {
// on m�morise la valeur du param�tre
params.put(param�tres[i], valeur);
// l'url de la vue [erreurs] a un traitement particulier
urlErreurs = config.getInitParameter("urlErreurs");
if (urlErreurs == null) {
throw new ServletException(
"Le param�tre [urlErreurs] n'a pas �t� initialis�");
@SuppressWarnings("unchecked")
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
// on v�rifie comment s'est pass�e l'initialisation de la servlet
if (erreursInitialisation.size() != 0) {
// on passe la main � la page d'erreurs
request.setAttribute("erreurs", erreursInitialisation);
request.setAttribute("lienRetourFormulaire", "");
getServletContext().getRequestDispatcher(urlErreurs).forward(
request, response);
// fin
return;
// on r�cup�re la m�thode d'envoi de la requ�te
String m�thode = request.getMethod().toLowerCase();
// on r�cup�re l'action � ex�cuter
String action = request.getParameter("action");
// action ?
if (action == null) {
action = "init";
// ex�cution action
if (m�thode.equals("get") && action.equals("init")) {
// d�marrage application
doInit(request, response);
return;
if (m�thode.equals("post") && action.equals("validationFormulaire")) {
// validation du formulaire de saisie
doValidationFormulaire(request, response);
return;
if (m�thode.equals("post") && action.equals("enregistrementFormulaire")) {
// enregistrement du formulaire de saisie
doEnregistrementFormulaire(request, response);
return;
if (m�thode.equals("post") && action.equals("retourFormulaire")) {
// retour au formulaire de saisie
doRetourFormulaire(request, response);
return;
// autres cas
doInit(request, response);
// validation du formulaire
void doValidationFormulaire(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// on r�cup�re les param�tres
String nomCentre = (String) request.getParameter("nomCentre");
String idCentre = (String) request.getParameter("idCentre");
String nomPreleveur = (String) request.getParameter("nomPreleveur");
String datePrelev = (String) request.getParameter("datePrelev");
String numFinFiche = (String) request.getParameter("numFinFiche");
// qu'on m�morise dans la session
HttpSession session = request.getSession(true);
session.setAttribute("nomCentre", nomCentre);
session.setAttribute("idCentre", idCentre);
session.setAttribute("nomPreleveur", nomPreleveur);
session.setAttribute("datePrelev", datePrelev);
session.setAttribute("numFinFiche", numFinFiche);
// v�rification des param�tres
ArrayList<String> erreursAppel = new ArrayList<String>();
// le nom doit �tre non vide
nomCentre = nomCentre.trim();
idCentre = idCentre.trim();
nomPreleveur = nomPreleveur.trim();
datePrelev = datePrelev.trim();
numFinFiche = numFinFiche.trim();
if (nomCentre.equals("")) {
erreursAppel.add("Le champ [nomCentre] n'a pas �t� rempli");
if (idCentre.equals("")) {
erreursAppel.add("Le champ [idCentre] n'a pas �t� rempli");
if (nomPreleveur.equals("")) {
erreursAppel.add("Le champ [nomPreleveur] n'a pas �t� rempli");
if (datePrelev.equals("")) {
erreursAppel.add("Le champ [datePrelev] n'a pas �t� rempli");
if (!numFinFiche.matches("^\\s*\\d+\\s*$")) {
erreursAppel.add("Le champ [numFinFiche] est erron�");
// des erreurs dans les param�tres ?
if (erreursAppel.size() != 0) {
// on envoie la page d'erreurs
request.setAttribute("erreurs", erreursAppel);
request.setAttribute("lienRetourFormulaire", (String) params.get("lienRetourFormulaire"));
getServletContext().getRequestDispatcher(urlErreurs).forward(
request, response);
return;
// les param�tres sont corrects - on envoie la page r�ponse
request.setAttribute("nomCentre",nomCentre);
request.setAttribute("idCentre",idCentre);
request.setAttribute("nomPreleveur",nomPreleveur);
request.setAttribute("datePrelev",datePrelev);
request.setAttribute("numFinFiche",numFinFiche);
request.setAttribute("lienRetourFormulaire", (String) params.get("lienRetourFormulaire"));
getServletContext().getRequestDispatcher((String) params.get("urlReponse")).forward(request,
response);
return;
//enregistre dans la base de donn�e les variables
void doEnregistrementFormulaire(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
String nomCentre = (String) request.getParameter("nomCentre");
String idCentre = (String) request.getParameter("idCentre");
String nomPreleveur = (String) request.getParameter("nomPreleveur");
String datePrelev = (String) request.getParameter("datePrelev");
String numFinFiche = (String) request.getParameter("numFinFiche");
String nEtude = datePrelev + "." + idCentre + "." + numFinFiche;
// qu'on m�morise dans la session
HttpSession session = request.getSession(true);
session.setAttribute("nomCentre", nomCentre);
session.setAttribute("idCentre", idCentre);
session.setAttribute("nomPreleveur", nomPreleveur);
session.setAttribute("datePrelev", datePrelev);
session.setAttribute("numFinFiche", numFinFiche);
Connexion com = new Connexion();
try{
//serveur,login,pwd,database
com.loadDriverAndConnect("127.0.0.1","3306","root","root","");
com.execute("USE BIOTECH");
com.execute("INSERT INTO RECAP (NEtude,NomCentre,idCentre,nomPreleveur,datePrelev) " +
"values ('"+nEtude+"','"+nomCentre+"','"+idCentre+"','"+nomPreleveur+"','"+ datePrelev + "')") ;
com.close();
catch(Exception ex) {
System.err.println("\n*** SQLException caught in main()");
request.setAttribute("urlAction", (String) params.get("urlControleur"));
getServletContext().getRequestDispatcher((String) params.get("urlReponse")).forward(request,
response);
return;
// affichage formulaire pr�-rempli
void doRetourFormulaire(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
// on r�cup�re la session de l'utilisateur
HttpSession session = request.getSession(true);
// on pr�pare le mod�le du formulaire
// nom pr�sent dans la session ?
String nomCentre = (String) session.getAttribute("nomCentre");
if (nomCentre == null) {
session.setAttribute("nomCentre", "");
String idCentre = (String) session.getAttribute("idCentre");
if (idCentre == null) {
session.setAttribute("idCentre", "");
String nomPreleveur = (String) session.getAttribute("nomPreleveur");
if (nomPreleveur == null) {
session.setAttribute("nomPreleveur", "");
String datePrelev = (String) session.getAttribute("datePrelev");
if (datePrelev == null) {
session.setAttribute("datePrelev", "");
String numFinFiche = (String) session.getAttribute("numFinFiche");
if (numFinFiche == null) {
session.setAttribute("numFinFiche", "");
// urlAction
request.setAttribute("urlAction", (String) params.get("urlControleur"));
// on affiche le formulaire
getServletContext().getRequestDispatcher((String) params.get("urlFormulaire")).forward(
request, response);
return;
// post
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
// on passe la main au GET
doGet(request, response);
my initial form:%
// on r�cup�re les param�tres dans la session
String nomCentre=(String)session.getAttribute("nomCentre");
String idCentre= (String)session.getAttribute("idCentre");
String nomPreleveur = (String)session.getAttribute("nomPreleveur");
String datePrelev=(String)session.getAttribute("datePrelev");
String numFinFiche=(String)session.getAttribute("numFinFiche");
String urlAction=(String)request.getAttribute("urlAction");
%>
<html>
<head>
<title>Fiche répitulative - formulaire</title>
</head>
<body>
<center>
<img src="logoBiotech.jpg" align="left" alt="logo Biotech-Germande" width="5%"></img>
<h2>Fiche répitulative - formulaire</h2>
<br>
<hr>
<form action="<%= urlAction %>" method="post">
[... page setting: made by html language ...]
<td><input type="submit" name="action" value="validationFormulaire"></td>
<td><input type="reset" value="Rétablir"></td>
</tr>
</table>
</form>
</center>
</body>
</html>
my response page:<%
// on r�cup�re les donn�es
String nomCentre=(String)session.getAttribute("nomCentre");
String idCentre= (String)session.getAttribute("idCentre");
String nomPreleveur = (String)session.getAttribute("nomPreleveur");
String datePrelev=(String)session.getAttribute("datePrelev");
String numFinFiche=(String)session.getAttribute("numFinFiche");
String urlAction=(String)request.getAttribute("urlAction");
%>
<html>
<head>
<title>Fiche répitulative - formulaire</title>
</head>
<body>
<form action="<%= urlAction %>" method="post">
[... page setting: made by html language ...]
<br><br>
<td><input type="submit" name="action" value="enregistrementFormulaire"></td>
<td><input type="submit" name="action" value="retourFormulaire"></td>
</body>
</html>
my web.xml:<!-- Servlets -->
<!--Servlet Fiche Recapitulative-->
<servlet>
<servlet-name>FicheRecap</servlet-name>
<servlet-class>germande.ServletRecap</servlet-class>
<init-param>
<param-name>urlReponse</param-name>
<param-value>/WEB-INF/JSP/Recap/reponseRecap.biotech.jsp</param-value>
</init-param>
<init-param>
<param-name>urlErreurs</param-name>
<param-value>/erreursRecap.biotech.jsp</param-value>
</init-param>
<init-param>
<param-name>urlFormulaire</param-name>
<param-value>/WEB-INF/JSP/Recap/formulaireRecap.biotech.jsp</param-value>
</init-param>
<init-param>
<param-name>urlControleur</param-name>
<param-value>ServletRecap</param-value>
</init-param>
<init-param>
<param-name>lienRetourFormulaire</param-name>
<param-value>Retour au formulaire</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>FicheRecap</servlet-name>
<url-pattern>/ServletRecap</url-pattern>
</servlet-mapping>
</web-apps>
Thanks in advance for your idea.
I resume : how can I call a method in my servlet into my response page (in jsp).
the servlet generate this response page and i just want to update the choice of my user.
Thanks !!I resume : how can I call a method in my servlet into my response page (in jsp).Don't do that. Put the message into a plain old Java class which can be called from both the servlet and the JSP.
-
Error in pre-export methods for request
hi...
while releasing the TR we are facing this error msg..." Error in pre-export methods for request" it is showing lock in fornt of the TR.neither be able to delete the TR ....
do reply as soon as possible..Hi,
I had the same error PU238.
What I did was:
Execute SE03 to unlock the object.
Then execute the program 'RS_STREE_OBJECTS_TO_REQ_GET', not sure what it does.
Afterwards, it worked perfectly.
Hope that information helps you.
Regards, -
*ERROR IN OLE CALL - METHOD CALL ERROR...*
HI ..
When trying to Upload a file using BDC with Vista OS, we are getting the following error..
ERROR IN OLE CALL - METHOD CALL ERROR...
There is no problem with BDC as its working fine with XP & other OS.
Pls help!!Seems that you are working with microsoft files.
Maybe you are using deprecated functions like WS_EXCEL -
How to call methods from within run()
Seems like this must be a common question, but I cannot for the life of me, find the appropriate topic. So apologies ahead of time if this is a repeat.
I have code like the following:
public class MainClass implements Runnable {
public static void main(String args[]) {
Thread t = new Thread(new MainClass());
t.start();
public void run() {
if (condition)
doSomethingIntensive();
else
doSomethingElseIntensive();
System.out.println("I want this to print ONLY AFTER the method call finishes, but I'm printed before either 'Intensive' method call completes.");
private void doSomethingIntensive() {
System.out.println("I'm never printed because run() ends before execution gets here.");
return;
private void doSomethingElseIntensive() {
System.out.println("I'm never printed because run() ends before execution gets here.");
return;
}Question: how do you call methods from within run() and still have it be sequential execution? It seems that a method call within run() creates a new thread just for the method. BUT, this isn't true, because the Thread.currentThread().getName() names are the same instead run() and the "intensive" methods. So, it's not like I can pause one until the method completes because they're the same thread! (I've tried this.)
So, moral of the story, is there no breaking down a thread's execution into methods? Does all your thread code have to be within the run() method, even if it's 1000 lines? Seems like this wouldn't be the case, but can't get it to work otherwise.
Thanks all!!!I (think I) understand the basics.. what I'm confused
about is whether the methods are synced on the class
type or a class instance?The short answer is; the instance for non-static methods, and the class for static methods, although it would be more accurate to say against the instance of the Class for static methods.
The locking associated with the "sychronized" keyword is all based around an entity called a "monitor". Whenever a thread wants to enter a synchronized method or block, if it doesn't already "own" the monitor, it will try to take it. If the monitor is owned by another thread, then the current thread will block until the other thread releases the monitor. Once the synchronized block is complete, the monitor is released by the thread that owns it.
So your question boils down to; where does this monitor come from? Every instance of every Object has a monitor associated with it, and any synchronized method or synchonized block is going to take the monitor associated with the instance. The following:
synchronized void myMethod() {...is equivalent to:
void myMethod() {
synchronized(this) {
...Keep in mind, though, that every Class has an instance too. You can call "this.getClass()" to get that instance, or you can get the instance for a specific class, say String, with "String.class". Whenever you declare a static method as synchronized, or put a synchronized block inside a static method, the monitor taken will be the one associated with the instance of the class in which the method was declared. In other words this:
public class Foo {
synchronized static void myMethod() {...is equivalent to:
public class Foo{
static void myMethod() {
synchronized(Foo.class) {...The problem here is that the instance of the Foo class is being locked. If we declare a subclass of Foo, and then declare a synchronized static method in the subclass, it will lock on the subclass and not on Foo. This is OK, but you have to be aware of it. If you try to declare a static resource of some sort inside Foo, it's best to make it private instead of protected, because subclasses can't really lock on the parent class (well, at least, not without doing something ugly like "synchronized(Foo.class)", which isn't terribly maintainable).
Doing something like "synchronized(this.getClass())" is a really bad idea. Each subclass is going to take a different monitor, so you can have as many threads in your synchronized block as you have subclasses, and I can't think of a time I'd want that.
There's also another, equivalent aproach you can take, if this makes more sense to you:
static final Object lock = new Object();
void myMethod() {
synchronized(lock) {
// Stuff in here is synchronized against the lock's monitor
}This will take the monitor of the instance referenced by "lock". Since lock is a static variable, only one thread at a time will be able to get into myMethod(), even if the threads are calling into different instances. -
How to Call Methods in Ecatt?
Hello Gurus,
I dont find CALLMETHOD or CALLSTATIC commands in Ecatt. I am using R/3 4.7 version of SAP.
My question also is how to call methods. I have a scenario where my test script execution depends on the return type of method. Say if the return type of method is A only then I should run the script else the script should not be executed.
Your help in this regard is highly appreciated.
Regards,
GS.>
Get Started wrote:
> Hello Gurus,
>
> I dont find CALLMETHOD or CALLSTATIC commands in Ecatt. I am using R/3 4.7 version of SAP.
>
> My question also is how to call methods. I have a scenario where my test script execution depends on the return type of method. Say if the return type of method is A only then I should run the script else the script should not be executed.
>
> Your help in this regard is highly appreciated.
>
> Regards,
> GS.
Hi GS,
Please use the command "CallMethod" and it is available with latest SAP version.
You have to provide the Object Instance Parameter and Instance Method.
Regards,
SSN.
Maybe you are looking for
-
SQL Server Express 2008 R2 - Connect to Server Error
I have recently downloaded and installed SQL Server 2008 R2 on a new laptop (Windows 7). The install completed successfully and I encountered no issues. However, when I start SQL Server Management Studio, I am unable to connect to my server instanc
-
Substitution of Account Assignment from Asset Master Data
Hi Gurus, System is not picking up cost center master data in FI document posting in the following scenario: Posting in Asset through a transaction type which only post to non leading ledger, cost center is not getting populated in the FI document po
-
Use of input type="file"
Hellow How can I use the HTML tag <input type="file" > in jsp/servlets ? how can I got the file and saving it?
-
ORA-27092 when running startsap
Hi All, We have a weird one. Following a reboot of out AIX 6.1 box, we are unable to start SAP as it fails when starting the database: Caused by: java.sql.SQLException: ORA-01116: error in opening database file 5 ORA-01110: data file 5: '/oracle/EPD/
-
Hello All - I'm having a problem interacting with my OPC server, and I'm hoping some suggestions will help me out here. I have an OPC server running on a XP SP2 machine, and it is interacting properly with my equipment (a bioreactor). When I use the