Regarding .java file

Hi,
I deployed a project with all tha class files with a single web.xml file. Afterwards what is the use of the .java file which I used to create the class file? (This was asked by a interviewer in an interview.) Please help me with the answer.
Thanks

Hi,
I deployed a project with all tha class files
with a single web.xml file. Afterwards what is the
use of the .java file which I used to create the
class file? (This was asked by a interviewer in an
interview.) Please help me with the answer.
ThanksWhat did you answer?
To tell you the truth, you can throw that java file out of the window. Who cares, if you find a bug, just write the whole program again.
Does that sound good?

Similar Messages

  • Best practises regarding generation of the EOImpl and VORowImpl java files

    Greetings,
    I was wondering what is the best practice/suggested approach regarding generation of the EOImpl and the VORowImpl java files for ADF Business Components.
    From the maintenance point of view, it makes sense to generate them only if you want to put some custom code in those e.g. validation or transient attribute.
    However from performance point of view, does it help to have these EOImpl and the VORowImpl java files generated.
    Any thoughts on this will be a lot helpful.
    regards - rutwik

    Hi
    Sections:
    * 5.11.3.3 Attribute Indexes and InvokeAccessor Generated Code
    * 6.9.4.4 Attribute Indexes and InvokeAccessor Generated Code
    Explain the details of the generated code for view object row classes and entity object row classes, respectively.
    As described in the guide, the key benefit of the generated code is not performance, but of type-safe access and having a place to put custom code when needed.
    When you don't have a generated row class, then there is no typesafe method like getSal() to get the Sal attribute.
    Section 4.4.9 Generic Versus Strongly-Typed APIs gives a few more details on that and both 5.11.1.1 Generating Bind Variable Accessors and 5.11.1.2 Generating View Row Attribute Accessors give some concrete examples of the value proposition of the strongly-typed API's.
    Without the typed API's of course, you need to get an attribute value by calling:
    yourRow.getAttribute("SomeAttrName");
    or
    yourRow.getAttribute(3); // integer attribute index (zero-based) [see section 5.11.3.3 in the guide]
    Since it's rare that someone will like to use the numerical approach, then let's assume that people would go with the generic getAttribute("SomeAttrName") way.
    Internally, the framework will need to find the attribute index based on the attribute name before accessing the attribute. If you perform this attribute-name-to-attribute-index lookup a zillion times, then of course it would end up representing some overhead that you could avoid by either using the numerical index yourself, or generating the strongly-typed class. The generated code avoids the need to lookup the attribute by string name and also provides the compile-time checking (i.e. typesafe access) in your code.
    So, the performance of using the attribute index access (or the generated code) that is ever-so-slightly faster than using the attribute access by string name, not necessarily the generation of code itself that makes things faster. The performance shouldn't be the basis of the strategy decision, but if they see the value of typesafe access then it might be worth the extra files -- some perhaps containing no custom code -- being generated for them.
    Hope this helps
    rgds
    susan

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How to create a .java file with multiple classes

    I have all the below classes declared in a file say ABC.java under
    a common package called somepackage
    Abstract class A
    Void abstract metod1();
    Void metod2();
    Class B
    void method3();
    Void method4();
    Class C
    void method1();
    Void method2();
    In Client.Java
    On compiling the Client.Java I get errors
    Import somepackag.*;
    Class Samp extents A
    void Method1()
    Public class Client
    A a1 =new Samp(); //error undeclared class A
    B b1 = new B1();//error undeclared class B
    C c1 = new C1();//error undeclared class C
    is it possible to have all the class declared in one file ( i dont need mutiple classes, as this file will be autogenerated , i need all classes in one file) and use the classes inside this in the some client app
    regards
    MP

    Peetzore wrote:
    As long as you have only one public class and your .java file is named after it you shouldn't have any problem.I did exactly that, but still i get the same error "Cannot find symbol"
    i have used the import command on top as import somepackage.*;
    Edited by: mpjava on Jun 2, 2009 1:29 AM
    Edited by: mpjava on Jun 2, 2009 1:30 AM

  • Why do I need to restart Apache and Tomcat every time a java file is change

    If a java file is changed and complied the changes are not reflected if Tomcat is not restarted.
    The settings in server.xml are as:
    <!-- Tomcat Manager Context -->
    <Context path="/manager" docBase="manager" debug="0" privileged="true"/>
         <Context path="/cf" docBase="cf" debug="0" reloadable="false"/>
    Here "cf" is my Application folder under webapps. The reloadable property when set to "true" for standalone Tomcat on Windows98 reflects the changes for compiled java files without restarting Tomcat. But on Linux 7.1 with Apache 1.3.19 and Tomcat 4.0.3 this is not working.
    Also tried out with Manager Application of tomcat-users.xml with reloadable="false" as well as reloadable="true",
    But when I reload the application using the command
    http://servername:8080/manager/reload?path=/appli.name
    It tells me that the application is reloaded but changes in the java file are still not reflected.
    Also when reloaded through Manager Servlet, Only my load-on-startup servlet is reloaded, but other java classes are not.
    Is it neccessary to execute this reload command from the server itself. I m executing it from a remote m/c. and have mapped the application with a domain name virtually.
    Is it the case with Tomcat on Linux with Apache. Or is something going wrong on my part.
    Can someone Help out plz.
    Regards,
    Rupali

    or you can "touch" your web.xml file.
    touch web.xmlor that command is for *nix systems, not sure what the Windows command is.  But basically, when you edit the web.xml, even if it means updating the last modified time, it will restart only your application and you should see the changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can i execute "*.java " files in Workshop

    Hi,
    Im sunil,new to this weblogic workshop8.1..i dont know how to execute standalone .java files or servlets in workshop.plz help me and tell the way.
    regards
    Budati sunil

    Im not too sure about the Java project. But single normal java files with public static void maain(String [] args) are very simple to execute.
    1. Write the java code somewhere lets call this class A.
    2. Make a dummy page flow.
    3. In the begin action of this pageFlow, call the main method of the A class directly using A.main(null) since main is a static method. your code will work fine.
    4. If you have to pass a String[] as parameters. Before calling main, create this String[] and then pass it.
    In this way you can make a jsp and take the input from the user also.
    Hope it helps
    Cheeers

  • How to read messages in message pool from a java file

    Hi All,
    I want to read a message that is defined in a message pool of a webdynpro component.
    This reading should be done from a java file present in the "src" folder.
    How can I get the handle to the IWDComponent?
    Or is there any other way?
    Or is there any way of reading localized messages in a java file of a webdynpro component?
    Can you kindly guide me out of this issue?
    Thanks and regards
    RB

    Hello,
    my approach is more simple: how can I read within component A the message pool of another webdynpro component B ? Component A has a usage relation to component B .
    I tried this within component A:
    <b>this.wdThis.wdGetBInterface().wdGetAPI().getComponent().getTextAccessor().getText("ANY_TEXT");</b>
    I got the exeption:
    <b>java.lang.UnsupportedOperationException: Embedded Components are black boxes. You should not access parts which are not in their interface</b>.
    Is there any way to share message pools ?
    Thanks
    Kerstin

  • Creating Java file from XML data

    I have a information regarding a java file like class Name, attribute name,type, and function details in a XML file now I want to create a java file from this XML. Kindly tell me the some way to solve this problem as soon as possible.
    Thanks
    Sumit Kumar Agarwal

    So how does it take this file
    file>
    <statement>
    <name>John Dow </name>
    <address>123 Main</address>
    <phone>972-213-3434</phone>
    </statement>
    <statement>
    <name>Jane Dow </name>
    <address>345 Main</address>
    <phone>972-213-3534</phone>
    </statement>
    <statement>
    <name>Marry Dow </name>
    <address>678 Main</address>
    <phone>972-213-3435</phone>
    </statement>
    </file>
    and create these three different one?
    1.)
    <statement>
    <name>John Dow </name>
    <address>123 Main</address>
    <phone>972-213-3434</phone>
    </statement>
    2.)
    <statement>
    <name>Jane Dow </name>
    <address>345 Main</address>
    <phone>972-213-3534</phone>
    </statement>
    3.)
    <statement>
    <name>Marry Dow </name>
    <address>678 Main</address>
    <phone>972-213-3435</phone>
    </statement>
    Is it not going to just grab each element after the file tag? I'm just confused about that.

  • Error in Running of java file(while connecting for SAP BW SERVER)

    Hi,
    Any one could be help regarding the  following error message I am getting on running of Java File?
    C:\>cd C:\j2sdk1.4.2_04\bin
    C:\j2sdk1.4.2_04\bin>Set Classpath=%classpath%;C:\j2sdk1.4.2_04\bin\jco\com\sap\
    mw\jco\jco.jar;
    C:\j2sdk1.4.2_04\bin>javac DevelopmentQueue.java
    C:\j2sdk1.4.2_04\bin>java DevelopmentQueue
    <u><b>200
    JCO.init: Unsupported Java VM version 1.4.2_04 detected</b></u>.
    C:\j2sdk1.4.2_04\bin>java -version
    java version "1.4.2_04"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
    Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
    C:\j2sdk1.4.2_04\bin>

    Hi Ganesh,
    Thanks for reply.I tried the classpath you mentioned,Still I am getting the same error.
    C:\>cd C:\j2sdk1.4.2_04\bin
    C:\j2sdk1.4.2_04\bin>Set Classpath=%Classpath%;.;C:\j2sdk1.4.2_04\bin\jco\com\sa
    p\mw\jco\jco.jar;
    C:\j2sdk1.4.2_04\bin>javac DevelopmentQueue.java
    C:\j2sdk1.4.2_04\bin>java DevelopmentQueue
    <b>200
    JCO.init: Unsupported Java VM version 1.4.2_04 detected.</b>
    C:\j2sdk1.4.2_04\bin>
    If I want to upgrade  JDK Version to 1.4.2_05 or above, pls  mail me the necessary URL Link to download it.
    I appreciate your early mail.
    Kind regards
    CSM REDDY

  • How to use standard Java file in custom module

    Hi All,        
    I want to use some CatalogItemImpl.java file in my custom DC but i was unable to find any entry in the standard component in businessobject.xml file as <businessObject name="XYZ" className="x"/>. Can anyone let me know how can we use the file file in my custom DC.
    Please provide your inputs......
    Regards,
    Rahul.

    Hi Rahul,
    You will not find the "CatalogItemImpl" in the 'businessobject.xml'. The 'businessobject.xml' is there to define session based API of modules. Those API have properties and web channel builder values injected when the user start a web session.
    For the "CatalogItem", you will have to use the Generic Factory concept. The Generic Factory is used to allocate instance given a configuration. If no configuration exists, the default implementation is used. By adding an entry in the Generic Factory you can choose to allocate your class instead of the default class.
    Within the catalog module, the alias to use for classes extending "CatalogItemImpl" is "com.sap.wec.app.common.module.catalog.businessobject.ext.interf.CatalogItemExtInterf".
    Please refer to the extension guide on how to manage the Generic Factory configuration file.
    Regards,
    Robin

  • A tool for editing javadoc in .java files

    Hi
    i am looking for a tool that can be use for editing the javadoc in the .java files. it should edit constructors, methods and fields.
    if you know such tool please send me a link.
    Regards
    y.l.

    We list some standalone solutions on the Javadoc FAQ.
    (I have not tried any of these)
    http://java.sun.com/j2se/javadoc/faq/index.html#G
    - Utility for writing doc comments: Doc+.
    - Tool that simplifies the process of writing doc comments: DocWiz.
    - Tool for generating formated Javadoc comments: CommentMaster.
    - Tool for editing Javadoc comments using a word processor-like view: XMLmind XML Editor.
    -Doug Kramer
    Javadoc team

  • Replacing Class definition comments in java files.

    Hi to all,
    Im trying to implement a java file replacer that opens about a thousand java files and replaces the first comment lines. That is to say assume that these thousand java files have this comment at the beginning of them:
    *Date      Author     Changes
    *${date} ${author} initial release
    My application should find these comments and replace them with
    * Project Name:
    * File: ${file_name}
    * Purpose:
    * History:
    *Date      Author     Changes
    *${date} ${author} initial release
    I dont need any GUI. just I will print the changed files to console.
    My question is is there any example applications you guys can suggest and should I use XML and XSL to implement this application?
    Any suggestions are highly appriciated.
    Best Regards.
    Metan

    How is XML going to help you? Also for a task which you describe its easier to replace it wholesale rather than compare what is present and what is not. If you want to selectively want to remove stuff you might run into issues where you have to compare the name of the file, and you would not even know if the documentation already existing is the right one if you do not replace.
    If at all you wish to go with XML it is better with XSL transforms but I guess that would be an overkill for the purpose.
    As previously suggested perl is a very good option, or if you have unix operating system you can even try some basic shell scripting to do your job
    Thanks

  • How to create a .java file through a j2me program?

    I am trying to develop a small application in j2me which needs dynamic creation of a .class file. For this purpose I tried to create .java file through my j2me code, but i could not do that..I want to know whether a java file can be created on a mobile phone or not..
    I would be grateful to you on your help in this regard..

    ...develop a program xyz.java using j2me which performs the following functionalities:
    1.create a file called abc.java
    2.extract its class file...For +1+ ie to create a file (any file, no matter java or not) from j2me, device need to support File Connection specified in [jsr 75|http://www.jcp.org/en/jsr/detail?id=75]. If you're interested, learn the jsr API on how to create and manage needed file.
    For +2+ described as extract its class file one needs to have java compiler (javac) on device. *) If you're interested, ask for more details at [Java Compiler forum|http://forums.sun.com/forum.jspa?forumID=7]. Also, if the class file is for CLDC then javac needs to support "JDK 1.3-compliant" compilation. To create CLDC classes on device, one also needs to have a preverifier tool. Check this at Java Compiler forum if needed.
    Good luck - I think you'll need a lot of it...
    *) javac on device -- it should not only be present but also provide a j2me API allowing to invoke it for particular java file with needed options. Same applies to preverifier tool.

  • How to compile a java file in J9 for windows mobile 5.0

    I have downloaded J9 for windows mobile 5.0 and need help on how to compile a java file.

    You can compile your source code using J2SE ;)
    may be this is important for you:
    http://awareness.ics.uci.edu/~rsilvafi/pocketPC/index.
    html
    Regards!!!Actually i am using some eSWT related classes also.. so is there any way to compile from the J9 environment using J9 console..

  • How to use external java files into my project

    Hi all,
    I need your help to import my external java files in to my project.
    The files are in package folder.
    So how to tell the import command with the path of the folder.
    I read also that I can make a jar file and integrate it into the project.
    How can I make jar file.
    Best regards...

    there is one utility in j2se jar and check the option also
    put that jar file in lib folder of yr application folder
    [email protected]

Maybe you are looking for

  • Creating Folders

    With Lightroom,going to menu Library, New Folder.. The below screen pops up. I have all my pictures on my D:\Pictures directory. But that directory is not listed in the Browser window. This has worked previously. I just had a crash and reloaded every

  • Rac node evicted and asm related

    Hi friends I have few doubts in rac environment 1.In 2 node rac while adding datafile to tablespace if you forget to metion '+'then what will happen whether it is going to be create or it throws an error if it creates where exactly located and other

  • How to save SQL result to file in forms 10g

    Hi All,      I am using Oracle/forms 10g and need to create a file from a predefined sql statement . Just wondering if there is a build-in provided by oracle to export sql result to a file from Forms?. Your quick response will be of great help. Thank

  • XML Messaging and JSP.  Is it possible?

    Here is my situation. We are developing JSP with a backend interface to external/remote Java/C++ applications. We like to implment, if possible, XML messaging between JSP and remote programs. First of all, is this possible? Can JAXM be used in JSP? T

  • Run form with javabean

    I tried to take one of demo forms which have javabean and run it. The form is calendarpjc and the jar file is calendar.jar. 1- I put the calendar.jar in e:\devsuitehome_1\forms\java 2- I appended the formsweb.cfg with the following: [CalendarPJC] pag