Tomcat can't run servlet /servlet tag help me please!

do I config the web.xml file?

Take a look at:
http://java.sun.com/dtd/web-app_2_3.dtd
It is the definition of what can be (and in what order) in a web.xml file for servlet specification 2.3 (ie: Tomcat 4.1).

Similar Messages

  • How Can I Run Servlet in tomcat

    Hi My Friends
    Please can any one tell me how can I Run Servlet in tomcat using my own Virtual Directory � my ask about , what is the structure it must be make it in the hierarchy of the sub folder of Virtual Directory , and in watch folder it must be put the servlet files and there is any change it must be make it in any file of the tomcat files and so on
    Please give my full details about this thing
    And thanks

    What version of Tomcat are u using?

  • The screen of my MacBook Pro itself periodically switches the color. That is, with the usual colors, on some blue. What to do? Should be repaired, or you can figure out the most? HELP ME PLEASE!

    The screen of my laptop itself periodically switches the color. That is, with the usual colors, on some blue. What to do? Should be repaired, or you can figure out the most? HELP ME PLEASE!

    LambChops1,
    I’m using Mavericks, and it’s still possible to select text to drag and for cutting and pasting. Left-clicking and right-clicking is still possible, too.
    Try opening the Trackpad pane of System Preferences, and select the Point & Click tab. To right-click, ensure that your “Secondary click” checkbox has been checked; the small print under “Secondary click” is a dropdown menu which allows you to select the form of right-clicking that you prefer. (For instance, mine is set to “Click in bottom right corner”.) For left-clicking, is your “Tap to click” checkbox checked, or unchecked? (Mine is unchecked, since I prefer pushing for left-clicking over tapping to do so.)

  • HT1420 I have windows 8 new pc and i can not find where i can authorize my computer...HELP me please.  These directions must be an older version maybe?

    I have windows 8 new pc and i can not find where i can authorize my computer...HELP me please.  These directions must be an older version maybe?

    Press the Alt and S keys and choose Authorize this Computer, or click here, follow the instructions, click on Store in the menu bar, and choose Authorize this Computer.
    (82052)

  • Tomcat 4.0 can't run Servlets at my folder

    Hello
    I try to run my servlet with timcat 4.0 at my directory:
    webapps/ild/webINF/classes/ild/claims/MyServlet
    at local web.xml:
    <servlet>
    <servlet-name>ClaimsServlet</servlet-name>
    <servlet-class>ild.claims.ClaimsServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ClaimsServlet</servlet-name>
    <url-pattern>/ild/claims/claims</url-pattern>
    </servlet-mapping>
    * under Forte4J4 with tomcat 4 its running ok
    at conf/server.xml:
    <Context path="/ild" docBase="ild" debug="0" reloadable="true">
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_examples_log." suffix=".txt" timestamp="true"/>
    </Context>
    and I try to run it and I got:
    (claims/clams)is not availabe
    at the examples folder I can run servlets
    what hav I don wrong?

    check it once more if your ClaimsServlet.class is in ../webapps/ild/webINF/classes/ild/claims/ folder or not? one molre important note: it is not webINF like you have written it is WEB-INF,though it is not case sensitive i guess but note the '-' in between.name your folder properly. Then change the url-pattern to something simple like /claim instead of /ild/claims/claims like you have used (just a suggestion) and then point your browser to http://localhost:<port>/ild/claim and let us know what happens
    regards
    padmanava

  • Can I run Servlets in the Sun App Server?

    I am trying to run a servlet. I am not sure if I can run the same using the Sun app server. any help to clarify the following queries would be appreciated.
    1. Should I have to specify a path in the environmental variables?
    2. Is there a web site that tells me the same with respect to running the servlet on a Sun app server.
    Thanks in advance.
    --Srikanta                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    I'm not sure what you want in regards to question, but I can assure you that you can run servlets in S1AS7. My recommendation is to just package your servlet into a web archive (war) and deploy it. You can deploy it via the commandline (asadmin) or the web based administrative client (likely http://localhost:4848). For more information on this I suggest reading:
    http://docs.sun.com/source/816-7150-10/index.html
    You must likely want to read the section on assembling and deploying web applications.
    Matt Bauer

  • Can we run servlets as standalone GUIs??

    Hi,
    I need clarification regarding running server side programs as standalone GUI (say java swings) on the local user machines??
    ofcourse, we can run servlets on the browser window. but i am not if it's possible to run as swing GUI. please let me know
    thanks
    sri.

    Think of it this way, the communication between browser and Servlet is simply HTTP. The browser does not 'run' or 'invoke' your Servlet. Rather it initiates an HTTP request that the Servlet will inspect and take some action (via form parameters, URL parameters, the URL itself, etc.) Then an HTTP response is returned.
    Your Swing client can emulate a browser, and unless you write code to detect so otherwise, your Servlet will not be able to distinguish the standalone client from the browser. As long as you submit valid HTTP requests that the Servlet can process, both clients are equally valid.
    - Saish

  • A problem with Tomcat (Can't run tomcat as a service.).

    Hi
    May be you can help me (please).
    I do the following steps, as described in many documents I've found.
    1. Downloaded the jk_nt_service.exe and put it into jdk1.3.1jre\bin\classic
    2. configured wrapper.properties:
    wrapper.tomcat_home=C:\tomcat324 wrapper.java_home=C:\work\jdk1.3.1
    3. Run:
    C:\>jk_nt_service.exe -i tomcat C:\tomcat324conf\wrapper.properties
    C:\>jk_nt_service.exe -s tomcat
    C:\>net start tomcat
    In this step I get the following error:
    A system error has occurred.
    System error 1067 has occurred.
    The process terminated unexpectedly.
    I've got the same error on other computers and using Alexandria's program.. As I understood it's not only my problem, others have it too.
    Thanks in advance.

    Hi,
    First U should check if IIS and Tomcat are running together then Tomcat won't start coz both use the 80 port. u have shut down IIS and use Tomcat and enable Tomcat to start with the services, If shutting down IIS is not a problem.
    If u need both IIS and Tomcat to run together then u have change the server http port u can do it in the following manner
    drive:\Apache Tomcat 4.0\conf directory.
    Edit the sever.xml file
    In the server.xml file u will have to change the port in the following piece
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
    port="8080" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0" connectionTimeout="60000"/>
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to -1 -->
    Change the port 8080 to 808x where x is any number between 0 to 9
    Restart the machine and this should work
    Good Luck
    Bye,
    MAX

  • Can not run file.class with Internet Explorer ( Please help me)

    Please help me ! ! (Beginer Programming)

    First, you can't run a .class file. Secondly, you have to post your code, that is the only way we could help

  • Hotmail won't download properly how can i fix it?? help me please

    i have problemas loading hotmail, i have try everything but no one else seems to have this problem therefore no one is able to help me, just have a look at this: [http://www.uploadscreenshot.com/image/393673/5408594]
    that's what i get and it is happeninng only with my hotmail account can you please help me to fix this??
    I use PeppermintOS Two, everything was find, but 3 days ago mozilla stop from downloading hotmail properly!!!

    First of all i really like to thank you for your concern on trying to help me, however i must tell you that i did a fresh install of my system wich is PeppermintOS(GNU/Linux) i don't use Windows and never will, i use to have it in the past and that OS is troublemaker, now about my problem i sadly have to tell you that none of the above solutions fix my problem, is driving me crazy, speciall because as i told you, this is a fresh new installation of my OS, so i am wondering why is doing this, it was working fine couple weeks ago and suddendly start having this behaviour and as you know email are nodays some thing we realy on, so is there any other thing i can do to fix this? do i need to give you some other info so you can guide me in the right directions? please let me know. Again, thanks for your help
    PS. The image below is just right after installing my new OS!!!, this means not surfing on the internet, not doin g anything else just check my hotmail account to se the behaviour.

  • New Hard drive, can't access certain aspects. Help needed please

    Hi everyone.
    I have an HP Pavilion dv6-6052ea laptop.
    I've been having problems with the hard drive so got a new one installed.
    My main issues are since getting it back, I can't access any of the original HP installations etc (I've downloaded all the drivers I know about through HP).
    The 2 main things I'm missing are 2 things that came with the laptop.
    1: Beats Audio sound system 
    2: Video Graphics: AMD Radeon HD 6490M (1 GB DDR5)
    and I have no idea how to get them back. Can anyone help. Do I need to install specific drivers? I can't find any trace that they exist on my laptop now apart from the stickers on the laptop! Any help is greatly appreciated. 
    I never had any CD back ups for the laptop. I do have the old HP back up etc saved on a USB but I don't know enough about the folders and files to know what I need to look for. (I still have the old hardrive.)
    Again, any help is massively appreciated. Thank you!
    Tony 

    If you used your HP Recovery Media, all factory install drivers and software would have been installed. If you didn't create your HP Recovery Media when you first setup your computer, please contact official HP support in your region / country, via the HP Worldwide Support Portal, to see if HP Recovery Media is available for your computer.
    If a generic Windows 7 installation disc was used, you will need to install all HP specific driver for your computer. Please try IDT High-Definition (HD) Audio Driver, Intel High-Definition (HD) Graphics Driver, and AMD High-Definition Graphics Driver to resolve your missing drivers issues. Windows 7 64-bit driver for your computer can be found on the HP Pavilion dv6-6052ea Entertainment Notebook PC Drivers page.
    If you have any further questions, please don't hesitate to ask.
    Please click the White KUDOS "Thumbs Up" to show your appreciation
    Frank
    {------------ Please click the "White Kudos" Thumbs Up to say THANKS for helping.
    Please click the "Accept As Solution" on my post, if my assistance has solved your issue. ------------V
    This is a user supported forum. I am a volunteer and I don't work for HP.
    HP 15t-j100 (on loan from HP)
    HP 13 Split x2 (on loan from HP)
    HP Slate8 Pro (on loan from HP)
    HP a1632x - Windows 7, 4GB RAM, AMD Radeon HD 6450
    HP p6130y - Windows 7, 8GB RAM, AMD Radeon HD 6450
    HP p6320y - Windows 7, 8GB RAM, NVIDIA GT 240
    HP p7-1026 - Windows 7, 6GB RAM, AMD Radeon HD 6450
    HP p6787c - Windows 7, 8GB RAM, NVIDIA GT 240

  • When I try to work with some photos Imovie gets stuck and then it stops to work at all. It happens only with some specific photos,is there a way to repair them?I can't go on this way,help me please

    When I try to work with some photos Imovie gets stuck and then it stops to work at all. It happens only with some specific photos,is there a way to repair them?I can't go on this way,help me please

    Hi,
    The movie is probably MPEG format.
    QuickTime Pro and iMovie cannot transcode audio contained in MPEG movies.
    Try to convert with SimpleMovieX or MPEG Streamclip instead.
    http://www.aeroquartet.com/SimpleMovieX/
    http://www.squared5.com
    Regards, BJ

  • My problem is that one of the USB ports and the device does not detect this and inactive but can not find how to reactivate.Help me please! greetings thanks!

    Hello good evening, I have a MacBook Pro and my problem is that one of the USB ports and the device does not detect this and inactive but can not find how to reactivate.
    Help me please! greetings thanks!

    Do you have the Firefox new tab page but the actual sites are missing, or do you have some other page?
    If you have some different page, try the quick fix in Fred McD's reply.
    If the sites are missing, did you use the Reset feature? That will clear the storage associated with the new tab page. I'm not sure it's possible to recover from that; you probably need to rebuild your page from scratch as you browse.
    For possible future reference, here is how to access the hidden setting for the page to display on new tabs:
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''newtab''' and pause while the list is filtered
    (3) Double-click the '''browser.newtab.url''' preference and enter your preferred page:
    * ''Page thumbnails (default)'' => about:newtab
    * ''Blank tab'' => about:blank
    * ''Built-in Firefox home page'' => about:home
    * ''Any other page'' => full URL to the page
    Press Ctrl+t to open a new tab and verify that it worked. Fixed?
    Some gotchas:
    ''If Firefox won't let you edit this setting:'' you may have something called SearchProtect on your system.
    ''If Firefox lets you save your change but ignores it:'' one of your extensions may be overriding it. You can review, disable, and/or remove extensions on the add-ons page:
    "3-bar" menu button (or Tools menu) > Add-ons > ''in the left column click'' Extensions
    ''If the change works during your session, but at the next startup is back to an unwanted page:'' you might have a user.js file in your personal Firefox settings folder (your Firefox profile folder). This article describes how to track down and remove the file: [[How to fix preferences that won't save]].
    Any luck?

  • How can i running servlet in tomcat 4.1

    sir,
    i want to know ,what are the settings?i have to do before running a servlet
    i installed tomcat4.1 in C:\Program Files\Apache Group\Tomcat 4.1.
    but i reffered a lot of tutorial ,i couldnt understand that.
    and also i set jsdk path;

    u need to set the path and classpath in command prompt.
    Create a directory on c drive say "c:\job_todler" and enter ----->
    set the path =c:\jdk1.3\bin;%path%
    set classpath = c:\Apache Group\Tomcat\Common\lib\servlet.jar
    Now come to,
    c:\Apache Group\Tomcat\bin>set JAVA_HOME=C:\JDK1.3
    c:\Apache Group\Tomcat\bin>set CATALINA_HOME=C:\ApacheGroup\Tomcat
    c:\Apache Group\Tomcat\bin>startup
    bye

  • Tomcat crashes while running servlet chat in IE

    Hi all!
    I've seen similar problems posted about three years ago, but I didn't see an answer for it.
    I'd be very grateful if you could help me.
    I'm writing a chat, the code was taken from the J.Hunter "Servlet programming book" O'reilly, "absurdly simple chat", and adjusted (I only need the Http version). It's an applet-servlet chat.
    When executed in IE, Tomcat crashes after a few (usually 5) sent messages. When executed in a debugger (I use Forte, the last available version, 4 update 1) the program works just fine...
    Another question is about debugging an applet, executed in a browser - how do I do this?
    Here is the code for the servlet:
    =================================
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class TryChatServlet extends HttpServlet
    // source acts as the distributor of new messages
    MessageSource source = new MessageSource();
    // doGet() returns the next message. It blocks until there is one.
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    res.setContentType("text/plain");
    PrintWriter out = res.getWriter();
    // Return the next message (blocking)
    out.println(getNextMessage());
    // doPost() accepts a new message and broadcasts it to all
    // the currently listening HTTP and socket clients.
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    // Accept the new message as the "message" parameter
    String message = req.getParameter("message");
    // Broadcast it to all listening clients
    if (message != null) broadcastMessage(message);
    // Set the status code to indicate there will be no response
    res.setStatus(res.SC_NO_CONTENT);
    // getNextMessage() returns the next new message.
    // It blocks until there is one.
    public String getNextMessage() {
    // Create a message sink to wait for a new message from the
    // message source.
    return new MessageSink().getNextMessage(source);
    // broadcastMessage() informs all currently listening clients that there
    // is a new message. Causes all calls to getNextMessage() to unblock.
    public void broadcastMessage(String message) {
    // Send the message to all the HTTP-connected clients by giving the
    // message to the message source
    source.sendMessage(message);
    // MessageSource acts as the source for new messages.
    // Clients interested in receiving new messages can
    // observe this object.
    class MessageSource extends Observable {
    public void sendMessage(String message) {
    setChanged();
    notifyObservers(message);
    // MessageSink acts as the receiver of new messages.
    // It listens to the source.
    class MessageSink implements Observer {
    String message = null; // set by update() and read by getNextMessage()
    // Called by the message source when it gets a new message
    synchronized public void update(Observable o, Object arg) {
    // Get the new message
    message = (String)arg;
    // Wake up our waiting thread
    notify();
    // Gets the next message sent out from the message source
    synchronized public String getNextMessage(MessageSource source) {
    // Tell source we want to be told about new messages
    source.addObserver(this);
    // Wait until our update() method receives a message
    while (message == null) {
    try { wait(); } catch (Exception ignored) { }
    // Tell source to stop telling us about new messages
    source.deleteObserver(this);
    // Now return the message we received
    // But first set the message instance variable to null
    // so update() and getNextMessage() can be called again.
    String messageCopy = message;
    message = null;
    return messageCopy;
    =============================
    The code for the applet is
    =============================
    import java.applet.*;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class TryChatApplet extends Applet implements Runnable {
    TextArea text;
    Label label;
    TextField input;
    Thread thread;
    String user;
    public void init() {
    // Check if this applet was loaded directly from the filesystem.
    // If so, explain to the user that this applet needs to be loaded
    // from a server in order to communicate with that server's servlets.
    URL codebase = getCodeBase();
    if (!"http".equals(codebase.getProtocol())) {
    System.out.println();
    System.out.println("*** Whoops! ***");
    System.out.println("This applet must be loaded from a web server.");
    System.out.println("Please try again, this time fetching the HTML");
    System.out.println("file containing this servlet as");
    System.out.println("\"http://server:port/file.html\".");
    System.out.println();
    System.exit(1); // Works only from appletviewer
    // Browsers throw an exception and muddle on
    // Get this user's name from an applet parameter set by the servlet
    // We could just ask the user, but this demonstrates a
    // form of servlet->applet communication.
    user = getParameter("user");
    if (user == null) user = "anonymous";
    // Set up the user interface...
    // On top, a large TextArea showing what everyone's saying.
    // Underneath, a labeled TextField to accept this user's input.
    text = new TextArea();
    text.setEditable(false);
    label = new Label("Say something: ");
    input = new TextField();
    input.setEditable(true);
    setLayout(new BorderLayout());
    Panel panel = new Panel();
    panel.setLayout(new BorderLayout());
    add("Center", text);
    add("South", panel);
    panel.add("West", label);
    panel.add("Center", input);
    public void start() {
    thread = new Thread(this);
    thread.start();
    String getNextMessage() {
    String nextMessage = null;
    while (nextMessage == null) {
    try {
    URL url = new URL(getCodeBase(), "/servlet/TryChatServlet");
    HttpMessage msg = new HttpMessage(url);
    InputStream in = msg.sendGetMessage();
    DataInputStream data = new DataInputStream(
    new BufferedInputStream(in));
    nextMessage = data.readLine();
    catch (SocketException e) {
    // Can't connect to host, report it and wait before trying again
    System.out.println("Can't connect to host: " + e.getMessage());
    try { Thread.sleep(5000); } catch (InterruptedException ignored) { }
    catch (FileNotFoundException e) {
    // Servlet doesn't exist, report it and wait before trying again
    System.out.println("Resource not found: " + e.getMessage());
    try { Thread.sleep(5000); } catch (InterruptedException ignored) { }
    catch (Exception e) {
    // Some other problem, report it and wait before trying again
    System.out.println("General exception: " +
    e.getClass().getName() + ": " + e.getMessage());
    try { Thread.sleep(1000); } catch (InterruptedException ignored) { }
    return nextMessage + "\n";
    public void run() {
    while (true) {
    text.appendText(getNextMessage());
    public void stop() {
    thread.stop();
    thread = null;
    void broadcastMessage(String message) {
    message = user + ": " + message; // Pre-pend the speaker's name
    try {
    URL url = new URL(getCodeBase(), "/servlet/TryChatServlet");
    HttpMessage msg = new HttpMessage(url);
    Properties props = new Properties();
    props.put("message", message);
    msg.sendPostMessage(props);
    catch (SocketException e) {
    // Can't connect to host, report it and abandon the broadcast
    System.out.println("Can't connect to host: " + e.getMessage());
    catch (FileNotFoundException e) {
    // Servlet doesn't exist, report it and abandon the broadcast
    System.out.println("Resource not found: " + e.getMessage());
    catch (Exception e) {
    // Some other problem, report it and abandon the broadcast
    System.out.println("General exception: " +
    e.getClass().getName() + ": " + e.getMessage());
    public boolean handleEvent(Event event) {
    switch (event.id) {
    case Event.ACTION_EVENT:
    if (event.target == input) {
    broadcastMessage(input.getText());
    input.setText("");
    return true;
    return false;
    =====================================
    HttpMessage
    ======================================
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class HttpMessage {
    URL servlet = null;
    String args = null;
    public HttpMessage(URL servlet) {
    this.servlet = servlet;
    // Performs a GET request to the previously given servlet
    // with no query string.
    public InputStream sendGetMessage() throws IOException {
    return sendGetMessage(null);
    // Performs a GET request to the previously given servlet.
    // Builds a query string from the supplied Properties list.
    public InputStream sendGetMessage(Properties args) throws IOException {
    String argString = ""; // default
    if (args != null) {
    argString = "?" + toEncodedString(args);
    URL url = new URL(servlet.toExternalForm() + argString);
    // Turn off caching
    URLConnection con = url.openConnection();
    con.setUseCaches(false);
    return con.getInputStream();
    // Performs a POST request to the previously given servlet
    // with no query string.
    public InputStream sendPostMessage() throws IOException {
    return sendPostMessage(null);
    // Performs a POST request to the previously given servlet.
    // Builds post data from the supplied Properties list.
    public InputStream sendPostMessage(Properties args) throws IOException {
    String argString = ""; // default
    if (args != null) {
    argString = toEncodedString(args); // notice no "?"
    URLConnection con = servlet.openConnection();
    // Prepare for both input and output
    con.setDoInput(true);
    con.setDoOutput(true);
    // Turn off caching
    con.setUseCaches(false);
    // Work around a Netscape bug
    con.setRequestProperty("Content-Type",
    "application/x-www-form-urlencoded");
    // Write the arguments as post data
    DataOutputStream out = new DataOutputStream(con.getOutputStream());
    out.writeBytes(argString);
    out.flush();
    out.close();
    return con.getInputStream();
    // Converts a Properties list to a URL-encoded query string
    private String toEncodedString(Properties args) {
    StringBuffer buf = new StringBuffer();
    Enumeration names = args.propertyNames();
    while (names.hasMoreElements()) {
    String name = (String) names.nextElement();
    String value = args.getProperty(name);
    buf.append(URLEncoder.encode(name) + "=" + URLEncoder.encode(value));
    if (names.hasMoreElements()) buf.append("&");
    return buf.toString();
    Those files are the only files needed to execute the program.

    The whole Tomcat crashes, and no exception
    displayed.
    Do I have to write the log file, or it's kept by
    Tomcat itself?yes, tomcat writes a log file, you find it in the tomcat dir. but it's just very highlevel. Having a look in it could help.
    Is there a way to write a log file by myself?sure. you could get the log file from tomcat by getting it from the ServletContext:
    ServletContext = getServletContext();
    ServletContext.log("text to log");
    When I view the output window in Forte, it doesn't
    even write that Tomcat crashed.
    I use Tomcat that is installed with the last version
    of Forte(Sun 1 Studio, update 1), I guess it's the
    last version of Tomcat also.No. The lastest is 4.1.12 and i guess it's 4.0.4 with forte.
    Get Tomcat standalone from jakarta.apache.org and try to run your servlet with the standalone tomcat. this could help since i also expirenced problems sometimes with the forte-integrated tomcat.

Maybe you are looking for