Import statement giving error

Hi All,
I am writing a JSP page, and need to instantiate an object of a certain class within my package, in my JSP page.
How do I do that? Do i use the <%import = "Myclass.class" %>
I am using Sun Forte.. and the directory is myprojects/test/Classes/MyClass.java
so how would the import statement look like?
Thanks
Kal.

Kal,
You would use the page directive with the import attribute. It looks like this: <%@page import="MyPackage.MyClass"%> or if your class is in the default package <%@page import="MyClass"%>. It is suggested that all classes used in JSP be packaged. (That is they include the package statement in thier source file and reside in a directory structure resembling the package name.)
Cliff

Similar Messages

  • Merge Statement Giving Error

    Hi Everyone,
    I am trying to use MERGE statement for my Data Load. But it is giving out an un-understandable error. It In the "ON" Part, it refuses to recognise the destination table columns...
    like I say ON(dest.Per_No = Src.Per_No), and it says "Invalid Identifier dest.Per_No"
    Any Ideas, am pasting shortened version of my SQL:
    ========================================
    SQL> ed
    Wrote file afiedt.buf
    1 MERGE INTO CIPIC.Dest P
    2 USING (SELECT Src1.ROW_ID AS PER_No,
    3 LTRIM(Src2.PARTY_ID,'0') AS ARN,
    4 ....
    9 FROM Src1,Src2,....
    12 WHERE MANY JOINS GO HERE) S
    16 ON (P.PER_No = S.PER_No AND P.A_Column = S.A_Column)
    17 WHEN MATCHED THEN UPDATE SET P.blah = S.blah1
    24 WHEN NOT MATCHED THEN INSERT (PER_No, A_Column,....)
    26 VALUES (S.PER_No, .A_Column, ......)
    SQL> /
    ON (P.PER_No = S.PER_No AND P.A_Column = S.A_Column)
    ERROR at line 16:
    ORA-00904: "P"."PER_No": invalid identifier

    See here
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_915a.htm#2080942
    >
    Restrictions on Updating a View
    You cannot specify DEFAULT when updating a view.
    You cannot update a column that is referenced in the ON condition clause.
    Rgds.

  • Bank statement giving error while processing

    hi gurus,
    while processing the manual bank statement the system gives me an error " g/l account  10 does not exist ". how can sort dis error out. help
    best regards
    sayeed

    thnx for the effort. but i surely dint get what i was looking for. c while i try to execute inside the batch input session  it gives me the error
    g/l  account 10 does not exist
    please help me in this regard
    best regards
    sayeed

  • JSP import Statement importing a Class File giving ERROR

    Hey guys,
    There is a problem to which I dont know the reason,
    Consider the code below:
    <%@ import Converter, ConverterHome %>
    It gives me a Compile Time error of this type:
    '.' Required in import Converter ;
    but when i put these classes in a package suppose "converter"
    and the above import statement like this :
    <%@ import converter.Converter,converter.ConverterHome%>
    It gives me no error
    So whats the reason behind this? Cant I compile a JSP program by refrencing classes without in any package?
    please Reply
    Thanks in advance..

    So whats the reason behind this?
    Cant I compile a JSP program by refrencing classes without in any package?No, I do not beleive you can, is you are using Java 1.4. In 1.4, you can only reference classes in the Default Package (none) from other classes in the default package. If you are in a package, then you can not import from the default package. And this is for ALL java classes, not just JSP and Serlets. Since the JSP servlet would be part of a package (which depends on the server you are using) you will need to put your classes into packages to import them...

  • Import Statement Error

    Does anyone know what is wrong with these import statement?
    import Reduction;
    import Mapper;
    import ApplyObj;
    import ApplyObjUnary;
    import java.lang.String;
    public class Driver{
    public static Driver me = new Driver();
    public static void main(String[] args){
    int i;
    I places all my *.java file in the same directory as Driver.java
    But when i try to compile Driver.java, it says :-
    C:\assignment1>javac Driver.java
    Driver.java:10: '.' expected
    import Reduction;
    ^
    Driver.java:11: '.' expected
    import Mapper;
    ^
    Driver.java:12: '.' expected
    import ApplyObj;
    ^
    Driver.java:13: '.' expected
    import ApplyObjUnary;
    ^
    4 errors
    I set my class path as
    C:\>SET CLASSPATH = .;C:\j2sdk1.4.0_01;c:\assignment1
    Apparently, the current directory has been set and my assignment1 directory has been set.
    Did i miss out anything? Why does it can't recognize the existence of other class file in the same directory?
    thanks.

    You don't need to import classes that are in the default package (i.e. you didn't put them in a package). And in Java 1.4, you can't import them. Just remove the import statements, you shouldn't need them.

  • Javac(1.4.2) gives error in import statement

    Hi All,
    I am facing a surprising problem. I have 2 java class files. I write the import statement for second one in the first one. There is no package & these are in the same directory. I have compiled the second one. But when I try to compile the First one. Javac throws error at import statement like below :
    D:\Clubs\oct\6>javac -d . ManojTest.java
    ManojTest.java:1: '.' expected
    import SessionBean;
    ^
    1 error
    My Java Files are as below :
    import SessionBean;
    public class ManojTest
         public static void main(String args[])
    //ManojTest.java
    public class SessionBean
         public static void main(String args[])
    //SessionBean.java
    I have compiled SessionBean.java successfully but when I try to compile ManojTest.java I get error mentioned above.
    However this probelm comes when I use j2se 1.4.2.. but works in j2se 1.3.1..
    Another way could be I use package structure.
    But I can't do any of these, as I have to port my big project to j2se1.4.2.. from j2se1.3.1.. (Live project is running on Tomcat).
    Problems is similar in Unix & Windows both.
    Is this javac compiler issue or there is some setting which I can make.
    I have already included . (dot) in PATH & CLASSPATH environment varibales.
    Please help me out if there is any way around this, as i am stuck up in between
    thank you
    Manoj :confused:

    Use a package and then add that package in your classpathOr don't use a package, leave the file in the default (noname) package, and don't use the import statement. Java will find it in the default package without the import.
    Explicit import statements from the default package are no longer allowed

  • Length error occurred during in IMPORT statement

    Dear Friends,
    (length error occurred during in IMPORT statement),when im using the SUBMIT syntax..can i know what is the reason.
    Thanks
    Rajkumar.A

    Hello,
    I would like to know how did you solve the issue as i came across the same issue.
    Thanks,
    FBK

  • Length error occured in IMPORT statement

    Hello everyone,
    i hv one requirment in PO print(ME23N). in po print asset no nt display without changing other format.
    so that i first copy both smartform and driver program, in that i made certain changes such that i declare the patameter p_ebeln and i comment to data statement of p_ebeln & p_ebeln = nest-objky.
    then i join asset no (anek-anln1) with the help of inner join. then in smartform i gave condition that if bsart = 'ZCAP'
    wa_final-anln1 = gv_anln1.
    endif.
    i import gv_anln1 in smartform and exported in deriver program.
    both are synthetically currect but when i gave print preview dump is occured.
    length error occured in IMPORT statement
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_IMPORT_MISMATCH_ERROR', was
         not caught in
        procedure "%GLOBAL_INIT" "(FORM)", nor was it propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        During import the system discovered that the target object has
        a different length than the object to be imported.
    what i do?

    Hello,
    can u send me coding for that?
    program line is already created for that
    and their first coding is like that,
    if gv_bsart = 'ZCAP'.
    wa_final-matnr = space.
    endif.
    and in text they fetch matnr no.
    but as per requirement they want asset no when bsart = 'ZCAP'
    how that asset no will come.
    matnr comes there is bsart is other that ZCAP, but bsart = ZCAP they want asset no instead of matnr.

  • Length error occurred in IMPORT statement.

    Hi All,
               while exexuting a program i got dump saying that Length error occurred in IMPORT statement. through ST22 i came to know that both import and export structres are not same. Import structure is longer than the export structure.
             I tried in SDN but i coudnt find any solution. can you please suggest how to solve this.
    Thanks in advance,
    Sreekala.

    Hi,
    Maybe what you can do si....
    Program X
    data: v_var(20) type c.
    export v_var.
    Program Y
    data: v_var(20) type c,
             v_var2(50) type c.
    import v_var.
    v_var2 = v_var.
    Create a variable that is exactly the same with the exporting parameter, then just assign it to a local variable declared in the 2nd program.
    Hope this helps.
    Benedict

  • Error on import statement.

    I got compiler error for an import statement which is: import MyClass;
    It said: '.' expected at the end of the statement. However, MyClass isn't any package. Also, I can compiler the same code with the import statement as above on other machine with no error. So, I'm thinking there might be some kind of settings for windows that I've done wrong.
    I have my path point to jdk\bin and my classpath point to current directory. I'm using win2k + jdk1.3.1
    Anyone has idea about this??
    Cheers,

    Didn't you ask this once before?
    Anyway, the statementimport Myclass; is malformed. You cannot explictly import a member of the default package, and you don't need to, they are already imported as are those classes defined in your package and those classes defined in java.lang.
    Chuck

  • Video import problem from iphone5 to PC giving error

    Hi evereyone,
                      I have iphone 5. I try to import my videos but am not able to import all, its giving error. I tried also using windows live photo still same prob. the imported videos have problem in playing. I tried with vlc, quick time, the frames are broken and audio video lag. Please help me how i can import all and rum smoothly.

    Ilan_B wrote:
    Every time I plug my iphone 5 into the laptop (using windows 7) the easiest way is to right click on the portable device (iphone icon) and import to my pictures, BUT every time I do this it wants to import ALL photos and videos.
    And when you do this, it should ask if you want to import the pictures that have already been imported. Select No.
    Then, after you import, the photos should be deleted from the Camera Roll.
    After the photos are imported and deleted from the Camera Roll, you can import using iTunes, only the photos you want on the iPhone.

  • Import logo using RSTXLDMC prg giving error msg like

    Hi All
    I am importing logo(tif format)
    by using RSTXLDMC program, it's giving error mesage "TIFF format error: No baseline TIFF 6.0 file"
    can anyone explain me this issue.
    Regards
    Chinna

    program: RSTXLDMC , upload .tiff file from C drive . ( type = BMON/ BCOL , text id = ST ..., text = name..so10) INCLUDE name OBJECT ID STANDARD in layout set window .
    Save a Logo using Paintshop Pro or Corel Draw as Tiff file. Use RSTXLDMC to convert the logo to standard text in SapScript. When the program is executed, the path and file name have to be correctly specified.
    Process could be like the following:
    Run RSTXLDMC
    Enter file name C:\MAIL\COMPLOGO.TIF
    Resolution for Tiff file
    Absolute X-position
    Absolute Y-position
    Absolute positioning
    Reserved height
    Shift to right
    UOM = CM
    Text title
    Line width for text = 132
    Text name ZHEX-MACRO-COMPLOGO
    Text ID ST
    Text language = E
    Postscript scaling
    Width & Height according to PS scaling
    Number of Tiff gray levels (2,4,9) 2
    Then Create a new window 'COMP' with attributes;
    Window COMP description Company Logo
    Window type CONST
    Left margin 7.00 CH window width 10.00 CH
    Upper margin LN window height 8.00 LN
    Finally in the text element , mention
    /: INCLUDE 'ZHEX-MACRO-COMPLOGO' OBJECT TEXT ID ST LANGUAGE 'E'.
    Please note that if object name is not indicated as 'ZHEX...', the logo may not be printed!
    You will not be able to see the logo in a test print. The same will be printed in actual printout.
    If you are using two logos in the same layout, the names of the logos should be unique. Say 'ZHEX-MACRO-LOGO1' and 'ZHEX-MACRO-LOGO2'. Else all the information will be overwritten.
    If the logo is not EXACTLY TIFF 6.0 , the same will not be printed.
    See OSS notes 5995, 18045, 39031 for some inputs.
    regards
    vinod

  • Content Server 6.40 with MaxDB 7.7.4 giving ODBC State 00000 error

    Hi Guru,
    I'm having a problem with Content Server 6.40 with MaxDB 7.7.4 under windows installation, as following from RZ20:
    Date       Time     Short name                               Object name                              User Name    ALUSER16
    Message
    30.10.2009 12:55:26 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_DOCUME
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    30.10.2009 12:55:37 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_DOCUME
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    30.10.2009 12:55:49 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_DOCUME
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    30.10.2009 12:56:01 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_DOCUME
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    30.10.2009 13:31:22 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_FILES_
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    30.10.2009 13:31:45 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_FILES_
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    30.10.2009 13:51:05 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_FILES_
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    30.10.2009 13:51:31 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_FILES_
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    30.10.2009 14:03:08 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_FILES_
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    30.10.2009 14:03:38 Requests                                 ContRep: ZCONTENT01                      AXONBASIS    HTTP_POST_FILES_
    HTTP error: 500 (Internal Server Error)  " ;ODBC State 00000; Error Code 0"
    The error is happening while executing RSCMST report. Content Server installation and configuration finished successfully. I installed for 3 server, 2 of them don't have this kind of issue. Please need your expertise on this.
    Thanks in advance.
    Regards,
    Yan

    Hi Natalia,
    Thanks a lot for your suggestion. I've read the mentioned OSS last time while I was having the related issue. Now the issue had been solved by reinstall the content server. I though I did the wrong step while installing or upgrading the MaxDB.
    With Best Regards,
    Yan

  • IMPORT statement in OO

    Hi All,
    Can some one give me a code sample of exact syntax for IMPORT statement.
    I tried the following way
    IMPORT gt_dispute_data FROM MEMORY ID co_memory_id.
    but giving an error.
    shylesh

    Hello,
    Please declare gt_dispute_data and try the following:
    IMPORT gt_dispute_data FROM MEMORY ID 'CO_MEMORY_ID'.
    Thanks,
    Venu

  • Jsp declaration and import statement

    Hi All
    I have some problems with JSP.
    I have wrtten a declaration in jsp like this.....
    <%@ page language="java"%>
    <%!
    Date date = new Date();
    List al new ArrayList();
    public List getList(){
    al.add("Hi");
    return al;
    %>
    The List is-> <%= getList()%>
    Note that i did not import anything, it gives the output without any compile time/runtime error. How it is happening?
    If i write any thing in scriplets.......like List, Date, it is giving compile time error asking to import this.
    I am using weblogic8.1
    May i get the correct answer for this ASAP?
    Thanks and Regards
    Kasim
    [b]

    weblogic includes certain import statements in the JSP page when it is compiled.
    That is why u r not getting an error some times!!
    Check your weblogic documentation to find more details abt that
    But it is better to include the import statements , so the code will work in any server.

Maybe you are looking for

  • How to load images using xml in flash

    Hi im working on a quiz project where i plan to load images using xml in to flash, can any one help with the script with AS2 or 3

  • Documents won't download completely from web site

    Documents attempting to download from my insurer's website won't complete. Document loads partially in the Adobe window that opens, but a circular stats bar opens in the second page and the document won't finish.

  • Down payment tax offset account

    Hello Experts                We have a Down payment tax offset in GL Determination.I have mapped the same but there is no effect in  this account while making AR down payment .I want to avoid tax will collecting down payment,.How can we manage? Regar

  • [MAC: InDesign CS4] Export to Dreamweaver bug

    Hi, I have InDesign files with graphics (.eps, tif, ai, psd) linking but the original grapics are missing. I have to do xhtml conversion without graphics and to keep the original graphic file name linking in the xhtml. Earlier when I export the CS3 f

  • Applying dynamic routing feature on outdoor wireless connection for load ba

    Gentlemen, Does the Cisco outdoor wireless unit support dynamic routing (e.g. RIP or others) to do the load balancing between leased line and wireless connection. I am looking to confirm if the outdoor unit has the routing features to apply this scen