Invoke .html file in tomcat 4

I am newbie to servlet and I am trying some simple example of servlet in
which I have written
1) a html form to get data saved in webapps/myplace/
2) a servlet which is to return the data got from the request.get of the
html form.
I have deployed the tomcat server, put the compiled servlet class in the
WEB-INF/classes and also make the web.xml file.
However, when I load the page to the servlet from the html form, and click
submit from the form which is supposed to link to the servlet, it returns
404 error which said it cannot load the page.
I would like to know what I have missed that lead to such problem.
Thousands Thanks

do you have the URLs right, are there any port numbers that needed to be included ?
i.e. http:\\www.mywebserver:1234\MyWebPages

Similar Messages

  • Where to place HTMl files in  tomcat while executing Servlets examples ?

    Hi,
    I'm learning servelets (HttpServlets). in that input is given through html files.now i dont know where to place that html file in apache tomcat server
    This is my Directry Structure
    Java's ---- C:\Program Files\Java\jdk1.5.0\bin
    Tomcat's--C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ThreeParams extends HttpServlet
    public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Reading Three Request Parameters";
    String docType ="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +"Transitional//EN\">\n";
    out.println(docType +"<HTML>\n" +"<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +"<BODY BGCOLOR=\"#FDF5E6\">\n" +"<H1 ALIGN=\"CENTER\">" + title + "</H1>\n" +"<UL>\n" +" <LI><B>param1</B>: "+ request.getParameter("param1") + "\n" +" <LI><B>param2</B>: "+ request.getParameter("param2") + "\n" +" <LI><B>param3</B>: "+ request.getParameter("param3") + "\n" +"</UL>\n" +"</BODY></HTML>");
    }HTML code ---
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD><TITLE>Collecting Three Parameters</TITLE></HEAD>
    <BODY BGCOLOR="#FDF5E6">
    <H1 ALIGN="CENTER">Collecting Three Parameters</H1>
    <FORM ACTION="ACTION="C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\root\WEB-INF\classes.ThreeParams">
    First Parameter: <INPUT TYPE="TEXT" NAME="param1"><BR>
    Second Parameter: <INPUT TYPE="TEXT" NAME="param2"><BR>
    Third Parameter: <INPUT TYPE="TEXT" NAME="param3"><BR>
    <CENTER><INPUT TYPE="SUBMIT"></CENTER>
    </FORM>
    </BODY></HTML>
    {code}
    servlet code is compiling without any errors, now where should i place the class file and html file in tomcat to execute this program..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    webapps\yourapplicationname\WEB-INF\

  • Deploying Servlet with HTML file on Tomcat

    Hi ,
    I created a servlet and an html file. The html file accepts user data and passes it to servlet.
    I want to deploy these two files using Tomcat server. Please tell me a sure procedure for deploying both files.
    Regards,
    ap.

    First of all its better to make a jsp rather than one HTML and a servlet but anyhow in order to deploy it first build your project and create a war file which should contain your HTML and servlet and the web.xml.
    Then place this war file inside the webapps folder of tomcat.Start the tomcat and hit your HTML on the browser....

  • How to invoke a html file in a new browser

    how to invoke a new html file to be opened from an applet
    any help urgent

    hi,
    do the following
    URL url = null;
    try
         url = new URL("http://www.xyz.com");
    catch (MalformedURLException e)
          System.out.println("URL not correct " + e.toString());
    if (url != null)
           getAppletContext().showDocument(url,"_blank"); //shows the page in a new unnamed top level browser instance.
    }hope that helpz
    cheerz
    ynkrish

  • Lost Tomcat, its database and all JSP and HTML files

    I have mistakably uninstalled Tomcat from my machine, it removed the data I stored in the root including HTML and JSP files, I am using windows XP, Is there any way I can recover htem back, atlest the database and the JSP files? please Help

    Also a good example of why you should develop apps in a separate directory structure and then deploy the WAR file to Tomcat.
    You didn't have all your source code under Tomcat, did you?
    You weren't using a source control system like CVS?
    Oh, my. ;)
    You will from now on, I'll bet.
    %

  • Jsp+Tomcat: Is there a max number of lines in a html file generated?

    Hi, I write a jsp page that does a lot of queries on a database and, for each query, views a table with the records return by the query. I have a problem: if the number of queries is low the page work well; if the number of queries is high the page has been truncated. If a watch at the html file of the browser it's like truncated. Are there any parameters that i have to modify? thaks very much

    Truncation usually indicates that an exception occurred after the response had already been committed (due to the output buffer becoming full which will cause it to be flushed).
    check out the logfiles of your webserver if there are any unexpected exceptions in there.

  • How to run an applet(in a html file) in the server?

    I am using the jpedal Viewer inmy code, I embedded the applet code
    in a html file , it is running fine, but when I try to run the same Viewer applet in the Server it is throwing an error
    "java.lang.NoClassDefFoundError: org/jpedal/objects/acroforms/DefaultAcroRenderer
         at org.jpedal.PdfDecoder.startup(Unknown Source)
         at org.jpedal.PdfDecoder.<init>(Unknown Source)
         at pdfViewer.PdfApplet.init(PdfApplet.java:199)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)"
    What is the problem ?
    Please suggest solution for it?
    Its urgent

    I am trying to run the Applet in Tomcat server,
    Could you post the code where you invoke the Applet? It sounds like you're saying you're trying to run the Applet as part of your server-side code. The other interpretation is that you are simply accessing the Applet through the browser that happens to be on the machine being used as the server.
    Like I say, post the code that shows how you're trying to use the Applet "on the server".

  • Servlet filter is not protecting html files

    Hi All,
    I am using Iplanet web server 6.0 SP4 with JDK v1.3.1_06. I am able to protect the JSP page using the servlet filter. But when I try to access the html files then filter is not getting invoked. The content of web-apps.xml is given below :-
    <web-app>
    <filter>
    <filter-name>TestIntercepto</filter-name>
    <filter-class>testinterceptor</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>TestInterceptor</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    </web-app>
    Can you guys tell me the reason ?

    I don't know much about IPlanet but with Apache/Tomcat it is possible to configure Apache to serve static content from a web application (eg: non-JSP pages) which would mean that Tomcat was never able to intercept the request for the page in the first place. Just a though.

  • Want to open a new browser window and display the html file in locale disk.

    Hi,
    I want to open a new browser window and display the html file in local drive. The below html applet work in local system successfully. But i deploy the same in web server (Tomcat) and try the same in client machine it does not work. Please help.
    Note:
    The class below fileopen.FileOpen.class i make it as a jar and put it in jre\ext folder at the client machine.
    ------------------------------------FileOpen.html(Tomcat)-----------------------------------------------------
    <html>
    <body >
    <applet code="OpenFile.class" archive="loadfile.jar" width="100" height="100">
    <param name="path" value="file://c:/open.html" />
    </applet>
    </body>
    </html>
    -------------OpenFile.java in server(Tomcat)--------------------------------------------
    public class OpenFile extends Applet implements ActionListener{
    String path = "";
    fileopen.FileOpen open = null;
    Button b = null;
    public void init(){
    path = getParameter("path");
    b = new Button("Open");
    b.addActionListener(this);
    add(b);
    public void actionPerformed(ActionEvent ae){
    try
    open = new fileopen.FileOpen(this,path);
    catch (Exception e){
    e.printStackTrace();
    -------------------------------------------FileOpen.java /Client JRE/ext----------------------------------------------------
    package fileopen;
    public class FileOpen
    AppletContext context = null;
    URL url = null;
    public FileOpen(Applet applet,String path)
    try
    if(null != applet){
    context = applet.getAppletContext();
    if (null != path)
    url = new URL(path);
    context.showDocument(url, "_blank");
    }catch(Exception ex)
    ex.printStackTrace();
    Please help to solve this issue very urgent.
    Thanks in advance.
    By,
    Saravanan.K.

    zzsara wrote:
    I want to open a new browser window and display the html file in local drive. ...Did you ever pause to consider how ridiculous that is?
    The best audience for applets is people off the internet. 'People off the internet' might be using a computer that has no (what was it?) 'open.html' in the root of the C: drive. In fact (shock horror) they may not even be running Windows, and would therefore probably have no 'C:' drive at all.
    If you do not intend to distribute this to people off the web, an application makes a lot more sense, but even then, you cannot rely on the document being there unless you 'put it there' (during installation, for instance).
    As the other poster intimated, applets can load documents off the local disk as long as they are trusted. Here is an example*, but note that it is not so rash as to presume any particular path or file, and instead leaves it to the user to choose the document to display.
    * The short code can be seen at SDNShare on the [Defensive Loading of Trusted Applets|http://sdnshare.sun.com/view.jsp?id=2315] post.
    On the other hand, a sandboxed applet can load any document coming from its own server via URL, or get showDocument(URL) to work. In that case, the JRE must recognize that the URL is from its own server, so the best way to form URLs for applet use is via the URL constructor
    new URL(getDocumentBase(), "path/to/open.html");That is how I form the URL in this [ sandboxed example of formatting source|http://pscode.org/fmt/sbx.html?url=/jh%2FHelpSetter.java&col=2&fnt=2&tab=2&ln=0]. Of course, in this case the applet loads the document, then parses the text to draw the formatted version, but the point is that an URL produced this way will work with showDocument(URL).
    I am pretty sure showDocument() in an applet off the internet will work with an URL pointing to a foreign (not its own) server, but it will not be able to load documents off the end user's local disks.
    I suggest a couple of things.
    - Try to express this problem in terms of what feature it is that you want to offer the end user. Your question jumps directly to a bad strategy for achieving ..who knows what? An example of a feature is "Shows the applet 'help' files on pressing F1".
    - A good way to indicate interest in a solution is to offer [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match that interest.
    Edit 1:
    ..and please figure out how to use the CODE tags.
    Edited by: AndrewThompson64 on Sep 12, 2008 11:14 PM

  • How to place a servlet file in Tomcat 5.0?

    Hi,
    i'm using Apache Tomcat 5.0 as myweb server.i don't know how to set the class path and where to place my servlet and html files,and how to run my servlet file.if anybody knows plz give me a detailed description abt this topic.

    Look at the directory structure of your Tomcat installation directory. You will see a webapps directory under that. The Tomcat installation comes with samples ready to run. Look at those and create a similar directory structure under webapps for your application. I don't think you need to worry about classpath. Tomcat should be taking care of all that if you create the proper directory structure.
    You run your servlet by specifying a url like:
    localhost:8080/servlets-examples/from a browser. This assumes that your installation is using port 8080 which I think is the norm for Tomcat. Here "servlets-examples" is the name of the directory you created. Actually Tomcat 5.0 comes with a "servlets-examples" application. This would be a good directory to look at. You could also run their examples to get a feel for it.
    If you are new to servlets, you'll probably have to get a book that explains how things need to be set up. You'll need to create a web.xml for your application. If you look at the servlets-examples directory under webapps, you'll see that it has a WEB-INF directory under it and that directory contains a file called web.xml as well as a sub-directory called classes. This structure is standard accross all application servers because it corresponds to the war (wars are specialized types of jars for web apps) file standard.

  • Not able to run a JSP file in Tomcat 5.5

    Hello friends i am new to JSP programming.
    I recently designed a application to enter values of certain field in a database (Using SQL Server Database)
    i used a file name Register.jsp, so when the action is performed by clicking submit button it use to call another file named Register_DB.jsp in which database insertion is performed this 2nd file includes another .java file which is actually creating the JDBC ODBC connection drivers
    but whenever i use to run the programme using tomcat-5.5 i use to get certain error as below ------------------->
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to load class for JSP
         org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:591)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.ClassNotFoundException: org.apache.jsp.Registration_jsp
         java.net.URLClassLoader$1.run(Unknown Source)
         java.security.AccessController.doPrivileged(Native Method)
         java.net.URLClassLoader.findClass(Unknown Source)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:158)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:71)
         org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:589)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    Apache Tomcat/5.5.9***********************************************************************************************************
    So can anybody tell me what should i do to resolve this error
    here is the code what i have written
    File Name Registration.jsp
    <!--     *****     File Name Test.jsp     *****     -->
    <%@ import="Login.connectionBean" %>
    <%@ language="java" %>
    <%@ import="java.io.*" %>
    <%@ import="java.sql.*" %>
    <%@ import="javax.sql.*" %>
    <jsp:useBean id="sq" scope="page" class="Login.connectionBean" type="connectionBean"/>
         <jsp:setProperty name="sq" property="*"/>
    <html>
    <!-- DW6 -->
         <head>
              <!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
              <title>Registration Form</title>
         </head>
         <body>
              <form name="Test" action="Registration_DB.jsp" method="get">
                   <table width="100%" border="0">
                     <tr>
                        <td colspan="5"></td>
                     </tr>
                     <tr>
                        <td width="10%" height="250"></td>
                        <td width="90%" colspan="4"><div align="center">
                          <table width="437" border="1">
                               <tr>
                                  <td><div align="center">User ID </div></td>
                                  <td> </td>
                                  <td><div align="center">
                                         <input name="User_ID" type="text" size="25" maxlength="25" />
                                  </div></td>
                               </tr>
                               <tr>
                                  <td><div align="center"></div></td>
                                  <td> </td>
                                  <td><div align="center"></div></td>
                               </tr>
                               <tr>
                                  <td width="149"><div align="center">User name </div></td>
                                  <td width="27"> </td>
                                  <td width="239"><div align="center">
                                       <input name="User_Name" type="text" size="25" maxlength="25" />
                                  </div></td>
                               </tr>
                               <tr>
                                  <td><div align="center"></div></td>
                                  <td><div align="center"></div></td>
                                  <td><div align="center"></div></td>
                               </tr>
                               <tr>
                                  <td><div align="center">Password</div></td>
                                  <td> </td>
                                  <td><div align="center">
                                        <input name="Password" type="text" size="25" maxlength="25" />
                                       </div>
                                  </td>
                               </tr>
                               <tr>
                                  <td><div align="center"></div></td>
                                  <td> </td>
                                  <td><div align="center"></div></td>
                               </tr>
                               <tr>
                                  <td><div align="center">
                                    <input name="Button_Reset" type="reset" value="Reset Fields" />
                                  </div></td>
                                  <td> </td>
                                  <td><div align="center">
                                       <input name="Button_Submit" type="reset" value="Submit Details" />
                                                   <%
              String User_Id=request.getParameter("User_Id")
              String User_Name="";
              String Password="";
              %>
              <%
              try
              sq.connect();
              if(user_Id!==null && User_Id!="")
              ResultSet rs2.sq.execQuery("select User_Name FROM User_Login where User_Id='"+User_Id+"'");
              catch(Exception e)
                   out.println("Exception Caught" +e);
                   e.printStackTrace();
              %>
                                       </div></td>
                               </tr>
                               </table>
                        </div></td>
                     </tr>
                   </table>
              </form>
         </body>
    </html>***********************************************************************************************************
    File Name Registration_DB.jsp
    <!--     *****     File Name Test_DB.jsp     *****     -->
    <%@ language="java" %>
    <%@ import="Login.connectionBean" %>
    <%@ import="java.sql.*" %>
    <%@ import="javax.sql.*" %>
    <%@ import="java.io.*" %>
    <jsp:useBean id="sq" scope="page" class="Login.connectionBean" type="connectionBean"/>
         <jsp:setProperty name="sq" property="*"/>
    <html>
         <head>
              <title>Untitled Document</title>
         </head>
    <body>     
              <%
              String Button_Submit = request.getParameter("Button_Submit");
              String User_Id = request.getParameter("User_Id");
              String User_Name = request.getParameter("User_Name");
              String Password = request.getParameter("Password");
              %>
              <%!
              ResultSet rs1=null;
              ResultSet rs2=null;
              %>
              <%
              try
                   sq.connect();
                   if(Button_Submit!=null && Button_Submit!="")
                        String qry="INSERT INTO User_Login (User_Id, User_Name, Password) VALUES('"+User_Id+"','"+User_Name+"','"+Password+"')";
                        int i=sq.executeUpdae(qry);
                        if (i>0)
                             response.sendRedirect("Registration.jsp");
              catch(Exception e)
                   out.println("Exception Caught" +e);
                   e.printStackTrace();
    %>
         </body>
    </html>***********************************************************************************************************
    File name connectionBean.java
    package Login;
    import java.sql.*;
    public class connectionBean
         private Connection con;
         public connectionBean()
              super();
         public boolean connect() throws ClassNotFoundException, SQLException
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               con=DriverManager.getConnection("jdbc:odbc:JAVA"," "," ");
               return true;
         public void close() throws SQLException
              con.close();
         public ResultSet execQuery(String qry) throws SQLException
              Statement stmt=con.createStatement();
              ResultSet rs=stmt.executeQuery(qry);
              return(rs==null)?null:rs;
         public int execUpdae(String qry) throws SQLException
              Statement stmt=con.createStatement();
              int i=stmt.executeUpdate(qry);
              return(i==0)?0:i;
    }

    hi
    here the problem is tat the server culdnt find the class for u page,
    check u hav deployed it properly or not,
    check the tomcat installation and is it working fine,
    regards
    venkat

  • Embed  html file without using IFrame UI

    Is there any way to embed html file without using IFrame UI?

    Hi
    To embed a static HTML content inside your view, Iframe is the easiest form or else, you can provide links through Linktourl UI or through a static text or a button, invoke a action and display the HTML content inside the frame or call it in a seperate (external) window.
    Otherwise, we have only less options!
    if you have anything specific, do let us know
    thanks
    sathya

  • How to deploy EAR file in Tomcat?

    Is we can deploy ear file in tomcat?
    Normally we can deploy WAR file in tomcat webapps folder. When we run the tomat it will automatically extract the war file.
    But samethink I have tried EAR file. But it is not working.
    Is we can deploy EAR file or not?
    If not plz give reason.

    Hi
    Normally we can deploy the war file thats routene stuff ofcourse ..........but when u deploy ear file it will give problmes as ear structure and war structure are differeant
    The Tomcat Servlet/JSP Container      
    The Apache Tomcat 5.5 Servlet/JSP Container
         Apache Logo
    Links
    * Docs Home
    Contents
    * Contents
    * Introduction
    * Installation
    * Deployment
    * Source Code
    * Processes
    * Example App
    Application Developer's Guide
    Deployment
         Printer Friendly Version
    print-friendly
    version
    Background
    Before describing how to organize your source code directories, it is useful to examine the runtime organization of a web application. Prior to the Servlet API Specification, version 2.2, there was little consistency between server platforms. However, servers that conform to the 2.2 (or later) specification are required to accept a Web Application Archive in a standard format, which is discussed further below.
    A web application is defined as a hierarchy of directories and files in a standard layout. Such a hierarchy can be accessed in its "unpacked" form, where each directory and file exists in the filesystem separately, or in a "packed" form known as a Web ARchive, or WAR file. The former format is more useful during development, while the latter is used when you distribute your application to be installed.
    The top-level directory of your web application hierarchy is also the document root of your application. Here, you will place the HTML files and JSP pages that comprise your application's user interface. When the system administrator deploys your application into a particular server, he or she assigns a context path to your application (a later section of this manual describes deployment on Tomcat). Thus, if the system administrator assigns your application to the context path /catalog, then a request URI referring to /catalog/index.html will retrieve the index.html file from your document root.
    Standard Directory Layout
    To facilitate creation of a Web Application Archive file in the required format, it is convenient to arrange the "executable" files of your web application (that is, the files that Tomcat actually uses when executing your app) in the same organization as required by the WAR format itself. To do this, you will end up with the following contents in your application's "document root" directory:
    * *.html, *.jsp, etc. - The HTML and JSP pages, along with other files that must be visible to the client browser (such as JavaScript, stylesheet files, and images) for your application. In larger applications you may choose to divide these files into a subdirectory hierarchy, but for smaller apps, it is generally much simpler to maintain only a single directory for these files.
    * /WEB-INF/web.xml - The Web Application Deployment Descriptor for your application. This is an XML file describing the servlets and other components that make up your application, along with any initialization parameters and container-managed security constraints that you want the server to enforce for you. This file is discussed in more detail in the following subsection.
    * /WEB-INF/classes/ - This directory contains any Java class files (and associated resources) required for your application, including both servlet and non-servlet classes, that are not combined into JAR files. If your classes are organized into Java packages, you must reflect this in the directory hierarchy under /WEB-INF/classes/. For example, a Java class named com.mycompany.mypackage.MyServlet would need to be stored in a file named /WEB-INF/classes/com/mycompany/mypackage/MyServlet.class.
    * /WEB-INF/lib/ - This directory contains JAR files that contain Java class files (and associated resources) required for your application, such as third party class libraries or JDBC drivers.
    When you install an application into Tomcat (or any other 2.2/2.3-compatible server), the classes in the WEB-INF/classes/ directory, as well as all classes in JAR files found in the WEB-INF/lib/ directory, are made visible to other classes within your particular web application. Thus, if you include all of the required library classes in one of these places (be sure to check licenses for redistribution rights for any third party libraries you utilize), you will simplify the installation of your web application -- no adjustment to the system class path (or installation of global library files in your server) will be necessary.
    Much of this information was extracted from Chapter 9 of the Servlet API Specification, version 2.3, which you should consult for more details.
    Shared Library Files
    Like most servlet containers, Tomcat 5 also supports mechanisms to install library JAR files (or unpacked classes) once, and make them visible to all installed web applications (without having to be included inside the web application itself. The details of how Tomcat locates and shares such classes are described in the Class Loader HOW-TO documentation. For the purposes of our discussion, there are two locations that are commonly used within a Tomcat 5 installation for shared code:
    * $CATALINA_HOME/common/lib - JAR files placed here are visible both to web applications and internal Tomcat code. This is a good place to put JDBC drivers that are required for both your application and internal Tomcat use (such as for a JDBCRealm).
    * $CATALINA_BASE/shared/lib - JAR files placed here are visible to all web applications, but not to internal Tomcat code. This is the right place for shared libraries that are specific to your application.
    Out of the box, a standard Tomcat 5 installation includes a variety of pre-installed shared library files, including:
    * The Servlet 2.4 and JSP 2.0 APIs that are fundamental to writing servlets and JavaServer Pages.
    * An XML Parser compliant with the JAXP (version 1.2) APIs, so your application can perform DOM-based or SAX-based processing of XML documents.
    Web Application Deployment Descriptor
    The description below uses the variable name $CATALINA_HOME to refer to the directory into which you have installed Tomcat 5, and is the base directory against which most relative paths are resolved. However, if you have configured Tomcat 5 for multiple instances by setting a CATALINA_BASE directory, you should use $CATALINA_BASE instead of $CATALINA_HOME for each of these references.
    As mentioned above, the /WEB-INF/web.xml file contains the Web Application Deployment Descriptor for your application. As the filename extension implies, this file is an XML document, and defines everything about your application that a server needs to know (except the context path, which is assigned by the system administrator when the application is deployed).
    The complete syntax and semantics for the deployment descriptor is defined in Chapter 13 of the Servlet API Specification, version 2.3. Over time, it is expected that development tools will be provided that create and edit the deployment descriptor for you. In the meantime, to provide a starting point, a basic web.xml file is provided. This file includes comments that describe the purpose of each included element.
    NOTE - The Servlet Specification includes a Document Type Descriptor (DTD) for the web application deployment descriptor, and Tomcat 5 enforces the rules defined here when processing your application's /WEB-INF/web.xml file. In particular, you must enter your descriptor elements (such as <filter>, <servlet>, and <servlet-mapping> in the order defined by the DTD (see Section 13.3).
    Tomcat Context Descriptor
    The description below uses the variable name $CATALINA_HOME to refer to the directory into which you have installed Tomcat 5, and is the base directory against which most relative paths are resolved. However, if you have configured Tomcat 5 for multiple instances by setting a CATALINA_BASE directory, you should use $CATALINA_BASE instead of $CATALINA_HOME for each of these references.
    A /META-INF/context.xml file can be used to define Tomcat specific configuration options, such as loggers, data sources, session manager configuration and more. This XML file must contain one Context element, which will be considered as if it was the child of the Host element corresponding to the Host to which the The Tomcat configuration documentation contains information on the Context element.
    Deployment With Tomcat 5
    In order to be executed, a web application must be deployed on a servlet container. This is true even during development. We will describe using Tomcat 5 to provide the execution environment. A web application can be deployed in Tomcat by one of the following approaches:
    * Copy unpacked directory hierarchy into a subdirectory in directory $CATALINA_HOME/webapps/. Tomcat will assign a context path to your application based on the subdirectory name you choose. We will use this technique in the build.xml file that we construct, because it is the quickest and easiest approach during development. Be sure to restart Tomcat after installing or updating your application.
    * Copy the web application archive file into directory $CATALINA_HOME/webapps/. When Tomcat is started, it will automatically expand the web application archive file into its unpacked form, and execute the application that way. This approach would typically be used to install an additional application, provided by a third party vendor or by your internal development staff, into an existing Tomcat installation. NOTE - If you use this approach, and wish to update your application later, you must both replace the web application archive file AND delete the expanded directory that Tomcat created, and then restart Tomcat, in order to reflect your changes.
    * Use the Tomcat 5 "Manager" web application to deploy and undeploy web applications. Tomcat 5 includes a web application, deployed by default on context path /manager, that allows you to deploy and undeploy applications on a running Tomcat server without restarting it. See the administrator documentation (TODO: hyperlink) for more information on using the Manager web application.
    * Use "Manager" Ant Tasks In Your Build Script. Tomcat 5 includes a set of custom task definitions for the Ant build tool that allow you to automate the execution of commands to the "Manager" web application. These tasks are used in the Tomcat deployer.
    * Use the Tomcat Deployer. Tomcat 5 includes a packaged tool bundling the Ant tasks, and can be used to automatically precompile JSPs which are part of the web application before deployment to the server.
    Deploying your app on other servlet containers will be specific to each container, but all containers compatible with the Servlet API Specification (version 2.2 or later) are required to accept a web application archive file. Note that other containers are NOT required to accept an unpacked directory structure (as Tomcat does), or to provide mechanisms for shared library files, but these features are commonly available.
    Copyright © 1999-2006, Apache Software Foundation

  • How to include HTML file in JSP using HTML elements or Javascript?

    Hi,
    I have around 15000 static html files one for each item which we display each upon invoking an item.The HTML file should be part of a JSP file.
    Please note that the name of the HTML file is determined dynamically
    Placing all the HTML files within the web application does not give us good performance so i would like to put all of them in the webserver.
    I am not able to include the file in the JSP using the jsp:include attribute if i place the HTML files in the webserver ,
    in order to do that i think should use either HTML element or javascript to include the HTML in the JSP.is there any alternative to <Jsp:include>
    Does anyone have an idea how to include the HTML file and take advan tage of webserver?
    Any ideas are appreciated

    What you need to do is simply read the HTML file from the disk and dump it out to the outputstream. It really is that simple.
    There's no reason you need to include all 15000 files in the actual WAR, you can place those files any place handy that is easy for the application to see (in another directory, or accessible from a file server if you have multiple front ends).
    Then, just write a utiility function that takes the output stream (i.e. the 'out' JSP variable), and the file name, read the file, and write it to the stream.
    If you start noticing performance issues, then you can try doing some caching, but truth is your OS should be doing that for you.
    But, truth be told that's the only practical way to do it.
    Another solution would be to use JavaScriipt and XMLHttpRequest (i.e "AJAX") to load the file at the client side, and simply replace a tag with the results.
    That's also pretty trivial to write, any web site talking about AJAX should give you hint there.
    Of course, that won't work for folks who have JavaScript turned off, or some other incompatible browser, whereas the server side solution obviously works everywhere.

  • Xml to JTree, and JTree node to html file.

    I have been trying to figure out a way to do this and I think I have a solution, but I am not sure how to structure the application and methods.
    working with BorderLayout Panel p, JSplitPane split, JTree tree, and JEditorPane rpane
    1st. My JSplitpane is divided with the tree, and rpane. The tree is on the left, and the rpane is on the right. both of these are then added to the Panel p
    2. I will create a method that will read through a modules.xml file, and create a JTree - tree. When you click on the node element it's information is displayed in the right pane - rpane.
    The Problem. I think it would take to long to create the html file on the fly each when I click on each individual node.
    So my idea is to create the html files from many xml files when I run the program. I can then just load the html file when I click on each individual node.
    This means alot of heavy processing in the front end, and everything will be static, but it will be faster when the user is in the program.
    Problem. How do I associate each node element with the correct html file?
    The Tree elements are always the same, but I can have 1 or many modules.
    Here is an example:
    <device>  // - root
       <module1>
          <Status>
             <Network></Network>
             <Device></Device>
             <Chassis></Chassis>
             <Resources></Resources>
          </Status>
          <ProjMngt></ProjMngt>
          <ProjEdit></ProjEdit>
          <Admin>
             <admNetwork></admNetwork>
             <admUsers></admUsers>
          </Admin>
          <Logging></Logging>
       </Module1>
       ...  Now I can have 1 or many Modules depending on what the xml file  has in it.
       <Module*n>
    </device>Other problems. Some of the information I want to store as a sortable Table, but I cannot seem to get any of the sort methods to work. They work if I just open a browser, and run the html file, but if I stick the html file into the JEditorPane it does not work? - any suggestions?
    Also, can I pass a JTabbebPane to the JEditorPane, or can I create a tabbed pane in html that will do the same thing.
    I am working with a very small device. It does not have a web application container like Tomcat on it. Just Apache, and Java. That is why I am using Swing.

    Using 'productAttribute/text()' gets you all three productAttribute nodes and then grabs all the text under that node. It simply concatenates together all the text under the desired node, hence the results you are seeing. If you want to get the text for each child node separately, then you need to do something like (assumes 10.2.x.x or greater)
    WITH your_table AS (SELECT
    '<root><productAttribute>
    <name>Baiying_attr_03</name>
    <required>false</required>
    </productAttribute>
    <productAttribute>
    <name>Baiying_attr_04</name>
    <required>false</required>
    </productAttribute>
    <productAttribute>
    <name>Baiying_attr_05</name>
    <required>false</required>
    </productAttribute></root>' xmldata
    FROM DUAL)
    -- Above simulates your DB table as I don't have it
    -- You only care about the following
    SELECT xt.*
      FROM your_table yt,
           XMLTable('/root/productAttribute'
                    PASSING XMLTYPE(yt.xmldata)
                    COLUMNS
                    prd_nm   VARCHAR2(30)  PATH 'name',
                    prod_rqd VARCHAR2(5)   PATH 'required') xt;Note: I added a <root> node as you had just provided a XML fragment. You will need to adjust accordingly.
    The above produces
    PRD_NM                         PROD_RQD
    Baiying_attr_03                false
    Baiying_attr_04                false
    Baiying_attr_05                false

Maybe you are looking for

  • Abap Objects doubts.

    Hi Experts. Plz give me some details for the following questions. 1. what is abstract class. 2. give me some example program using inheritance. 3. Some sample programs using events. 4. Narrow casting & wide casting.. And describe the use of it. 5. Ho

  • Parameters of NFS in Solaris 10 and Oracle Linux 6 with ZFS Storage 7420 in cluster without database

    Hello, I have ZFS 7420 in cluster and OS Solaris 10 and Oracle Linux 6 without DB and I need mount share NFS in this OS and I do not know which parameters are the best for this. Wich are the best parameters to mount share NFS in Solaris 10 or Oracle

  • Turn a jpg into vectors?

    I have a jpg file that I would like to turn into a vector-based image, so that it will better integrate in flash. Is there a simple way to do this, or do I have to create shapes from scratch by outlining everything?

  • Retro-billing

    hi guru's while doing retro billing i am geting this error Error Log             1. $000000002 000000 Document $000000002 saved (no accounting document generated)             2. $000000002 000000 Incorrect doc.no.: $000000002. Select document number

  • Yanking & pasting text in xmonad/uzbl

    I use xmonad as my WM and I've been using uzbl as my browser lately. I regularly want to yank the current page URL or selected text and paste into, say, pidgin, or a text input field in a different browser window. When I use the "yy" or "yu" default