J2se vs j2ee javax.servlet.* & javax.servlet.HTTPServlet

Hi,
I guess I have a basic question....It is in j2se 1.4.2 API's one does not have the package javax.servlet.* or javax.servlet.HttpServer package/classes.How does one get to compile the java source file if it imports javax.servlet.* and javax.servlet.HttpServlet.,both of these are present in the j2ee API's.Help would be greatly appreciated.
Thanks
AS

Yup, pretty basic.
You're right - the javax.servlet and
javax.servlet.http packages are not part of the J2SE.
However, they are part of every servlet/JSP engine
you can find, including Tomcat and Sun ONE J2EE app.
Look for a j2ee.jar or servlet.jar (or servlet-api.jar
if you're using Tomcat 5.0.x) and you'll find those
classes. Once you locate the proper JAR, all you have
to do is make sure it's in your CLASSPATH when you
compile and run:
javac -classpath .;/full/path/to/servlet.jar *.java
MODThanks for the reply.So if we compile it we will get compile errors right?,without the appropriate classpath settings.Got you.
AS

Similar Messages

  • Difference between J2SE and J2EE...

    Hi all. I was wondering what the difference between J2SE and J2EE were. I mean in the code structure. Are the packages the same, like Swing, IO, things like that. I'm a bit of a beginner in Java, only been messing around with it for about 6 months now kind of in my spare time, and I know I'm in now way ready for J2EE, but it's something I think I'd like to maybe look into. I know it's for Enterprise Applications, much bigger scale than I'm used to, but fundamentally, how is it different? Different coding conventions? New packages not in J2SE? I hope what I want is coming across okay. Thanks for all the input.
    James

    J2EE defines a large number of specifications, in addition to J2SE. Examples are the Servlet, JSP, JMS, and EJB specifications. Most of those specifications are designed to have implementations running inside an Application Server. There are free implementations available such as JBoss (combined with for example Tomcat), and I think youre best bet to learn is to download one of those and go from there. Servlets and JSP are a good beginning, and then maybe move on to EJB and the rest.
    Br - J

  • J2SE to J2EE

    I'm considering a jump from J2SE to J2EE. My question is,
    What are the main differences between the two?

    "I have been using databases in some of my apps."
    JDBC lies completely inside J2SE, J2EE does not add anything to it.
    "I would like to add a servlet to my latest app."
    If you are looking into using JSPs, Servlets, and the rest of J2EE to replace PHP server applications, then you are on the right track. If you just want to use a Servlet in a regular, desktop app, you are probably looking at it wrong (adding the necessary Servlet Container (web server) would be a huge footprint to the app, and prolly something that your users would not want on their computer...)
    "...explain some of the advantages of using enterprise instead of the standard edition"
    You don't use it instead of the standard edition, you use it on top of the standard edition. You use it to write web applications. That way, you have one centralized server that does the work. The user has versions of a client (a web browser or any client that can read the data you send... this could be a J2SE desktop app if you wanted...) that the user interacts with, and which in turn interacts with the server which does the work.
    So J2EE is about layered control.
    1) The client app displays info to the user and provides a means of interaction
    2) The server stands as a listening device that sends messages to the correct part of the app and back to the user.
    2) 1) The Servlets act as a control mechanism that runs the business logic (work)
    2) 2) Other layers may handle data access and storage (databases, XML. EJBs?)
    2) 3) Other layers may handle dispaly generation (JSPs) or return information (JMS)
    The advantage is that your work is done in one place. Everyone who uses the app doesn't need to update everytime the application does. Every user doesn't need to have a DB on their computer. Users can communicate and share information more efficiently. At the same time no user gains access to someone else's data because the data storage and access is twice removed from the client...

  • J2SE and J2EE

    what are the differences of J2SE and J2EE in terms of programming? I have used J2SE in developing java applets and standalone applications and now, I want to explore more with J2EE. I am reading articles and site regarding J2EE. But for you what is J2EE all about?.
    Thanks!

    To be frank, if you have to ask you don't need it. Learn most of what Java SE has and can do; then you'll have a sufficient knowledge base to understand and use Java EE as it's intended, on enterprise-level applications.
    If you want more information read the documentation, as I don't care to digest it for you.

  • J2SE and J2EE Which with what ?

    I am running Windows NT 4.0 server, with SP6a & Windows NT 4.0 work station, with SP6a. On reading the various combinations of J2Se and J2EE, which do I need to match. Also I am using ant 1.5.3 and looking at some CORBA 3 work using JacORB 1.4.1. I have been using J2SDK 1.4.1_02 for general jave work.
    From what I have been reading it looks as if I need J2SE 1.3.1_02 with J2EE 1.3.1.
    What is the real combinations of J2SE and J2EE needed for such a asystem ?
    Also at present I do not particularly wish to move to a Win2000 Server/workstation combintion as yet.
    Thanks
    Omegaall

    You may now download J2EE 1.4 which will be compatible with your existing installation of J2SE 1.4.1_02.
    However, J2EE consists of the application server and additional tools. They are not required, nor are they recommended for heavy duty enterprise work; J2EE is simply a basic "reference" platform for you to get your feet wet on.
    Other alternatives do exist, and if you've tracked down Ant, you probably already know about Tomcat, JBoss, WebSphere and a number of commercial engines. All of these packages essentially take J2EE and extend them further (or are faster, or are more reliable, etc etc).
    If you have been asked to develop COBRA objects - as opposed to, and I stress this, as opposed to - merely being interested in the technology, then I strongly strongly strongly suggest you find out what your customer is using and set up a scheme similar to theirs. By developing to the same platform, you can save yourself a lot of deployment and packaging headaches, and essentially develop the objects "the right way" for that system.

  • Runtime error while using SAP Enterprise Connector in a J2EE Web Servlet

    Hello,
    I'm facing problems while trying to do a RFC call out of a Servlet.
    I'm using Development Components (DCs) and my project setup is as follows:
    Firstly I've created a DC of type J2EE/Web Module. This DC implements an absolutly simple servlet which has to do the RFC-Call.
    The relevant code is:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       JCO.Client jcoclient = JCO.createClient("010", "DV*****", "***", "DE", "ovd***", "01");
       jcoclient.connect();
       Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();
       input.setAirline("LH");
       SAPProxies_PortType myproxy = new SAPProxies_PortType();
       myproxy.messageSpecifier.setJcoClient(jcoclient);
       try {
          Bapi_Flight_Getlist_Output output = myproxy.bapi_Flight_Getlist(input);
          BapisfldatType_List list = output.get_as_listFlight_List();
          int listsize = list.size();
          for (int i = 0; i < listsize; i++) {
             BapisfldatType elem = list.getBapisfldatType(i);
             response.getWriter().print("Date: " + elem.getArrdate() + '\t' + "Arrive: " + elem.getArrtime());
       } catch (Exception e) {
          response.getWriter().print(e.toString());
       jcoclient.disconnect();
    The proxy for the RFC Module "BAPI_FLIGHT_GETLIST" - in this case the classes around "SAPProxies_PortType" were generated by NWDS ("SAP Enterprise Connector" Wizard).
    I had to manually add following DCs as "Used DCs" to get my DC built:
    com.sap.aii.proxy.framework (default)
    com.sap.aii.util.misc (default)
    com.sap.mw.jco (default)
    So far, so good...
    As a J2EE/Web module DC can't be deployed I've created a second DC of type J2EE/Enterprise Application and referenced the first DC. This DC is also built fine and can be deployed.
    But... When I call my servlet I get following Error Message on the web browser:
    The request cannot be processed.
      Details:      
      com.sap.engine.services.servlets_jsp.server.exceptions.ServletNotFoundException: Cannot load the requested servlet [LocalDevelopmentservletxxx.com/servlet/TestServlet].
    Exception id: [000C295D60FB006F0000003600000EA8000461A05860B4BA]
    I also had a look in the trace files:
    Vollstu00E4ndiger Nachrichtentext
    application [LocalDevelopmentservletxxx.com] Processing HTTP request to servlet [TestServlet] finished with error. The error is: com.sap.engine.services.servlets_jsp.server.exceptions.ServletNotFoundException: Cannot load the requested servlet [LocalDevelopmentservletxxx.com/servlet/TestServlet].
    at com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents.getServlet(WebComponents.java:330)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:354)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    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:102)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: java.lang.NoClassDefFoundError: com/sap/aii/proxy/framework/core/AbstractType
    Loader Info -
    ClassLoader name: [xxx.com/testear]
    Parent loader name: [Frame ClassLoader]
    References:
       common:service:http;service:servlet_jsp
       service:ejb
       common:service:iiop;service:naming;service:p4;service:ts
       service:jmsconnector
       library:jsse
       library:servlet
       common:library:IAIKSecurity;library:activation;library:mail;library:tcsecssl
       library:ejb20
       library:j2eeca
       library:jms
       library:opensql
       common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:webservices_lib;service:adminadapter;service:basicadmin;service:com.sap.security.core.ume.service;service:configuration;service:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notification;service:keystore;service:security;service:userstore
       interface:resourcecontext_api
       interface:webservices
       interface:cross
       interface:ejbserialization
    Resources:
       C:\usr\sap\J2E\JC00\j2ee\cluster\server0\apps\ibm.com\testear\servlet_jsp\LocalDevelopmentservletxxx.com\work
       C:\usr\sap\J2E\JC00\j2ee\cluster\server0\apps\ibm.com\testear\servlet_jsp\LocalDevelopmentservletxxx.com\root\WEB-INF\classes
       C:\usr\sap\J2E\JC00\j2ee\cluster\server0\apps\ibm.com\testear\src.zip
    Loading model: {parent,references,local}
    The error occurred while trying to load "com.xxx.test.sap.connector.Bapi_Flight_Getlist_Output".
    at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:401)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:1618)
    at java.lang.Class.getConstructor0(Class.java:1930)
    at java.lang.Class.newInstance0(Class.java:278)
    at java.lang.Class.newInstance(Class.java:261)
    at com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents.getServlet(WebComponents.java:319)
    ... 14 more
    I think it has something to do with the used DCs... but I don't know why the classes are not found after deployment. I also tried
    to package the relevant jar-files from the used DCs into the EAR-File - but the I faced problems with the JCo
    Thank you for any help.
    Osman

    Hi,
    One thing that can be helpful is to add the references of the JAR files that you are adding as Used DC in the EAR.
    This can be done by adding Library type References in the application-j2ee-engine.xml Deployment descriptor in the EAR project.
    Following link will be helpful: http://help.sap.com/saphelp_nw70/helpdata/EN/83/82814282cfc153e10000000a1550b0/content.htm
    Regards,
    Alka.

  • J2SE 5.0 & JSP/Servlets

    Please excuse my ignorance but when will J2SE 5.0 functionality be available in JSP and Java Servlets (esp. in Apache)?

    When will I be able to use j2se 5.0 language features (eg. generics) in servlets/jsp? Yes.
    Tomcat 5.5 is designed for Java 5.
    In servlets, there is no issue. You compile those yourself.
    WIth JSPs, it is a bit more tricky. The default JSP compiler on Tomcat is now JDT - which is currently java 1.4 compliant.
    I haven't tried it myself, but according to the Tomcat docs, you need to
    - remove the common/lib/jasper-compiler-jdt.jar file, and place the ant.jar file from the latest Ant distribution in the common/lib folder.
    - In $CATALINA_BASE/conf/web.xml. Modify the attributes "compiler", "compilerSourceVM " and "compilerTargetVM "
    Linkies:
    http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.htm
    http://blog.taragana.com/index.php/archive/how-to-run-javac-15-or-beyond-compiler-for-jsp-compilation-in-tomcat-55-with-generics-enabled-and-other-15-only-features/

  • J2ee newbie servlet 404 error

    ok, ive searched through several previous posts, but none seemed to address having files in the 'public_html' folder of the standard j2ee sdk folder
    i have a simple servlet being called from an html page 'index.html'
    the servlet is in
    drive_letter:\j2sdkee1.3.1\public_html\greeting\WEB-INF\classes
    i can access the html file on port 8000, but when i post to the servlet, i get a 404 error
    how do check to make sure the servlet is accessible ?

    now it works for some unknown reason! im leaving this default j2ee server along and going back to tomcat!

  • J2EE Logon Servlet Prompting For Username Email

    I have a situation in my landscape that recently, after patching the system to NW700 SPS23, some users would enter their logon and password correctly and then get confronted with an additional security screen requesting their firstname, lastname, email address and a message for the administrator (as if they were trying to perform self registration).  They would kindly enter the requested information and it would pop up again and again, preventing use of the system.  This doesn't happen to everyone though and appears to be in some way related to the URL the user was using.
    I set logging to debug and could not find any trace of an error in the java logs when this occured.  Ultimately, I provded a cleaner URL string (http://<server>:<port>/useradmin for example), had the user clear their browser cache, restart IE, and then it went away for them, even when using the old dirty URL.   I am 100% positive it was not password related as I could log in fine on my machine, but not on another with my own and other admin accounts.
    My question is: is anyone aware of any new security features implemented in NW700 SPS22 or 23 that could be causing this problem on some front-ends?  Our users use Windows 7 and IE 8.    It also occured on a calling java application server running IBM Websphere and an older OS and browser.  This is what has me so suspicious about the patches themeselves.
    The SAP app that is running on the NW700 machine is XMII 12.0.21.  Though the symptom also occurs with calls to NWA, UME, SLD, etc.  I also run a 701 webdispatcher on the machine which does some url translations, but again, it works fine on most front-ends.
    Regards,
    Phillip

    https://service.sap.com/sap/support/notes/957666
    Use this above tool, install it and it is a flash based application which runs on J2EE.
    I have resolved all my portal security issues using this tool.
    Also do you have any SPnego authentication or conventional?
    Regards
    SM.

  • J2se or j2ee

    which one is better to use provided i am not that good in java.

    dear pple do ask odd questions, dont they.me trying
    to learn basic java, then java servelts and web
    services.cheersThen it is not a matter of which. You will need to learn J2SE for all the basic java stuff. Then, once you know Java, you ADD J2EE on top for the Servlets, JSP, and other stuff. It isn't a choice of one over the other. You need J2SE as a pre-requisite to J2EE.

  • J2SE to J2EE, beginning and need help

    I am a J2SE developer and I need to learn J2EE. I am trying to figure out how to compile .java files that I write that use J2EE such as servlets. I am using eclipse and Textpad but I can't get either program to recognize J2EE classes. Is this possible? I have downloaded the J2EE SDK and started with some basic .jsp pages but I am more of a programmer than a web designer, and I really don't like using markup languages(HTML, XML). This is probably really stupid, but can anyone help me out or just give me some starting words of wisdom?

    Make sure <J2EE_HOME>/lib/j2ee.jar is in your classpath:
    DO:
    javac MyServlet.java -cp path/to/j2ee.jar
    OR
    set your CLASSPATH env variable to include j2ee.jar
    OR
    throw j2ee.jar into your <JAVA_HOME>/jre/lib/ext directory.

  • JSP with J2SE and J2EE

    I am learning JSP from a book that is a year old. Can you tell me if the JSP for J2EE is different from that for J2SE ?

    J2SE stands for Java2 Standard Edition which is supposed to define Java standards (and API) to run day-to-day application (single user applications).
    J2EE on other hand is Java2 Enterprise Edition. Its supposed to define standards (and API) to be used to create server application that service multiple clients.
    One does not succeed the other, rather they target diffenet segments and are complementary. J2EE is more of extension of J2SE capabilities (A J2EE application will requires API defined in J2SE packages).
    JSP is part of the J2EE specification (other part being Servlets, EJB, JavaMail, JMS etc) and its supposed to have nothing to do with J2SE excepct using the latter's API in its implementation.
    What others have been trying to tell you is that JSP is part of J2EE specification but you need not know the other components of the specification to use JSP.
    Amitabh

  • J2SE Vs J2EE Adapter Engine

    Hi All,
    I am having a doubt. Apart from having a decentralized installation location of J2SE Adapter,
    What is the difference between the J2EE and J2SE Adapters???????
    As much as i understand J2EE adapters installed on the XI Server(part of the installation)
    whereas we need to install the J2SE Adapters locally.
    Anybody has any idea ???
    rgds
    RM

    Hi,
    In one of SAP's presentations I've found:
    "Reasons for Decentral SAP J2EE-based AE:
    - Protocol of Sender-/Receiver system (e.g. ftp not allowed)
    - Driver OS - dependent
    - Sender-System has to send independent from IS
    - Performance
    - Organizational Aspects"
    Regards,
    michal

  • J2SE or J2EE on development machine

    Hi,
    I am a newbie trying to find my way in the java SDK environment. I just read the part in the BO SDK development guide about setting up the development machine.
    However, some things are not very clear to me:
    Our BO XI R2 server is running with Apache Tomcat. On my development machine (which is on another computer than the BO server) I downloaded the Eclipse IDE. For this I need a Java installation.
    1. Do I need to download the Java J2SE or the J2EE from the Sun website on my development machine ?
    2. In the development guide they speak about deploying the JAR files. Do I need to copy the JAR files from the BO server on my development PC ?
    3. Set up your web application: must this be done on the development machine or on the Tomcat installed on the BO server ??
    Thanks for helping me out.
    Regards
    Sofie

    Hello Sofie,
    -As per your description, you are using kind of a distributed environment where your Application server is on one machine and your Business Objects Enterprise is on a separate machine.
    Following are the answers of your questions :
    1)Do I need to download the Java J2SE or the J2EE from the Sun website on my development machine ?
    >
    As far as executing a application from remote machine is concerned, I am not getting why you want to install Java.This is because Java is also get installed when you install Businees objects Enterprise(BOE).And this can be seen by going to the default installation directory of BOE.
    However if it is asking you to install Java,you can install it from Sun site.Make sure that Java version that you are going to install should be compatible with your BOE.
    2)In the development guide they speak about deploying the JAR files. Do I need to copy the JAR files from the BO server on my development PC ?
    >
    Yes.You have to copy all the JAR files from the location where you have installed BOE.
    Go to the path : BOEInstallationDirectory/Program Files/Business Objects/common/3.5/Java/lib and copy all the JAR files.You need to paste these JAR files inside lib directory of your client machine where your application is residing on.
    3)Set up your web application: must this be done on the development machine or on the Tomcat installed on the BO server ??
    >
    If you are using distributed environment, you can install Tomcat on client machine to connect it with server machine.
    Just make sure that there are no connectivity issues.This could be checked by typing following URL on client machine:
    http://servermachinename:8080
    Hit the above URL and determine if connectivity is done properly or not.
    Thanks,
    Chinmay

  • J2SE vs J2EE

    What is the difference between these two?

    J2SE is Java 2 Standard Edition, it is a platform for desktop application using Java.
    J2EE is Java 2 Enterprise Edition, it is a platform for developing enterprise application.
    When we develop using J2EE, we use all Java library in J2SE...
    Hope this helps..
    Correct me if I am wrong
    daniel

Maybe you are looking for