How can the servlet engine create objects of interfaces?help
hello,
I have this basic fundamental query...when using servlets i noticed that so many methods in the HttpServlet class take as arguments objects of the type "Interface"..where as basic principle in java is u cant instantiate interfaces...interfaces r mere templates which u implement by ur own custom classes.
For example the doGet method recieves from the servlet engine(servlet container) two arguments which r HttpServletResponse object and HttpServletRequest object..and u use these further to make use of the methods of the inmterfaces..which again is a mystery to me...why?
here is why:-
since HttpServletResponse and HttpServletRequest r interfaces..they cant be instantiated...and now that the sevlet engine provides objects of these interfaces...how come u r able to to use the methods of these interfaces...for r they not empty methods?..
example how r u able to make the sendRedirect() method of HttpServletResponse interface work...is this method not an empty method?
there r several interfaces...whose objects r being used and passed in this similar fashion....(for example there r many methods that return an enumeration...which is used as if it were an ordinary class that can be instantiated..and whose methods r non empty emthods)
please help me resolve this mystery
sheeba
Don't call me "u". The word is "you". Likewise "are" and not "r".
The servlet engine creates objects of concrete classes that implement those interfaces. If you want to find the names of those classes in your particular server, you could use for examplereq.getClass().getName()
Similar Messages
-
How can I importing when create object?
Hi Gurus,
Im beginner with OO Abap. Please give me a hand with this.
Im using the programming interface REPORT Z_TEST_ST_TEXT_EDITOR for text editor found on /people/igor.barbaric/blog/2005/06/06/the-standard-text-editor-oo-abap-cfw-class which is good and useful for me (highly recommended) but I need to import the text created (t_text) in method constructor in order to send it via e.mail.
Could anybody tell me how to get/import the text created?
Thank you in advance.
Below is the coding. (program which uses the developed class and method consisting the created text)
DATA: o_txe TYPE REF TO <b>zcl_standard_text_editor</b>,
v_caption TYPE char100,
s_thead TYPE thead.
call screen
CALL SCREEN 0100.
MODULE s0100_start
MODULE s0100_start OUTPUT.
SET PF-STATUS 'BASIC'.
s_thead-tdname = 'VENDOR0000000011'.
s_thead-tdid = 'ST'.
s_thead-tdobject = 'TEXT'.
s_thead-tdspras = sy-langu.
CONCATENATE 'Standard text:' s_thead-tdname
INTO v_caption SEPARATED BY space.
IF o_txe IS INITIAL.
<b> CREATE OBJECT o_txe</b>
EXPORTING i_thead = s_thead
i_caption = v_caption.
<b>IMPORTING????</b>
ENDIF.
ENDMODULE.
<b>method CONSTRUCTOR</b>.
DATA: o_dialogbox TYPE REF TO cl_gui_dialogbox_container,
t_text TYPE STANDARD TABLE OF tdline,
s_event TYPE cntl_simple_event,
t_events TYPE cntl_simple_events,
t_lines TYPE STANDARD TABLE OF tline,
v_text TYPE tdline,
v_text_temp TYPE tdline,
v_line_temp TYPE tdline,
v_line_len TYPE i,
v_index TYPE i.
FIELD-SYMBOLS: <line> TYPE tline.
me->thead = i_thead.
me->caption = i_caption.
*------ containers
IF i_container IS INITIAL.
CREATE OBJECT o_dialogbox
EXPORTING top = 50
left = 200
height = 150
width = 500
caption = i_caption.
me->main_container = o_dialogbox.
SET HANDLER me->on_container_close FOR o_dialogbox.
ELSE.
me->main_container = i_container.
ENDIF.
IF me->splitter IS INITIAL.
CREATE OBJECT me->splitter
EXPORTING
parent = me->main_container
orientation = me->splitter->orientation_vertical
sash_position = 10. "percentage of containers
------ toolbar
CREATE OBJECT me->toolbar
EXPORTING parent = me->splitter->top_left_container.
CALL METHOD me->toolbar->add_button
EXPORTING fcode = me->c_save
is_disabled = ' '
icon = '@2L@' "icon_system_save
butn_type = cntb_btype_button.
CALL METHOD me->toolbar->add_button
EXPORTING fcode = me->c_close
is_disabled = ' '
icon = '@3X@' "icon_close
butn_type = cntb_btype_button.
*------ register events
REFRESH t_events.
s_event-eventid = cl_gui_toolbar=>m_id_function_selected.
s_event-appl_event = ' '.
APPEND s_event TO t_events.
CALL METHOD me->toolbar->set_registered_events
EXPORTING events = t_events.
SET HANDLER: me->on_toolbar_func_sel FOR me->toolbar.
*------ create textedit control
CREATE OBJECT me->textedit
EXPORTING parent = me->splitter->bottom_right_container.
ENDIF.
get text
CALL FUNCTION 'READ_TEXT'
EXPORTING ID = me->thead-tdid
LANGUAGE = me->thead-tdspras
NAME = me->thead-tdname
OBJECT = me->thead-tdobject
TABLES LINES = t_lines
EXCEPTIONS ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
*------- convert text to text editor format
LOOP AT t_lines ASSIGNING <line>.
IF <line>-tdformat = space OR <line>-tdformat = '=' OR sy-tabix = 1.
v_line_temp = <line>-tdline.
CONCATENATE v_text v_line_temp INTO v_text_temp.
ELSE.
CONCATENATE: cl_abap_char_utilities=>cr_lf <line>-tdline
INTO v_line_temp.
CONCATENATE v_text v_line_temp INTO v_text_temp.
ENDIF.
IF sy-subrc = 0.
v_text = v_text_temp.
ELSE.
APPEND v_text TO t_text.
v_text = v_line_temp.
ENDIF.
ENDLOOP.
IF sy-subrc = 0.
APPEND v_text TO <b>t_text</b>.
ENDIF.
*------- display text
CALL METHOD me->textedit->set_text_as_stream
EXPORTING text = t_text.
me->t_initial_text = t_text.
endmethod.good book on ABAP objects(OOPS)
http://www.esnips.com/doc/bc475662-82d6-4412-9083-28a7e7f1ce09/Abap-Objects---An-Introduction-To-Programming-Sap-Applications
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
http://www.allsaplinks.com/
http://www.sap-img.com/
http://www.sapgenie.com/
http://help.sap.com
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://www.sapgenie.com/abap/controls/index.htm
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
these links
http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
For funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
Rewards if useful......................
Minal -
Can we create objects with interface
can we create objects with interface,if yes then where we implement the
methods,can we type cast any object with inerface kind of object,if yes what kind
of objects we can type castcan we create objects with interface,if yes then where we implement the
methods
Objects are created with classes, not interfaces, which are abstract.
can we type cast any object with inerface kind of object,if yes what kind
of objects we can type cast
Objects may be cast to interfaces, but only if an object's class or one of its superclasses actually implements the interface. -
How to restart the Servlet Engine?
Hi
I am configurating a WebDAV repository in KM
I am required to restart the Servlet Engine.
Can anyone please explain me how to restart the servlet engine.
Thanks in advance
-madhuBasically it means to restart the Java engine!
On way to do this is to use the NetWeaver Administrator tool (http://portal:port/nwa) and navigate to Administration -> Systems -> <Your SID> and then you will see your dispatcher and server nodes. Just restart the server0..n nodes.
Cheers -
While creating a device category i'm getting an error "enter a valid division via eg01,how can the error be overcome?
Neha,
you can do in two ways.
1. Enter a valid Division which you configured in the system.
2. Remove the Division as required field. However I suggest it should have a valid division. Why can not you check with your Functional owner?
Linganna Katigiri -
How can I find movies created in past versions of iMovie? They are still on you tube but I want the original higher quality versions and I can't find them anymore.
Paul -
I'm sorry you've lost files, but when you set up an account as Guest, there's a message that clearly states "When a guest user logs out, all information and files in the guest account's home folder are deleted". If you want an account where files are retained, you should create an Admin or Standard type.
You will need to use data recovery techniques to see if your file can be recovered. The more that you use your computer, the greater the risk that the file will be overwritten. You can contact a professional data recovery service such as DriveSavers (which will be expensive, but you can judge the value of the file) or try something like Data Rescue. The latter has a demo which you can install to determine if your file can be recovered, and then, on purchase, you can actually recover the file.
Good luck!
Matt -
Can the servlet/jsp engine be brought down
Hello,
Can the servlet/jsp engine be scheduled for a "in-house patch" not affecting
the EJB Container? That means the jsp/servlet engine is brought down.
(HotDeploy is a development feature). Does any version of WebLogic provide
any way to do this?
It is a single VM and I suppose that this is not possible. Just thinking out
loud!!
Thanks
Gaurav
Sorry, but there's no way to apply a hot-patch to the server. Good idea, but
very tricky to implement!
If you were using a cluster with session-replication, you can cycle the
servers one at a time. The other servers will pick up where the
downed-server was working. You can then apply the patch, and bring up the
server again. Give it a few minutes (an hour to be safe!) to replicate from
the running server, then cycle the other server safely.
Alex
"Gaurav Khanna" <[email protected]> wrote in message
news:3c7c1256$[email protected]..
> Hello,
>
> Can the servlet/jsp engine be scheduled for a "in-house patch" not
affecting
> the EJB Container? That means the jsp/servlet engine is brought down.
> (HotDeploy is a development feature). Does any version of WebLogic provide
> any way to do this?
> It is a single VM and I suppose that this is not possible. Just thinking
out
> loud!!
>
> Thanks
> Gaurav
>
>
>
>
-
How can i reference a MIME object within a correspondence format through...
how can i reference a MIME object within a correspondence format through TX oofo or se71?
Hi, I need to put a MIME object within a correspondence's format that i've already done through Tx oofo. My problem is, that i don't know exactly how can i make the reference of that MIME object in the format? and What structure type do i have to use in order to make appear the MIME object in my correspondence's format? Does anybody can help me with this?
Regards HectorFrank,
I tried to find some examples/samples on how to create CollectionModel for a table component but not successful.
Can you clarify the following ?
1. "CollectionModel" is referenced only by af:table attributes "value", "selectedRowKeys" and "selectionListener".
The rest of af:table attributes such as "rows", "fetchSize" used to reference the iterator binding in the binding container via the EL expression "#{bindings.VOIteratorBinding.xxx} .
What should I replace that EL expression with?
2. I heck out the bean method to create the CollectionModel as following, is it close to what you mean?
public void initBusinessDataDashboardView() {
OperationBinding operation = BeanUtils.getOperationBinding("getPanelBusinessData");
Map params = operation.getParamsMap();
Key panelKey = getPanelInfoView().getKey();
params.put("panelKey", panelKey);
params.put("maximizedView", false);
panelView = (ViewObject)operation.execute();
// Heck code to create CollectionModel
RowSet rowSet = panelView.getRowSet();
ArrayList rowList = new ArrayList();
while (rowSet.hasNext()) {
rowList.add(rowSet.next());
model = new ChildPropertyTreeModel(rowList, null);
// To be used to set up af:table value, selectRowKeys, selectionListener via EL expr #{backingBeanScope.MyBean.model.xxx}
public CollectionModel getModel() {
return model;
Am I on the right track?
Edited by: Pricilla on May 4, 2010 2:20 PM -
How can I find out what objects are in a datafile???
My database is 8.1.7...
I have a tablespace with multiple datafiles. How can I find out what objects are in a specific datafile???
Thanks in advance...DBA_SEGMENTS
DBA_SEGMENTS describes the storage allocated for all segments in the database.
Related View
USER_SEGMENTS describes the storage allocated for the segments owned by the current user's objects. This view does not display the OWNER, HEADER_FILE, HEADER_BLOCK, or RELATIVE_FNO columns.
Column Datatype NULL Description
OWNER
VARCHAR2(30)
Username of the segment owner
SEGMENT_NAME
VARCHAR2(81)
Name, if any, of the segment
PARTITION_NAME
VARCHAR2(30)
Object Partition Name (Set to NULL for non-partitioned objects)
SEGMENT_TYPE
VARCHAR2(17)
Type of segment: INDEX PARTITION, TABLE PARTITION, TABLE, CLUSTER, INDEX, ROLLBACK, DEFERRED ROLLBACK, TEMPORARY, CACHE, LOBSEGMENT and LOBINDEX
TABLESPACE_NAME
VARCHAR2(30)
Name of the tablespace containing the segment
HEADER_FILE
NUMBER
ID of the file containing the segment header
HEADER_BLOCK
NUMBER
ID of the block containing the segment header
BYTES
NUMBER
Size in bytes, of the segment
BLOCKS
NUMBER
Size, in Oracle blocks, of the segment
EXTENTS
NUMBER
Number of extents allocated to the segment
INITIAL_EXTENT
NUMBER
Size in bytes requested for the initial extent of the segment at create time. (Oracle rounds the extent size to multiples of 5 blocks if the requested size is greater than 5 blocks.)
NEXT_EXTENT
NUMBER
Size in bytes of the next extent to be allocated to the segment
MIN_EXTENTS
NUMBER
Minimum number of extents allowed in the segment
MAX_EXTENTS
NUMBER
Maximum number of extents allowed in the segment
PCT_INCREASE
NUMBER
Percent by which to increase the size of the next extent to be allocated
FREELISTS
NUMBER
Number of process freelists allocated to this segment
FREELIST_GROUPS
NUMBER
Number of freelist groups allocated to this segment
RELATIVE_FNO
NUMBER
Relative file number of the segment header
BUFFER_POOL
VARCHAR2(7)
Default buffer pool for the object
This view with this another viwe can help you to identify where the object is:
DBA_DATA_FILES
DBA_DATA_FILES describes database files.
Column Datatype NULL Description
FILE_NAME
VARCHAR2(513)
Name of the database file
FILE_ID
NUMBER
NOT NULL
File identifier number of the database file
TABLESPACE_NAME
VARCHAR2(30)
NOT NULL
Name of the tablespace to which the file belongs
BYTES
NUMBER
Size of the file in bytes
BLOCKS
NUMBER
NOT NULL
Size of the file in Oracle blocks
STATUS
VARCHAR2(9)
File status: AVAILABLE or INVALID (INVALID means that the file number is not in use, for example, a file in a tablespace that was dropped)
RELATIVE_FNO
NUMBER
Relative file number
AUTOEXTENSIBLE
VARCHAR2(3)
Autoextensible indicator
MAXBYTES
NUMBER
Maximum file size in bytes
MAXBLOCKS
NUMBER
Maximum file size in blocks
INCREMENT_BY
NUMBER
Autoextension increment
USER_BYTES
NUMBER
Corresponding number of bytes
USER_BLOCKS
NUMBER
Number of blocks which can be used by the data
Joel Pérez
http://otn.oracle.com/experts -
How does the servlet implement the multi-thread feature?
There is only one instance of every servlet in one wep application.
When several clients invoke the doPost() method of the same servlet,the servlet can process their request respectively.
So there much multi threads of one servelt.
But the Servlet doesn't implement the Runnable interface of extends the Thread class.
I wan't to know,how does the servlet/servlet container implement the multi-thread feature?Hi johnnylzb
There is only one servlet instance existing.
(assuming u have <load-on-startup>1</load-on-startup>)
The server creates a thread for every request ..
and all the threads access the same servlet instance.
For this its not necessary for the Servlet to extend Thread or Runnable.
hope this helps -
How can we avoid cloning an object?
how can we avoid cloning an object?
maddy123 wrote:
writing a singleton class but i want avoid the client to implement the cloneable for creating objectsHuh? What makes you think that's going to happen? Sounds like you have trust issues amongst developers, which would be better fixed by non-technical means -
How can we send a collection object to server?
Hi All
I am beginner in Flex. I have an assignment to do, plz help
in this.
How can we send a collection object to server?
Means:
I have a list of user details in a grid.
And if i want to add a new User or edit a existing user
details then i don’t want to send a request every time.
Instead of i want to keep adding new User only in front side
i.e. in the grid
And finally i will send a single request with all the Users
details.
can it be possible ? If possible please help me.
Thanks in advanceActually, the best way to do is using amfphp but since you
are new to flex it might be a bit confusing if you dont know php.
check here for amfphp:
http://www.amfphp.org/
you can also traverse through the arraycollection and create
and xml. (this part is basic programming). Then you can send it to
server using a post.
For that think check the liveDocs for classes:
HTTPService
and
URLLoader. -
What is the default root of the servlet engine in IPlanet v6?
I am trying to get java based code to work on IPlanet's webserver/servlet engine version 6. The servlets are being inited, but they can't find their .properties files (xml variable files). I have been able to install this code on many servlet engines including JRun, Tomcat, and Jserv by placing the .property files into the default root of the servlet engine. In JRun, for example, it would be Allaire/Jrun/servers/default. I have tried placing them in several directories and adding them individually to the classpath, but still no luck. Any help would be greatly appreciated.
Hi,
Please place your claspath in jvm12.conf file.
Which will be under /server-root/https-instance/config/jvm12.conf.
For more info about how to set classpath for running servlet. Please look out the below link.
http://docs.iplanet.com/docs/manuals/enterprise/50/servlets/serv.htm#17272
http://docs.iplanet.com/docs/manuals/enterprise/50/servlets/xjvm.htm#21181
http://docs.iplanet.com/docs/manuals/enterprise/50/pg/2-config.htm#1069613
I hope this helps.
Regards,
Dakshin.
Developer Technical Support
Sun Microsystems
http://www.sun.com/developers/support. -
How can we assign sproxy generated objects to a different package?
Hello Expert,
We need to change the package assigment of sproxy generated DDIC objects. How can we assign sproxy generated objects to a different package?
Regards,
ThulasiAny idea?
-
(Fifth futile attempt in two hours, before I learned there was a Post webpage – I’m new to ApSuppCom - and after I learned that I am not allowed to update previous content, so I had to back out, make a few changes, and start over.) How can I export slideshows created in Aperture v3.3.2 (complete with superimposed captions and music tracks) from Mid-2009 MacBook Pro-17 to blank DVDs ? (Some other specs: Mac OS Lion 10.7.5; Capacity 499.5 GB; Processor 2.8 GHz Intel Core 2 Duo; Memory 4GB 1067 MHz DDR3; Graphics NVIDIA GeForce 9400M 256MB)
I cannot do a copy (export) without various error messages appearing and the inevitable stoppage occurring. Always with the DVD Video Player final message reading, “Supported disc not available.” Advisors and Mac Geniuses at local Apple Stores have told me to try Roxio Toast. When I visited the Roxio website, and found numerous other company products, the descriptions all seemed to suggest that most of the apps shown can easily export videos to DVDs, but nothing was said about finished digital slide shows being exported. At future events soon, I hope to be handing out these finished DVDs (free) to the people in them. Any help will be greatly appreciated. A.Z.How can I export slideshows created in Aperture v3.3.2 (complete with superimposed captions and music tracks) from Mid-2009 MacBook Pro-17 to blank DVDs ?
Aperture cannot burn slideshows to a DVD. It only can export a video of your slideshow.
In Aperture 3 you use the "Export" button in Aperture's slideshow project to render a video to a folder on your disk.
Then you use iDVD or another program to burn a video DVD.
I cannot do a copy (export) without various error messages appearing and the inevitable stoppage occurring. Always with the DVD Video Player final message reading, “Supported disc not available.”
Could you please describe the exact steps that are causing these error messages?
How are you exporting your slideshow from Aperture? Which settings are you using? And how are you importing the video to iDVD or Toast to burn a video DVD?
For more suggestions see Karsten Schlüter's user tip: How to create a video-DVD? (Macs without iDVD)
Maybe you are looking for
-
Hi, Is it possible to load a loop in logic 8 which can automatically auto sync to the tempo like in ableton live ? I red on the manual that in order to be tempo synced, a loop must be : -apple loop format -bounce from logic and saved in the audio bin
-
Weblogic 10.3.0.0 installer - Failed to contact Server
When clicking 'Next' on the 'Specify Download Options' portion of the wizard I get an error message "Failed to contact Server" Anyone know why I recieved this message or how I can get around it?
-
Regarding header proble in FM GUI_download.
Hi, I want to write header in XL file by using the paramter fieldnames, but the FM is not considering full text what i m giving , please see the below code *To download DATA : BEGIN OF t_header OCCURS 0, name(100) TYPE c, END OF t_heade
-
We have been battling with this problem for 2 years now and have raised calls with Microsoft and EMC both of which have not resulted in a resolution. We have an 8 node CSV with about 40 virtual servers on it. The Hyper-V hosts are Windows 2008 R2 SP
-
Hi, I have a database ver. 9.2.0.2.1 on Windows 2000 SP4 and have created a database user call EXPUSER to perform exports and imports. It's been give the CONNECT, EXP_FULL_DATABASE and IMP_FULL_DATABASE roles. In earlier version, this practice was su