Knowing the type of content?

Here's the problem i have a jsp and wml version of web application. I am using struts. In my actionservlet i need to know the content type so i can forward the user to either the jsp or wml version. The WML version of the web app resides on /wml/ and the jsp version resides on /
I've tried the following:
System.out.print("Content:" + ((ServletRequest) response).getContentType());
java.lang.ClassCastException: weblogic.servlet.internal.ServletResponseImpl
tried:
System.out.print("Content:" + response.getContentType());
undefined for httpservletrequestany ideas?

Yes, that's right. A request doesn't really have a content type. However if your real question is how you find out whether the request came from a WAP browser or a PC browser, you don't look at the content type anyway. I don't remember what it is you do look at but I'm sure that must be covered very early in the tutorial about writing wireless applications.

Similar Messages

  • Getting the type in content assist extension

    Hello,
    In a plugin which extends the JDT, I need to add proposals to the content assist.
    To do that, I would like to know the type of the prefix expression.
    For example, when the user enters the code below, Eclipse gives in the content assist the methods of the Random class :
    Random random = new Random();
    random.
    So the proposal computer finds the type of the "random" variable.
    How does it work ?
    Regards,
    Romain.

    Hello Joy,
    Actually you don't need to do this, you can use the method GET_RELATIVE_NAME( ) to do the job for you!
    DATA: gr_struct       TYPE REF TO cl_abap_structdescr,
          gt_components   TYPE cl_abap_structdescr=>component_table,
          gs_component    TYPE cl_abap_structdescr=>component,
          gv_actual_name  TYPE string.
    * Get the interface structure fields
    gr_struct ?= cl_abap_typedescr=>describe_by_name( 'ZIF_TEST=>STR01' ).
    gt_components = gr_struct->get_components( ).
    LOOP AT gt_components INTO gs_component.
    * Get actual name
      gv_actual_name = gs_component-type->get_relative_name( ).
      WRITE: / gv_actual_name.
    ENDLOOP.
    If you want more DDIC details for the fields, you can try this way:
    DATA: gr_element TYPE REF TO cl_abap_elemdescr.
    LOOP AT gt_components INTO gs_component.
      gr_element ?= gs_component-type. "Narrow Casting
      gs_fieldinfo = gr_element->get_ddic_field( ). "Get the DDIC info
      WRITE: / gs_fieldinfo-rollname.
    ENDLOOP.
    BR,
    Suhas
    Edited by: Suhas Saha on Jan 31, 2012 2:57 PM

  • How to know the type of a variable??

    how to know the type of a variable??
    For example, give you a variable s, how to determine if it is
    a primitive type, of an object?? If this is primitive type,
    any ways to determine if it is integer, boolean, double, ...??

    I am currently working on a project where this happens. I have a main type of object that all of my other types extend. While working on the objects in a method, any type of other object could be coming through. To test I try to cast the object and catch class cast exceptions. This only works because I know the different type that will be coming through....
    public void testObject(classX object){
      try{
        classY object = (classY)object;
      }catch(ClassCastException CC){
        try{
          classZ object = (classZ)object;
        }catch(ClassCastException CCC){
          /// the object fails to be cast as the types I tested for.
    }

  • Can we know the type of DB?

    Gurus,
    Can any one tell me, how to find out the type of Databases installed by using a query.
    That means, if the databases is of " General purpose / Tranasaction pupose / Data Ware house" how t oknow after instalaltion of the databases ?

    Hi,
    If you wnat know what options are installed then try this:
    select * from v$option;
    or
    set head off feed off pages 0 serveroutput on
    col banner format a72 wrap
    select banner
    from   sys.v_$version;
    select '   With the '||parameter||' option'
    from   sys.v_$option
    where  value = 'TRUE';
    select '   The '||parameter||' option is not installed'
    from   sys.v_$option
    where  value <> 'TRUE';
    begin
        dbms_output.put_line('Port String: '||dbms_utility.port_string);
    end;
    /

  • How to know the type of mobile?

    how to get the type of mobile model mean under nokia asha 308(rm 352/ rm 838) which model i have when i am buying this mobile .no option to check the *#0000# option then how to get this..

    Check the label on the box or under the battery.

  • How to know the type of transactions by seeing the data in IP_IN_QUEUE

    Hi B2B gurus,
    I am Using EDI X12 over internet. Our suppliers processing inbound transactions to us,After receiving from B2B its storing in IP_IN_Queue, The documents which we are sending it storing in IP_OUT_Queue.
    We want to see the data in in IP_IN_QUEUE, Could you please tell in which table the data will store, And can we see the payload or can we know actually which transactions by seeing the data in table? Could you please help by giving this information...?
    regards
    srinivas k

    As I mentioned earlier view "b2b_instancemessage" has "payload" column which stores the payload of both incoming and outgoing messages.
    Below query will return all the rows of this view which has payload -
    select * from b2b_instancemessage where payload is not null;
    Remember, it's a BLOB type field so either use a client like PL-SQL Developer or TOAD otherwise write a java client to view the content of this column.
    Regards,
    Anuj

  • How to know the type of accounting i.e., Cash or Accrual

    Dear Members,
    How can we know which accounting type is used _(i.e., cash basis or accrual basis)_ in Oracle e-Business Suite 11i and R12?
    Please throw some light on the above question.
    Many thanks in advance.
    Best Regards,
    R4S.

    Hi,
    When you enter accounting options in payables, you can apply which method, cash or accrual, you need for a particular set of books.
    Also, you can check which method a Ledger is following by viewing the Activity summary or T format representation of invoice entry. If the enteries are debiting expense and crediting cash, than it is cash method of accoutning. If the entry is debiting expense and crediting liability account, then it is using accrual method of accounting.
    Please let me know if above information was of any help to you.
    Regards
    Pooja

  • How to know the type of a control

    Hi,
    Here's a hard one.
    The column 14 (Document Type) in the Stages of Sales Opportunity.  What kind of control it is.
    Here's what I tried that doesn't work yet :
    SAPbouiCOM.EditText DocType = (SAPbouiCOM.EditText)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.ComboBox DocType = (SAPbouiCOM.ComboBox)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.Matrix DocType = (SAPbouiCOM.Matrix)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.Grid DocType = (SAPbouiCOM.Grid)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.Item DocType = (SAPbouiCOM.Item)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.Field DocType = (SAPbouiCOM.Field)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    This one works tho :
    SAPbouiCOM.ComboBox Stage = (SAPbouiCOM.ComboBox)Matrix.Columns.Item(4).Cells.Item(Matrix.RowCount).Specific;   // 4 is the Column for Stage

    What doesn't make sence here is that
    SAPbouiCOM.ComboBox Stage = (SAPbouiCOM.ComboBox)Matrix.Columns.Item(4).Cells.Item(Matrix.RowCount).Specific;   // 4 is the Column for Stage
    For the column 4 it works perfectly and for the column 14 it doesn't work at all.
    but what is the difference between the 2 columns as I look at them they look idendical in fonctionalities.
    if I use a Try Catch I get this :
    Unable to cast COM object of type 'System.__ComObject' to interface type 'SAPbouiCOM.EditText'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{AE1C43FF-0F2B-4130-A0B7-40E38D5EC60E}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
    Now who will be able to tell me what type of object is in the column 14 of the stages in Sales Opportunity ?

  • Knowing the type of a value

    How can I know if a value stored in an array is an integer (and meanwhile not null)?
    Please help
    Stelios Skiathitis

    Object[] o = new Object[1];
    o[0] = new Integer(3);
    if (o[0] instanceof Integer)
        // is an Integer
    else
        // is not an IntegerIs that what you're looking for?

  • How to know the STD business content data source ?

    Hi,
    Where we can find the list of standard data sources both master and transactional
    which are delivered by SAP?
    i searched in help portal, but i am not seeing the data sources which are specific to the application!
    can nay body help me out?
    Thanks,
    Ravi

    In help portal you can find several datasources, mainly transactional in (this is for netwaver 04s version 3.53.)
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3d/5fb13cd0500255e10000000a114084/frameset.htm
    If you want to a full list of datasources, go to your R/3 system RSA6 transaction.

  • How to know the Control type using event param???

    Hi,
    I wrote a function on MOUSE OVER EVENT. I called this
    function from a LIST and DATAGRID using addEventListener.
    Now i got a requirement like on event fire.. i wanna alert
    the control type i.e., whether the action fire from LIST or
    DATAGRID. I can create two different function for both LIST and
    DATAGRID. But requirement is like cannot reapeat the code.. code
    minimization.
    Is there any property to know the type of control(Like its
    LIST or DATAGRID) using event parameter??
    Thanks & Regards
    PRatap

    You can try using flash.utils.describeType or
    flash.utils.getQualifiedClassName on event.target property and
    figure out the control type.

  • Hi I want to know the difference between the type of internal tables.

    I know the types of internal table but i dont know the difference between them can any one explain me in simple sentence.

    Hi,
    <b>Standard Internal Tables</b>
    Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition.
    This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command). The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to
    the number of table entries.
    <b>Sorted Internal Tables</b>
    Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition. Standard tables and sorted tables both belong to the generic group index tables.
    This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of
    table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key.
    <b>Hashed Internal Tables</b>
    Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.
    This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and
    using internal tables that are similar to database tables.

  • How to know the proxy type??

    How can I know the type of proxy I am connecting to?? like whether its SOCKS, or HTTP etc...which all are enabled....
    thanks in advance....

    I get an error java.net.SocketException: Malformed reply from SOCKS server while connecting through the proxy.That indicates that there isn't a SOCKS proxy at the indicated host:port.
    Is there any other chances of errors than socks not being enabled?You could have got the host or port wrong.
    and how can I know if it is really enabledThe connection will work ...

  • Knowing the Object type? Is this possible?

    Can we know the type of the object created ? Is there any method
    that lets you know the type of object?
    For example:
    class Superclass{
    class Subclass extends Superclass{
    class TestInheritance{
    public static void main(String[] args){
    Subclass subClass = new Subclass();
    }Now,Subclass is of type Subclass and also of type Superclass.
    Right?
    IS there any way or method I can find out the type of Subclass? ie
    Subclass is of type 'Subclass' and 'Superclass'.

    These might help:
    instanceof operator.
    also
    Object.getClass().className()
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html

  • WHT R  THE TYPES OF SCREEN IN SAP R/3?

    I WANT TO KNOW THE  TYPES OF SCREEN IN SAP  R/3

    hi murali,
    in sap we can have screens like
    1.NORMAL SCREEN [used generally for displaying o/p's]
    2.SUBSCREEN  [ used for various purposes as pop up windows, message boxes,..........]
    3.MODEL DIALOG BOX [used in modular programming when we have to display more than one screen based on conditions ex: tab strip control in Modular pools ]
    4.SELECTION SCREEN [ displayed automatically by system  when
    parameters , selection screens used in reports r Module pool prgs ............]
    if helpful reward some points.
    with regards,
    suresh.

Maybe you are looking for

  • Thinkpad W510 USB / Network Conflict

    Hi All , I hope someone can help me in my problem . Once i connect to the network at work , any USB connected after being connected to network will not work , not detected , everything that is already atached to the USB ports before accessing the net

  • Data Components && Query Parameters

    I just started playing with the database binding since I use PostgreSQL. I have a couple questions around parameters. Let's say that I want to make a page to display / update configuration variables from my application. I have a table in my database

  • V. 2.2.1.00.04  Possible minor bug with breadcrumbs

    Hello, I have 'ORA-06502: PL/SQL: numeric or value error: character string buffer too small' error in Breadcrumbs section of Page Definition page when total length of breadcrumb string is more than 84 chars

  • Error starting server sp2

    Hello, I am trying to port application developed in weblogic platform 8.1 sp1 to wl Platform SP2. when i start the server i get following error.( i have updated all libraries). error stack: <Mar 26, 2004 7:42:25 PM GMT+08:30> <Error> <HTTP> <BEA-1010

  • Adobe Form Manager Application in Enterprise Portal

    Hi,    I have a pdf application developed using Adobe Form Manager. In this application, I have interactive forms for various scenarios.  Is it possible to bring-in this application as an iView into the Enterprise Portal? Regards, Yuvaraj S G