Tomcat servlet question.

I created a really simple servlet named Log ( "Hello World") that was created in a Packet called World.
When I try to run this servlet using
http://1#.3#.1#4.1#9:8080/World/servlet/Log
Tomcat generated this error :
Error: 500
Location: /World/servlet/Log
Internal Servlet Error:
java.lang.NoClassDefFoundError: Log (wrong name: World/Log)
     at java.lang.ClassLoader.defineClass0(Native Method)
How can I call this servlet ?
I has been using servlets with websphere without problems.
Thanks in advance.

JSP's don't have to be registered but they can. Servlets that are not in packages can be put directly into WEB-INF/classes and not registered.
As a caveat,this may not apply for all servers. I know that weblogic requires that all servlets be registered and mapped to an alias.

Similar Messages

  • Should I install Apache Web server to use Jakarta Tomcat Servlet engine?

    Hello,
    I have some problems and now have a question:
    Should I install Apache Web server to use Jakarta Tomcat Servlet engine?
    JTK home page is available via http://localhost:8080
    Tomcat ver 3.1.3
    Thanks.

    No, you don't need to run Apache webserver (httpd) to run Tomcat. Tomcat by default runs on port 8080, but you can set it to any port, including 80, if you have permission to do so (on *nix systems, you need root permissions to run services on any port below 1024).
    Tomcat is a webserver as well, just one that includes a servlet container and JSP processor. So it will serve your html files, images, etc (aka static content), just as well as Apache httpd, in addition to being able to run servlets and JSPs.
    Apache httpd has more options for serving static content than Tomcat, so many people prefer to use it as their main webserver and only use Tomcat as a sort of "plugin" to handle servlets and JSPs. This can be achieved through a connector. Instructions on how to set this up are on the Jakarta website.
    So you could use Apache and Tomcat combined, next to each other, or totally separated. In many cases, just Tomcat will do.

  • Compiled Tomcat Servlet Example & got JAR, not WAR?

    Is there a basic reference on how to create a simple servlet with NetBeans 4.1 and deploy it to Tomcat?
    When I created the project I chose Samples->Web->Tomcat Servlet Example, and yet it does not create a WAR file on compilation.
    And of course once I'm past that I have to figure out how to edit the XML file, I gather.
    I need a reference that will hold me by the hand and walk me through it once to kick start me.
    After that I think I can make it without having to ask such newbie questions.

    Hi,
    not sure to what extent you are clear in build.xml file (done thru ant).
    what i can tell you is, ant creates any archive file (be it .jar, .war, .ear) with the tasks named "jar" (<jar jarfile="yourfilename.jar"..>), "war" and "ear". But both war and ear are the extensions of the jar only.
    You can achieve creation of any archive file with the jar task itself.
    you need to take care of the following...
    (1) you can /should edit the extension of the files at every stage.. first .jar and then .war and then .ear (if necessary) => basic flow
    (2) at every step, you have to have a file inclusion inside the corresponding archive file..
    say for example, for a .jar file you should include all the compiled .class files, and ejb-jar.xml (incase you use ejbs) and other built-in jar files....
    In case of .war files (web archive) you should include the web.xml file, any static files (html, jsp etc), any tld files - it goes with your application's nature and requirement.....
    fyi, i m including a sample build.xml file which i use for a webapplication, so it deals with war...
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="ServletsReqDispFwd" default="deploy">
         <property name="top" value="."/>
         <property name="webinf" value="${top}/WEB-INF"/>
         <property name="lib" value="${webinf}/lib"></property>
         <property name="classes" value="WEB-INF/classes"/>
         <property name="jboss.dir" value="D:\jboss-3.2.2RC3\server\default\deploy"></property>
         <property name="tomcat.dir" value="D:\jakarta-tomcat-4.1.27\webapps"></property>
         <property name="warfile" value="ServletsReqDispFwd.war"></property>
         <property name="src" value="${top}/src"/>
         <property name="web.xml" value="WEB-INF/web.xml"/>
         <target name="package">
              <javac srcdir="${src}" destdir="${classes}"
                     listfiles="true" debug="true"  verbose="true"
                          classpath="${lib}/*.jar"/>
              <war warfile="${warfile}" webxml="${web.xml}">
                   <webinf dir="${top}">
                        <include name="**/*web*.xml"/>
                        <include name="**/*application*.xml"/>
                        <exclude name="src/**/*.xml"/>
                   </webinf>
                   <lib dir="${lib}">
                        <include name="*.jar"/>
                   </lib>
                   <fileset dir="." includes="**/*.html"/>                    
                   <classes dir="${classes}" includes="**/*.class"></classes>                         
              </war>
         </target>
         <target name="deploy" depends="clean,package">
              <copy file="${warfile}" todir="${tomcat.dir}" overwrite="true"></copy>
         </target>
         <target name="clean">
                <delete dir="${classes}">
                     <filename name="*.class"/>
              </delete>
              <delete>
                   <fileset dir="${top}" includes="${warfile}"/>
              </delete>
              <delete>
                   <fileset dir="${tomcat.dir}" includes="${warfile}"/>
              </delete>
         </target>
    </project>hope this contribues to a certain extent to help you edit the buildfile (xml file as you go) to meet your requirement.....

  • Tomcat servlet respond with "302 Moved Temporarily" to HTTP GET requests

    I started Tomcat (4.1.31) on a Unix machine (SunOS 5.8)
    I tested the tomcat servlet using the following commands:
    telnet 0 80
    Trying 0.0.0.0...
    Connected to 0.
    Escape character is '^]'.
    GET /index.html HTTP/1.0
    HTTP/1.1 302 Moved Temporarily
    Location: http://localhost/
    Content-Length: 0
    Date: Mon, 17 Oct 2005 18:09:15 GMT
    Server: Apache-Coyote/1.1
    Connection: close
    Any other servlet that I test responses with the same result
    Tomcat version 4.1.31
    SDK build 1.3.1_02-b02
    Solaris SunOS 5.8

    "302 Moved Temporarily" is a web server error (I googled it - see e.g. http://www.checkupdown.com/status/E302.html)
    Two recommendations that you can try:
    - do not use 'localhost' - use computer assigned name, or at worst IP address
    - in my system, Server URL is set to http://ecm-base:16200/cs/idcplg (from ODC). Try to modify yours accordingly.

  • Tomcat Servlet - TCP Port Already in Use?

    My problem is that tomcat/servlet is not releasing its TCP port after my servlet closes the port. Next time a servlet tries to use the port it gets an error "Port already in use". Using netstat I can see the port is still in use. If I stop tomcat and restart it, the port is released. I have not had this sort of problem writing C programs that use sockets.
    My setup is Fedora Core 6 with JDK1.5_14 and Tomcat 5.5.26. I know it's not the latest, but sockets and streams have been around for a long time.
    Actual implementation uses a trivial javaserver page to instantiate a class to create/accept connection from a client (JApplet). After connection, it starts a thread to receive data. I am using ServerSocket(), InputStreamReader(), and OutputStreamWriter(). On ServerSocket I set ReuseAddress to true.
    I have try/catch on all my I/O and use tomcat context log for error and OK messages. Data transfer is perfect. Detect close by client works. In the context log I see close of streams and ServerSocket occur with no exceptions. Then, I manually close the jsp window. No indication of any problems. If I use different port 2nd time (e.g. 50001) it all works perfect. If I use my default (50000) again, servlet gets an error during bind, "Port already in use".
    2.5 years with Java. 5 years with Linux and C.
    Please advise or refer

    rwengr wrote:
    My problem is that tomcat/servlet is not releasing its TCP port after my servlet closes the port. Next time a servlet tries to use the port it gets an error "Port already in use". Using netstat I can see the port is still in use. If I stop tomcat and restart it, the port is released. I have not had this sort of problem writing C programs that use sockets.Nice.... Not sure that matters though.
    >
    My setup is Fedora Core 6 with JDK1.5_14 and Tomcat 5.5.26. I know it's not the latest, but sockets and streams have been around for a long time.
    Actual implementation uses a trivial javaserver page to instantiate a class to create/accept connection from a client (JApplet). Bleah! Don't use a JSP for that. Use a servlet at worst. At best use a Servlet to start some other socket manager class which you can/have tested outside the Servlet Container environment.
    After connection, it starts a thread to receive data. I am using ServerSocket(), InputStreamReader(), and OutputStreamWriter(). On ServerSocket I set ReuseAddress to true.
    I have try/catch on all my I/O and use tomcat context log for error and OK messages. Data transfer is perfect. Detect close by client works. In the context log I see close of streams and ServerSocket occur with no exceptions. Then, I manually close the jsp window. Closing the browser window has no affect on the server.
    No indication of any problems. If I use different port 2nd time (e.g. 50001) it all works perfect. If I use my default (50000) again, servlet gets an error during bind, "Port already in use".
    2.5 years with Java. 5 years with Linux and C.
    Please advise or referShow some code. If you just want some generic advice it would be to close the port, as soon as you don't need it anymore. But you know that. Without any further code I think that is about all that can be said.
    P.S. Make the code as small as possible, compilable, but still demonstrating the problem. Also see: [this tutorial as an example...|http://www.javaworld.com/javaworld/jw-12-1996/jw-12-sockets.html?page=1]

  • Tomcat servlet/JSP container default files on 10gAS(10.1.2.0.2)

    Hi Friends,
    I am using Oracle Application Server 10g (10.1.2.0.2) on windows
    I have the Vulnerability: Apache Tomcat servlet/JSP container default files.
    and the fix is Review the files and delete those that are not needed.
    i would like to know the location of the files to review and delete.Please suggest?
    Regards,
    DB

    Apache/Tomcat is not related to OAS, where did you get this info? OAS is based in a Orion Web Server and Apache HTTP Server, not Tomcat.
    For this kind of problems there are the CPU you may want to check in Metalink for them.
    Can you clarify also what default files?
    Greetings.

  • CiscoWorks Tomcat Servlet Engine service does not start

    Hello!
    CiscoWorks  Tomcat Servlet Engine service does not start.
    Events in the Windows Event Viewer:
    The CiscoWorks Tomcat Servlet Engine service terminated unexpectedly. It has done this 1 time(s).
    output pdshow and file stderr.log,  hs_err_pid2128.log attached.
    Do  you have an idea how to resolve this?
    Thanks!

    The only things which I see are wrong are the start types for the IPM NG database engine and HUM database engine services.  They must be set to Manual, not Automatic.  However, that would not account for the Tomcat crash.  The crash points to an error in the code which processes regdaemon.xml, but I see no reason why that should be failing.  As I said before, I think it would be best to open a Service Request.  Remote access would be helpful to dig into this problem in more detail.
    Please support CSC Helps Haiti
    https://supportforums.cisco.com/docs/DOC-8895
    https://supportforums.cisco.com

  • Tomcat output question

    hi all
    i think this is a simple (and quite stupid) question, but i don't know ho to solve my problem
    i work on two computer (windows 2k), one where i have tomcat installed not like a service, the other with tomcat installed like a service.
    when i write some servlet or jsp page i use to debug it through System.out.println() method to get the output. when i work on the 1st machine i can read the output directly by the prompt, but the problem arrives on the other machine, when no prompt is opened running tomcat.
    is there a way (log file and so on) to get my application's output running under tomcat? the version is 4.1.18
    thanx a lot
    sandro

    Hi. the solution is quite simple.
    Go to your TomcatHome (where you installed it) and look for a folder called log. To check your System.out.println stuff on your tomcat as windows service just take a look to an archive called stdout.txt or something similar (can't remember the exact name)
    DFF

  • Debugging a remote tomcat servlet

    I have the following setup:
    win2000sp2advanced server with an application (Interwoven TeamSite) running a scaled down version of Tomcat 3. This tomcat is serving a war called webdesk.war. Runtime, the war file is unpacked in this location: c:\iw-home\httpd\webapps\webdesk
    Sun Java Studio 8 on a winxpsp2 laptop
    I setup the following java and UML model in JS8:
    UMLProjectWebDesk
    WebDeskSRC
    My objective is to run a remote debugging session on the servlet and to set a breakpoint in the servlet class which I can see listed, using the projects view, in Libraries> webdesk.jar>com.interwoven.teamsite.filesys>FileTemplatesServlet.class
    I configured debugging on the TS servlet with the following switch on servletd.exe (the tomcat start executable called via a perl script to start as a windows service):
    "-Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n".
    When I select Run>AttachDebugging, I select JPDA Debugger, SocketAttach, dt_socket, 10.101.2.153 and port 8888 where 10.101.2.153 is the ip address of the server where servletd.exe is running and the servlet resides.
    In the Debugger Console I see "Attaching to 10.101.2.153:8888" and " User program running" so I guess that the debugger is actually attached (I have seen errors before when I did not put any attributes on the server's jvm).
    The problem that I have is more of a lack of understanding in the software. I googled a lot without finding the exact answers before resolving to this forum. I hope I am not asking for something stupid here, but need some guidance.
    It seems that the servlet class FileTemplatesServlet.java has not been downloaded by Java Studio Enterprise 8, so that I cannot put a breakpoint on this class.
    I also tried to put a breakpoint on any other jsp file that is part of my remote application and it seems not to work.
    The question is if someone can establish if I did something terribly wrong in setting up this project? Something simple I oversaw?
    arnout cator
    Technical Support Engineer
    [email protected]

    thanks for the reploy! To be more specific:
    I have the source code for all the libraries that the web application uses here: c:\TS_JSE_debugging\webdesk\WEB-INF\lib
    I want to set a breakpoint in the local java source file C:\TS_JSE_debugging\webdesk\WEB-INF\lib\webdesk\com\interwoven\teamsite\filesys\FileTemplatesServlet.java
    In JSE8 I went into the java project properties window and clicked on the Sources tab. I added the Package Folder C:\TS_JSE_debugging\webdesk\WEB-INF\lib to the Source Package Folder. R:\iw-home\httpd\webapps\webdesk\WEB-INF\jspc was already listed there. I understand that JSE8 decompiled all the class files in the jspc folder into .java files and put them in the jspc folder. That makes me believe that my servlet FileTemplatesServlet.class should be debugged when I set a breakpoint now on a line in my local decompiled source in FileTemplatesServlet.java.
    I did that and then I get a message back in the bottom left pane of the JSE8 UI saying: " Source file for com.interwoven.teamsite.filesys.FileTemplatesServlet not found"
    Question is: I thought I just added the source to the project?
    I am now proceeding into the other 2 replies!
    thanks
    arnout cator

  • Good, cheap, non-tomcat servlet container?

    Specifically, not using the Jasper jsp compiler, as it can't be counted on to recompile a changed .jsp (see http://issues.apache.org/bugzilla/show_bug.cgi?id=33453). I am frustrated with Apache software quality and (lack of)support, and searching for alternatives to Tomcat. It would also have to either work with JBoss or include an EJB stack with similar functionality to JBoss.
    I have looked at Sun Application Server, which appears to use Tomcat in its entirety, and Jetty, which uses Jasper.

    Here's a quote from Resin ML archive:
    <quote>
    From Resin users ML archive:
    Q:
    I have a general question about the most effective way to process JSP page
    updates.
    My impression of the JSP engine is that in the event of a change to the JSP
    file (changed file modification date), the JSP page is automatically
    recompiled and reloaded. This is a great feature -- it means you have the
    flexibility that is often found in interpreted languages like Perl in terms
    of not having to restart the server when changes are made.
    Unfortunately for me, that flexibility breaks down when I start including
    JavaBeans, or other Java classes into my JSP pages through the "import"
    directive. There doesn't seem to be any way to make a JSP page also
    dependent on another external class file, and to force recompilation if
    that external class file
    Here's an example...
    start of file MyJSP.jsp...
    <@ page language=java
    import="com.mycompany.MyClass,caucho.sql.db.*,java.io.*" />
    ....some JSP code mixed with HTML....
    end of file MyJSP.jsp
    For the above JSP file, the servlet engine doesn't seem to recognize that
    the JSP page is dependent on the file "com.mycompany.MyClass". If I make
    any changes to the file MyClass.java and recompile, the changes won't take
    effect until I restart the servlet engine.
    Any thoughts on how to make a JSP file explicitly dependent on another
    external file?
    I suppose you could try to use a utility like make to help manage
    dependencies, but this gets ugly -- especially for compiled JSP page
    servlet classes which are temporary anyways. Any suggestions for a solution
    to this problem?
    ----- Bryan Bunch
    A:
    You don't actually need to recompile the JSP pages, you just need them
    reloaded. JSP pages are just like any other Java classes; you usually can
    compile classes independently. The only case where you need the JSP pages
    recompiled is if you change 'final static' constants.
    If your classes are in the global classpath, there's nothing Resin can do. I
    don't know how you're loading your classes like com.mycompany.MyClass.
    However, you can put them in WEB-INF/classes or in a jar in WEB-INF/lib. When
    any class/jar in either changes, Resin will reload the entire application
    including any JSPs. I'm pretty sure this is what you want.
    Resin lets you add to the auto-update class path. Here's how:
    <http-server>
    <classpath id='/home/myhome/ws/classes'/>
    <classpath id='/home/myhome/ws/myjar.jar'/>
    </http-server>
    If any of the classes in /home/myhome/ws/classes changes, Resin will reload
    the application just like it reloads a JSP.
    If you're really daring, you can have Resin compile your beans for you.
    (There are a few important bugs fixed in the latest snapshot, so you would
    want to use the snapshot.) That way, you get auto-compilation and
    auto-loading of your beans when you change any Java source. This is certainly
    helpful for small test cases, but it can get confused for large projects.
    <classpath id='/home/myhome/ws/classes' source='/home/myhome/ws/src'/>
    -- Scott
    </quote>

  • Defined the Server as a valid Tomcat Servlet! AND ajust Client to Tomcat

    I am sorry for this amateurs questions. I have never used Tomcat, and am having some problems in placing a Server in one.
    Basically i have made in JAVA a Client and Server, and wish to place the Server in a TomCat, and keep the Client in my machine (for now).
    I am using Socket communication, so i have changed the port to 8081 (the one supported by my TomCat Server).
    My problem, is that i am supposed to place the Java.Class somewhere, and also i need to place some code in the Java Classes... like:
    Import Javax.servlet.*;
    Import Javas.servlet.jsp.*;
    Do i also need to use Extension to JSPServlet in my java functions???
    If you could point me to an example, it would be very appreciated...
    Thanks

    1:
    the database has nothing to do with the web application and therefore it
    should be stored in a sepaerate location
    2:
    the error about not finding the database should be fixed be changing the
    connectin url not by placing the database in a different location.
    set the database up as a ODBC datasource and connect to it by using
    the datasource name.
    check out the jdbc tutorial, it deals with jdbc/odbc bridge.
    3:
    acccess is not a database and is not recommended to use it with
    web applications
    4:
    you should be using Connection pooling to connect to databases

  • TOMCAT Servlets

    I have TOMCAT working on WINDOWS-XP.
    I can create and execute JSP's but I cannot find the servlets that should be generated.
    (either the .java or the .class file)
    Where are they? Do I need to set some variable to generate them?
    Also, does anybody know how to use packages in TOMCAT?

    find the servlets that should be generated. look in
    yourTomcathome\work\localhost\yourContext\jsp
    Use packages as you normally do.
    Could you ask your question in more detail?

  • Tomcat Servlet Security Problem? : Start Excel with NJAWIN - COMObjects

    I get an exception when I start my programm as servlet , as application it works just fine (when I start it as Servlet in the internal Tomcat from JBuilder it also works fine).
    Application app = new Application(Application.progID); // interfaces built with java2com for Excel
    com.develop.jawin.COMException: 8000ffff: CoCreateInstance for "{024500-00-0000-c000-000000000046}" failed
    at com.develop.jawin.win32.Ole32.CoCreateInstance(Unknown Source)
    at com.develop.jawin.win32.Ole32.GetFromProgID(Unknown Source)
    at com.develop.jawin.DispatchPtr.<init>(Unknown Source)
    at excel2pdf.Excel._Application.<init>(_Application.java:31)
    Actually Excel is started but as SYSTEM and not as my Username. Perhaps there's a problem with the security policy, I already gave all rights to catalina for my whole projekt( each directory of it). Have smb already had this problem? Any Ideas?

    Thanks for answering
    In my case I think I cannot use POI because I need Excel
    and a Virtual Printer , so I can convert excel files with exactly the same
    format to PDF. POI is suppose better idea for creating or manipulating
    OpenOffice files (they are working together with OO on file formats),
    and unfortunately OpenOffice doesnt work fine with charts (I already had
    this solution, openoffice-server and Uno ).
    It must be smth with Tomcat-Configuration or security, because my
    programm is working with the internal tomcat-server of JBuilder, and
    as application too. In both cases Excel is started with my username and
    not SYSTEM (my tomcat server is started as service, perhaps thats why
    by starting excel from my servlet Excel is by user - SYSTEM).

  • [TOMCAT] [SERVLET] : The requested resource () is not available.

    Hi!! I'm looking for an answer to my problem, and I'm going to explain what I mean.
    I've created a .jar named yuhuuTunnel.jar that has the following structure:
    yuhuuTunnel.jar:
    --> web (contains the servlets)
          --> *.class
          --> HelloWorldServlet.class
    --> META-INF
          --> MANIFEST.MF
    --> SimpleClient.classThe code of HelloWorldServlet.java is this:
        package web;
        import java.io.IOException;
        import java.io.PrintWriter;
        import javax.servlet.http.HttpServlet;
        import javax.servlet.http.HttpServletResponse;
        import javax.servlet.http.HttpServletRequest;
        import javax.servlet.ServletException;
        import javax.servlet.ServletConfig;
        public class HelloWorldServlet extends HttpServlet {
            public void init(ServletConfig config) throws ServletException {
                super.init(config);
            public void doGet( HttpServletRequest request, HttpServletResponse response )
                    throws ServletException, IOException {
                doPost(request, response);
            public void doPost( HttpServletRequest request, HttpServletResponse response)
                    throws ServletException, IOException {
                response.setContentType("text/html");
                PrintWriter out = response.getWriter();
                out.println("<html>");
                out.println("<body>");
                out.println("<body bgcolor=\"white\">");
                out.println("<h1>Yuhuu Servlet!</h1>");
                out.println("</body>");
                out.println("</html>");
        }then, using a .war file (created with ANT), I've created into /../tomcat/webapps/ a directory call yuhuuTunnel that has this structure:
        /webapps/
              --> yuhuuTunnel
                    --> WEB-INF
                            --> web.xml
                            --> lib
                                 --> yuhuuTunnel.jar
                    --> META-INF
                            --> MANIFEST.MF
                                 --> yuhuuTunnel.jar
                    --> index.htmlThe content of web.xml is the following:
        <?xml version="1.0" encoding="ISO-8859-1"?>
        <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
        <web-app>
            <!-- Action Servlet Configuration -->
            <servlet>
                 <servlet-name>HelloWorld</servlet-name>
                 <servlet-class>web.HelloWorldServlet</servlet-class>
                 <load-on-startup>0</load-on-startup>
            </servlet>
            <servlet-mapping>
                 <servlet-name>HelloWorld</servlet-name>
                 <url-pattern>HelloWorld</url-pattern>
            </servlet-mapping>
        </web-app>Tomcat works correctly ( http://localhost:8080 return me the page of tomcat ) but when I try to use the HelloWoldServlet typing http://localhost:8080/yuhuuTunnel/HelloWorld into a browser, this one returns me the HTTP Status 404 - The requested resource () is not available.
    What is wrong? The address that I type into the browser or there's an error into web.xml?
    Something interesting: If I type
    http://localhost:8080/yuhuuTunnel/HelloWorld
    the message given back is: "The requested resource () is not available."
    but if I type
    http://localhost:8080/HelloWorld the message is different:
    "The requested resource (/HelloWorld) is not available."

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <!-- Action Servlet Configuration -->
    <servlet>
             <servlet-name>HelloWorld</servlet-name>
             <servlet-class>web.HelloWorldServlet</servlet-class>
             <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
             <servlet-name>HelloWorld</servlet-name>
             <url-pattern>HelloWorld</url-pattern>
    </servlet-mapping>
    </web-app>Please change the servlet url pattern from
    <url-pattern>HelloWorld</url-pattern>to
    <url-pattern>/HelloWorld</url-pattern>in servlet mappings
    REGARDS,
    RaHuL

  • How to specify image directory in Tomcat servlet?

    The following will display the counter.png image stored in my Tomcat webapps/ROOT/images directory (even from a servlet at webapps/counters):outText.println("<IMG SRC=\"/images/counter.png\">");but what's the magical incantation to get at webapps/counters/images/counter.png... which is where I want to create the things (and am successfully doing so- I just can't get them to display!)?
    Tomcat comes with some servlet webapps/examples that display "navigation" graphics from the webapps/examples/images directory, but the example code doesn't include the navigation bits!)outText.println("<IMG SRC=\"/counter/images/counter.png\">");and other seemingly obvious variations do not work.

    So, it appears the "current directory" is webapps/ROOT. If you want to get at webapps, you need the parent of the current directory, which is denoted by "..". Therefore, to get at webapps/counters/images/counter.png, you need "../counters/images/counter.png".

Maybe you are looking for

  • IMac G5 not turning on

    Hi everyone, I have a 2 year old iMac G5 (17 inch) and I was gone at a wedding this past weekend. When I got back home, my iMac would not turn on. I tried resetting the surge protector, even plugging it directly into an outlet that I know works. Some

  • It´s possible disable CONTROL+C in sqlplus???

    Hi friends, i have some scripts that will run in sqlplus... They are waiting for parameters to be will insert for users... But then this problem, if user use CTRL+C, the prompt will go to the sqlplus prompt and the database will be open for execute a

  • How to attach custom code after invoice save/modify

    Hi to all, i should solve techically this problem. I have an invoice document. After the modify/save of the invoice document, i should start a custom procedure that, line by line, read the invoice document just saved, and save the net value of each p

  • ABAP Certification and Course

    Hi Friends , I want to do ABAP Certification and want to learn ABAP . I am a BE Computer Engg. (Fresher) having good core knowledge in Core JAVA. Can anybody give me contacts (Names , number ect. ) of Instituts offering the ABAP course. If Possible i

  • Dual table in 10g

    Hi! 1 am using forms 6. my forms were running good but after i take my application to 10g, some forms have not been compiling. in every form where dual table has been referenced error has come, remaining forms run well like select sysdate into l_Date