Compiling servlet in Eclipse SDK

Why Eclipse cannot find javax.servlet.* and javax.servlet.http.*?
Here is a screenshot:
http://ftf-111.yousendit.com/download/1/0C8661815429FB0F/3a9aafda2ce24bfddee6d37aa7a9df8e8bbf98dc/servlet_error-vi.jpg

do you just want to compile it or deploy it on a server as well? compiling usually isn't the problem, since it's just a simple class as any other.
if you want it assembled as a deployable web-application you will need ant (war-task) or a plugin like lomboz or myeclipseide to do that for you.
hope that helps.

Similar Messages

  • How to compile and run servlets in Eclipse?

    Does somebody known how can I compile and run servlets in Eclipse IDE? I've added and configured Tomcat's plugin. I've created a project with my example servlets source, and I don't know what farther. How do I have compile it without main method? I must add web.xml file from Tomcat's directory into projects in Eclipse and modify it?
    THX Chudzik

    Try googling for "eclipse servlet", surely someone has written instructions.

  • Can't get Eclipse 3.3 to compile servlets

    Hi,
    This is my first time tyring to compile a servlet in Eclipse 3.3. I have serveral errors like "Can not resolve import javax.servlet..." I did include the location of the servlet-api.jar file in my classpath. And not just classpath but I included the location to variables PATH, JAVA_HOME just in case but still no luck. I have browsed the web enough, and tried all the tricks of the trade. I am using jdk1.6_02 and tomcat 5.5.25.
    Can anybody help,
    Thanks in advance!
    Codesingh!

    Okay, let's start simple: An instance of Comparable<T> can be compared to instances of T (for any type T). Lets assume Numbers were Comparable:
    class Number implements Comparable<Number> { /* ... */ }
    class Integer extends Number { /* ... */ }
    class Float extends Number { /* ... */ }This means an Integer can be compared to any Number, such as a Float or another Integer:
    Integer ten = 10;
    Integer five = 5;
    ten.compareTo(five);Now let's write a generic function that can sort lists of items that are comparable with each other:
    public static <T extends Comparable<T>> void sort(List<T> list) { /* ... */ }If you tried to pass a List<Integer> to sort, you would essentially substitute Integer for T, however Integer does not satisfy the upper bound of Comparable<Integer>. If we substitute Integer in the declaration you provided in reply 2
    public static <T extends Comparable<? super T>> void sort(List<T> list) { /* ... */ }we get an upper bound of Comparable<? super Integer>. You're free to substitute "? super Integer" with a supertype[1] of Integer, such as Number and since Integer implements Comparable<Number> the substitution is valid and the call is legal.
    Generics are all about substituting.. ;)
    To answer the question of what does T extends Comparable<? super T> mean: It means you may substitute any type U for T where U is comparable to a supertype[1] of U.
    With kind regards
    Ben
    [1] the super- and subtype relations are reflexive, in other words Integer is a supertype and a subtype of Integer.

  • Trying to run my first servlet through Eclipse + XAMPP

    I'm trying to run my first servlet through eclipse, I'm using XAMPP + Tomcat add-on as my webserver. How do I even try and compile my servlet? I've added the external jar Servlet-api.jar to my project as stated in here, http://www.theserverside.com/discussions/thread.tss?thread_id=37924
    But eclipse wouldn't compile it, because there just isn't a main() in my servlet program..
    Do I need to install the WPT plugin for eclipse? I'm guessing I'm not setting my CLASSPATH correctly - Do I need to set it up manually?

    Nevermind, there were lots of Issues going the XAMPP way, so I just installed Tomcat separately and all is fine now.
    I used instructions from http://www.scribd.com/doc/495993/Installing-Apache-Tomcat-6-and-Using-It-With-Eclipse and it was a walk-in-the-park..

  • Unable to compile application in eclipse

    Please help me compile and run a servlet HelloWorld project in Eclipse.
    I am trying to compile a sample helloWorld Servlet in Eclipse 3.x Europa and Tomcat 6. When I click on Run a window comes up asking do I want to run it as a java application or Applet. If I selet Applet, it said that there is no applet avaible. If I select Java Application is will ask to select an item from the list. The following three items appeasr in a list
    jspC �
    SDCInstaller -
    SmapGenerater �
    If I go to projec to build the class, it is grey out. However, the option Build Automatically is checked.
    If I look in my working directory, I can see a blank bin, src, and work folder. In the WEB-INF directory, I see a empty lib, the scr has the HelloWorld.java, and the class has the Helloworld.class. Please Help me!!!

    Thanks,
    I was able to compile it. First, I start tomcast, and I stop it right away. Then, I click on run, and it run it. However, I am getting the error message. I think it may have to do with the xml file that I am using. I notice the web-app and servlet name are hilight as if they were spelled wrong. If I change web-app to WEB-APP, it does not show me the error but it does not work either. Below is a copy of my web.xml file and the error message that I am getting when I type the url http://localhost:8080/HelloWorld/hello
    " type Status report
    message This application is not currently available
    description The requested service (This application is not currently available) is not currently available.
    Also, I see an exeption in the application see below the class file
    <strong > -- XML FILE </strong>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd"> -->
    <web-app>
    <servlet>
    <servlet-name>Hello</servlet-name>
    <servlet-class>HelloServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Hello</servlet-name>
    <url-pattern>/HelloServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    <strong> class </strong>
    import java.io.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    public class HelloServlet extends HttpServlet {
    public void doGet (HttpServletRequest req,
    HttpServletResponse res)
    throws ServletException, IOException
    PrintWriter out = res.getWriter();
    out.println("Hello, Brave new World!");
    out.close();
    <strong > error Message </strong>
    Jan 10, 2008 10:52:02 AM org.apache.catalina.core.AprLifecycleListener init
    INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.5.0_14\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jre1.6.0_03\bin\client;C:\Program Files\Java\jre1.6.0_03\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.5.0_14\bin;C:\JDBC\sqljdbc_1.2\enu\sqljdbc.jar;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Tomcat;C:\Tomcat\bin;C:\eclipse\Workspace;c:/.;C:\Tomcat\lib\servlet-api.jar;C:\Tomcat\lib\jsp-api.jar
    Jan 10, 2008 10:52:02 AM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Jan 10, 2008 10:52:02 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 896 ms
    Jan 10, 2008 10:52:02 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Jan 10, 2008 10:52:02 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
    Jan 10, 2008 10:52:02 AM org.apache.tomcat.util.modeler.Registry registerComponent
    SEVERE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/HelloWorld,J2EEApplication=none,J2EEServer=none
    Jan 10, 2008 10:52:02 AM org.apache.catalina.startup.HostConfig deployDescriptor
    SEVERE: Error deploying configuration descriptor HelloWorld.xml
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
         at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:108)
         at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:58)
         at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:297)
         at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1064)
         at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4239)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
         at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
         at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:516)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Jan 10, 2008 10:52:03 AM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Jan 10, 2008 10:52:03 AM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Jan 10, 2008 10:52:03 AM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/31 config=null
    Jan 10, 2008 10:52:03 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 1348 ms
    Jan 10, 2008 10:52:13 AM org.apache.tomcat.util.modeler.Registry registerComponent
    SEVERE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/HelloWorld,J2EEApplication=none,J2EEServer=none
    Jan 10, 2008 10:52:13 AM org.apache.catalina.startup.HostConfig deployDescriptor
    SEVERE: Error deploying configuration descriptor HelloWorld.xml
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
         at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:108)
         at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:58)
         at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:297)
         at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1064)
         at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4239)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
         at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
         at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
         at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1206)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
         at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
         at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
         at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
         at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
         at java.lang.Thread.run(Thread.java:595)

  • Unable to compile servlet files in javac

    i am unable to compile servlet *.java files in javac.as far as i can see my path is correct.
    Kindly provide a solution as soon as possible.
    My jdk1.3 is in my c drive and my tomcat in my d drive.
    if you are able to compile kindly let me know your path.
    it says symbol not resolved.i think that it is unable to import from javax

    Assuming that your jdk is in c drive as c:\jdk1.3 set the path and the classpath like as shown below. Remember that you have to set the classpath for the classes in the javax.servlet and javax.servlet.http packages. I know how to do it for JavaWebServer. JavaWebServer has a jar called servlet.jar that contains all these classes. What you need to do is to put this jar file in your classpath. There will be a similar jar file for Tomcat server also. You need to refer the Tomcat server documentation for that.
    The path and the classpath have to be set like this...
    d:\>path=%path%;.;c:\jdk1.3\bin;
    d:\>set classpath=%classpath%;.;c:\jdk1.3\lib;c:\JavaWebServer2.0\lib\servlet.jar;
    assuming tht JWS is installed in c:\JavaWebServer2.0
    Also note that there should be no spaces in between while setting the classpath. In your case you have to change the last part of the classpath to customize your requirement.
    Hope that will help.
    Regards
    Jaydeep

  • Not Able to compile Servlet from ?

    Hi All,
    I am not able to compile Servlet from my package:
    1) I Have set the CLASSPATH Variable using below line in System Variables:
    C:\CC4\prog\jakarta-tomcat-4.1.30\common\lib\servlet.jar
    2) Also Set the CATALINA_HOME with value
    C:\CC4\prog\jakarta-tomcat-4.1.30
    as per above setting servlet should be compiled but still i m getting error message:
    1) C:\CC4\prog\jakarta-tomcat-4.1.30\project\classes\com\example>javac ListenerTest
    er.java
    ListenerTester.java:17: cannot resolve symbol
    symbol : class Dog
    location: class com.example.ListenerTester
    Dog dog = (Dog) getServletContext().getAttribute("dog");
    ^
    ListenerTester.java:17: cannot resolve symbol
    symbol : class Dog
    location: class com.example.ListenerTester
    Dog dog = (Dog) getServletContext().getAttribute("dog");
    ^
    2 errors
    2) Error while compiling other file:
    C:\CC4\prog\jakarta-tomcat-4.1.30\project\classes\com\example>javac MyServletCon
    textListener.java
    MyServletContextListener.java:12: cannot resolve symbol
    symbol : class Dog
    location: class com.example.MyServletContextListener
    Dog d = new Dog(dogBreed);
    ^
    MyServletContextListener.java:12: cannot resolve symbol
    symbol : class Dog
    location: class com.example.MyServletContextListener
    Dog d = new Dog(dogBreed);
    ^
    2 errors
    So what could be the posible solution here :
    do reply !!!
    please
    Thanks
    prabhat

    I have added servlet.jar in the classpath. But the program is not compiling.The error message says that it can not find classes like ServletConfig, ServletException, Cookie etc. Please help.

  • Getting error in compiling servlet

    I am trying to compile servlet and I am getting error "cannot resolve symble : class HttpServlet"
    there are 6 error almost same not resolve servlet or http. I already add jdk1.3.1 and tomcat in my path I don't understand why I am getting this error please help me.

    You need to add servlet.jar into the classpath. You can find servlet.jar in tomcat_home\lib dir.

  • I can't compile servlets

    Please ignore my previous Thread.
    Where do you get the nessecary libaries to compile servlets, and what directory of the JSDK1.4.0/ directory do you put them in (Im using Win98se)

    File To Compile:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloClientServlet extends HttpServlet
         protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
         res.setContentType("text/html");
         PrintWriter out = res.getWriter();
              out.println("<HTML><HEAD><TITLE>Hello Client!</TITLE>"+
         "</HEAD><BODY>Hello Client!</BODY></HTML>");
              out.close();
         public String getServletInfo()
              return "HelloClientServlet 1.0 by Stefan Zeiger";
    Error Messages:
    C:\ServletDevelopment\HelloClientServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    C:\ServletDevelopment\HelloClientServlet.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    C:\ServletDevelopment\HelloClientServlet.java:4: cannot resolve symbol
    symbol : class HttpServlet
    location: class HelloClientServlet
    public class HelloClientServlet extends HttpServlet
    ^
    C:\ServletDevelopment\HelloClientServlet.java:6: cannot resolve symbol
    symbol : class HttpServletRequest
    location: class HelloClientServlet
         protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    ^
    C:\ServletDevelopment\HelloClientServlet.java:6: cannot resolve symbol
    symbol : class HttpServletResponse
    location: class HelloClientServlet
         protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    ^
    C:\ServletDevelopment\HelloClientServlet.java:6: cannot resolve symbol
    symbol : class ServletException
    location: class HelloClientServlet
         protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    ^
    6 errors
    Tool completed with exit code 1

  • Compiling servlets

    I cant compile servlets.
    Im using tomcat and I tried to compile the servlets in the example seperately but theres always errors. However when I execute the file from the example folder it runs just nicely.
    This is an example of the error produced:
    equestInfoExample.java:22: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    RequestInfoExample.java:23: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    RequestInfoExample.java:25: package util does not exist
    import util.HTMLFilter;
    ^
    RequestInfoExample.java:33: cannot resolve symbol
    symbol : class HttpServlet
    location: class RequestInfoExample
    public class RequestInfoExample extends HttpServlet {
    ^
    RequestInfoExample.java:38: cannot resolve symbol
    symbol : class HttpServletRequest
    location: class RequestInfoExample
    public void doGet(HttpServletRequest request,
    ^
    RequestInfoExample.java:39: cannot resolve symbol
    symbol : class HttpServletResponse
    location: class RequestInfoExample
    HttpServletResponse response)
    ^
    RequestInfoExample.java:40: cannot resolve symbol
    symbol : class ServletException
    location: class RequestInfoExample
    throws IOException, ServletException
    ^
    RequestInfoExample.java:105: cannot resolve symbol
    symbol : class HttpServletRequest
    location: class RequestInfoExample
    public void doPost(HttpServletRequest request,
    ^
    RequestInfoExample.java:106: cannot resolve symbol
    symbol : class HttpServletResponse
    location: class RequestInfoExample
    HttpServletResponse response)
    ^
    RequestInfoExample.java:107: cannot resolve symbol
    symbol : class ServletException
    location: class RequestInfoExample
    throws IOException, ServletException
    ^
    RequestInfoExample.java:76: cannot resolve symbol
    symbol : variable HTMLFilter
    location: class RequestInfoExample
    out.println(HTMLFilter.filter(request.getRequestURI()));
    ^
    RequestInfoExample.java:84: cannot resolve symbol
    symbol : variable HTMLFilter
    location: class RequestInfoExample
    out.println(HTMLFilter.filter(request.getPathInfo()));
    ^
    12 errors
    why is this.
    Please someone help me here!!
    Thanks in advance.

    what ever the above steps had i done i got the same error
    httpservletrequest unable to resolve symbol
    what i made is mycomputer>properties>advaced>envirinment variables>path>C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.*;(as am i using tomcat 5)and
    in cmd prompt set classpath=C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.*;and
    in cmd prompt set path=C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.*;got the same result unable to resolve the symbol pls i need some ones help

  • Can I compiler servlet with java compiler?

    Can I compiler servlet with java compiler?
    Here is an example of it:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class HelloWorldServlet extends HttpServlet
              protected void doGet(HttpServletRequest request,
              HttpServletResponse response) throws ServletException , IOException
                        response.setContentType("text/html");
                        PrintWriter out = response.getWriter();
                        StringBuffer sb = new StringBuffer();
                        sb.append("<html><body><h1>");
                        sb.append("Hello World");
                        sb.append("</h1></body></html>");
                        out.print(sb.toString());
                        out.close();
         }

    Can I compiler servlet with java compiler?
    yes.
    just include the correct jarfiles in your classpath.

  • How to run Servlets in Eclipse

    Am trying to run a servlet in elipse...but when i do so, the file which is am runnig is getting downloaded in my browser....
    What should i do.....

    You can't. You can only run it in a servlet container. There are plugins which allow you to easily deploy to and control a servlet container from within Eclipse, and some people mistake that for "running a servlet in Eclipse" but you'll have to learn how to deploy to a container at some point, so you may as well do it now. Once you know how to do that, google for "j2ee eclipse plugins" and you'll get loads of hits, some of which are even useful

  • How to run a servlet in eclipse using "SAP Portal Plugin"  ( not tomcat)

    Hi All
    I'm just trying to create a simple servlet in Eclipse using SAP Portal Plugin but I couldn't find any document.
    I have an eclipse 2.1
    EP6 SP2 patch 5
    SAP Portal Plugin
    I created a Portal Application Project.
    I created a simple servlet and save it under src.core directory.
    My question is as follow:
    1) Which directory I should put in the file web.xml?
    2) Do I export this as *.par file?
    3) When I export it. Can I just call the servlet from the url?
    Anyone help.. I really appreciate.
    thanks much.
    Jen

    Hi,
      Portal plugin is used for developing SAP Portal applications ie Java iviews.
    There is a set of procedures to develop Java iViews . You can develop either AbstractPortalComponent which is more or less equivalent of servlet in ordinary java world or JSPDynPage which is equivalent of JSP.
    These plugins are used to develop any of the above portal components. If you are developing java applications for portal then you have to develop either of the above using the tools. These portlets( portal applications runs on Portal run time)
    But servlets can run on J2EE itself.
    But if your requirement is to develop servlet then you can create ordinary java project and deploy that in the J2EE server as like in any app server.
    Regards,
    Abdul Raheem .S

  • Compiling servlet with helper class

    Hello,
    I have to write a very large number of database queries and huge amount of code so I decided to make each helper *.class file for each table.
    Now I have a main servlet that should instantiate each of these helper classes and conduct DB operations:
    //Servlet code
    RescardreservationTable rv = new RescardreservationTable();
    rv.insertInfo();
    RescardPassengerTable rp = new RescardPassengerTable();
    rp.insertInfo();RescardreservationTable.class
    //does DB opsMy problem is that when I try to compile servlet, I get
    insert_data.java:172: cannot find symbol
    symbol : class RescardreservationTable
    location: class insert_data
    RescardreservationTable rv = new RescardreservationTable();
    Could somebody please tell me how I can make servlet locate my java classes that it has to use?
    Thanks,
    Victor.
    Edited by: vic_sk on Dec 9, 2008 9:29 AM

    Ok, looks like it's solved. Just forcing the compiler with -classpath to look for the required class file.

  • Newbie question: how to compile servlet using tomcat?? Thank you

    How to set classpath? How to compile servlet.java?

    jsp is also converted into a servlet .java nd then into a class file
    this is index.jsp
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>untitled</title>
      </head>
      <body>
      </body>
    </html>this is _index.java
    /*@lineinfo:filename=/index.jsp*/
      /*@lineinfo:generated-code*/
    import oracle.jsp.runtime.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    public class _index extends com.orionserver.http.OrionHttpJspPage {
      public final String _globalsClassName = null;
      // ** Begin Declarations
      // ** End Declarations
      public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException {
        response.setContentType( "text/html;charset=windows-1252");
        /* set up the intrinsic variables using the pageContext goober:
        ** session = HttpSession
        ** application = ServletContext
        ** out = JspWriter
        ** page = this
        ** config = ServletConfig
        ** all session/app beans declared in globals.jsa
        PageContext pageContext = JspFactory.getDefaultFactory().getPageContext( this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);
        // Note: this is not emitted if the session directive == false
        HttpSession session = pageContext.getSession();
        if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) {
          pageContext.setAttribute(OracleJspRuntime.JSP_PAGE_DONTNOTIFY, "true", PageContext.PAGE_SCOPE);
          JspFactory.getDefaultFactory().releasePageContext(pageContext);
          return;
        int __jsp_tag_starteval;
        ServletContext application = pageContext.getServletContext();
        JspWriter out = pageContext.getOut();
        _index page = this;
        ServletConfig config = pageContext.getServletConfig();
        try {
          // global beans
          // end global beans
          out.write(__oracle_jsp_text[0]);
        catch( Throwable e) {
          try {
            if (out != null) out.clear();
          catch( Exception clearException) {
          pageContext.handlePageException( e);
        finally {
          OracleJspRuntime.extraHandlePCFinally(pageContext,false);
          JspFactory.getDefaultFactory().releasePageContext(pageContext);
      private static final char __oracle_jsp_text[][]=new char[1][];
      static {
        try {
        __oracle_jsp_text[0] =
        "\n<html>\n  <head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">\n    <title>untitled</title>\n  </head>\n  <body>\n  </body>\n</html>\n".toCharArray();
        catch (Throwable th) {
          System.err.println(th);
    }as you can see.. my IDE converts it into a java class so it can be conpiled to a class file.. by the way i use Oracle Jdeveloper 10g for this pupose of showing you what is happening to your jsp

Maybe you are looking for

  • Scanning documents with brother printer.

    I can scan but then it goes nowhere.  How can I get the document that I can see was scanned to my desktop where it says it should be?

  • Multiple instances in Windows 7. & Adding Administrator in DBA group

    i have installed two databases Using DBCA in win7, & den used set oracle_sid= <old instance name> then when i said  sqlplus / as sysdba The new instance is starting.. then i tried sqlplus  sys/sys  as sysdba previous instance password.. it's asking f

  • Trouble Sending HTML Form Data

    I've been tasked with replicating the following HTML in actionscript for the integration of a flash frontend onto an existing cart system: HTML Code: <form name="campaign" method="post" action="https://www.client.net/portal/site/client/template.APPFO

  • Dump after going back from a view

    i call view VIEW_SPRL from view VIEW_ALTA, and when i go back to VIEW_ALTA using navigation plugs, this view is showed for about a second and inmediately after i get the dump error "Access via 'NULL' object reference not possible" Any idea ? Should i

  • JDBC getConnection

    hi, from some time I try to get a connection with a database for a standalone program on my computer using JDBC but I am not able to finish my purpose... and I am looking for for some help. I had a connection to an Microsoft access database with the