Setting up eclipse and tomcat

Does anyone here have any expertise configuring these two products?(eclipse and tomcat)
I have my tomcat server running and it process them jsp pages just fine. I have also installed the plugin to get tomcat configured with eclispe.
I am just having problems running a jsp file directly from tomcat. it always points to a file on the hd and not to the webapps area like it's supposed to......

Sure - we use that combo for development all the time.
What's the problem specifically? Did you create a new Tomcat project in Eclipse? If you did, then it will automatically add the project's web path as a context to Tomcat, and you can browse directly to it using your browser.
FYI - note that the context that is created is going to point to the eclipse workspace directory - NOT the default webapps directory that you might have configured for Tomcat. That's OK.
- K

Similar Messages

  • Problem launching a jsp page with eclipse and tomcat

    Hi,
    I have just started using eclipse and tomcat for creating dynamic web pages. I tried to launch a jsp page after starting the tomcat server with the URL: http://locahost:8080/HelloWorld/, an error page was displayed as below:
    HTTP Status 404 -/
    type Status report
    message /_
    description The requested resource (-) is not available
    Apache Tomcat/5.5.17
    I didn't get any error at the console and when i just typed http://localhost, a pop up menu saying that the connection was refused when attempting to contact localhost.
    I'm not sure what is the problem here. Could it be the permssion to the localhost is not granted by the system as the eclipse IDE is running using linux?
    Hope someone can help.
    Thanks.

    http://www-128.ibm.com/developerworks/library/os-ectom/

  • Eclipse and Tomcat questions

    Hi everyone,
    Lastnight I setup Eclipse to work with Tomcat, which works very good, but there are something I don't understand.
    1. My files are put in my workspace in (C:\Documents and Settings\...etc)
    How does Tomcat (which is installed in C:\Tomcat) know that it should get the files from my workspace directory?
    Because in the C:\Tomcat directory I can't find any .XML file that refers to my workspace directory.
    2. How I developed my servlets till now, I had some other free editor, I needed to compile my servlets then restart Tomcat and then test it.
    With Eclipse + Tomcat plugin, all I need to do save the servlet and apparently the source code is compiled automatically. All I need to do is refresh the servlet in my browsers (very handy and easy to develop like this). But my question is, does Eclipse compile the servlet automatically after saving? And why doesn't tomcat have to be restarted?
    Just a few questions to understand it a bit better, I'm really happy with this setup as it makes everything a lot easier.
    Regards,
    Steven.

    I believe you will need to become familiar with and install:
    http://www.eclipse.org/webtools/
    HTH
    Darins
    "raul" <[email protected]> wrote in message
    news:b894c367f9750f367a2e8336f8fe93b1$[email protected]..
    > Hi, I downloaded the latest version of eclipse 3.1 and I've installed
    > apache tomcat in mi PC.
    > Eclipse has a plugin : org.eclipse.tomcat_4.1.30.1
    > My problem is that I don't know how to use the tomcat server with eclipse.
    > I readed some tutorials and they say that I have to configure using menu
    > Window > Preferences and then I will see the tomcat option. But that
    > option doesn't appears or I couldn't see it.
    > Another tutorial say that I have to activate a plugin in the following
    > menu location: Window > Customize Perspective > Commands and select the
    > checkbox for tomcat , but that option doesn't appears either.
    > What can I do, I want to use eclipse and tomcat together...
    > Can someone help me with this questions?
    >
    > Thanks so much.
    > Raul Torres
    >
    >
    >

  • Eclipse and tomcat

    i want to intergrate tomcat in eclipse3.2 I have copied the plugin required for the same. Still its not working. Can anyone help me in this.
    thanx in advance

    I assume that you are using sysdeo plugin of eclipse for tomcat
    In that case if you can see three icons corresponding to tomact in your eclipse then your installation is correct (In the menu bar you will have icons to start stop and restart tomcat)
    now go to window--preferences and select tomcat
    select your tomcat version and set tomcat home
    hope it helps

  • Question concerning Eclipse and Tomcat Plugin and JSP

    I have a Tomcat-Project that I am working on in Eclipse and quite a few external JARs. Everything works fine, when I run my Test class within my project (in Eclipse). But as soon, as I am trying to call the jsp in my browser I get Exceptions: "java.lang.NoClassDefFoundError: org/apache/log4j/Logger" for example, which tells me that in the browser it can't find the JARs... I'm guessing something's wrong with the classpath but I was thinking that Eclipse would handle those things for me...
    I've added the JARs to my project via Eclipse (Properties -> Java Build Path -> Libraries -> Add external JARs). And I've created a subdirectory for my jsp files and allowed my project to update the .xml file for the settings and all... Do I need to do anything else? What have I done wrong so far, have I forgotten to do?

    I solved the problem...

  • Eclipse and TomCat Web Server

    Hi experts,
       I have been working with Eclipse for last 1 month. I was just working with Portal application component development and publishing it to the SAP EP J2EE server everything worked fine.
       I have eclipse,JDK,Tomcat3.3.2 installed in my laptop and EP J2EE engine runs on the server.
       Now i studied online regarding the development process with eclipse, The portal application component is published to Tomcat web server first and tested for possible errors and then published to the EP J2EE server. How this process is handled?
      Can any expert explain on this and provide me link to make the required configuration of eclipse  for publishing to tomcat web server?
    Thank you
    arun

    Well, the answer I found was that I have an invalid character that is not supported yet by the WAS, the character is "ñ".
    Using Eclipse and deploying in Tomcat worked fine but in WAS 7.0 SP 8 it throws ParseExceptions
    Regards

  • Eclipse and Tomcat Policy Agent

    I have installed the Tomcat Policy Agent using the agentadmin script under Windows. If I run Tomcat normally using the start.bat script, everything is fine. However, if I run Tomcat through Eclipse's Server configuration, there is a problem fining the AMAgentFilter class.
    How do I set up the classpath for Tomcat in Eclipse to work with the Policy Agent?
    Thanks.

    How can i compile aspectJ (*.aj) files in WSAD 5.1.1 powered by Eclipse 2.1.3. I amn't getting AJDT (AspectJ development tool) plugin for Eclipse 2.1.3. I am only getting AJDT plugins for eclipse 3.x onwards.
    Note: Above devolpement kit (WSAD 5.1.1) is a constraint.
    Can i upgrade the my eclipse version in WSAD 5.1.1.

  • Servlet, Eclipse and Tomcat

    Dear friends,
    Need help to exceutive my first servlet :)
    Dev Environment
    Eclipse 3.0, Tomcat 5.5, OS: Win 2K Professional
    Here is my servlet code:
    package com.jspservletcookbook;
    import java.io.IOException; 
    import java.io.PrintWriter;    
    import java.util.Enumeration;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class FirstServlet extends HttpServlet{
    public void doGet(HttpServletRequest request,      HttpServletResponse response) throws ServletException, java.io.IOException{
    response.setContentType("text/html");
    java.io.PrintWriter out = response.getWriter();
    out.println("<html><head>");
    out.println("<title>Help Page</title></head><body>");
    out.println("<h2>Please submit your information</h2>");
    out.println(     "<form method=\"post\" action=\"" + request.getContextPath() +"/firstservlet\" >");
    out.println("<table border=\"0\"><tr><td valign=\"top\">");
    out.println("Your first name: </td> <td valign\"top\">");
    out.println("<input type=\"text\" name=\"firstname\" size=\"20\">");
    out.println("</td></tr><tr><td valign=\"top\">");
    out.println("Your email: </td> <td valign=\"top\">");
    out.println("<input type=\"text\" name=\"email\" size=\"20\">");
    out.println("</td></tr><tr><td valign=\"top\">");
    out.println("<input type=\"submit\" value=\"Submit Info\"></td></tr>");
    out.println("</table></form>");
    out.println("</body></html>");
    } //doGet
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException {
    Enumeration paramNames = request.getParameterNames();
    String parName;                
    boolean emptyEnum = false;
    if(!paramNames.hasMoreElements())
    emptyEnum=true;
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<html><head>");
    out.println("<title>Submitted Parameters</title></head><body>");
    if(emptyEnum)
    out.println("<h2>Sorry, the request does not contain any parameters</h2>");
    else
    out.println("<h2>Here are the submitted parameter values</h2>");
    while(paramNames.hasMoreElements()){
    parName = (String)paramNames.nextElement();
    out.println("<strong>" + parName + "</strong> :" +
    request.getParameter(parName));
    out.println("<br />");
    }// while
    out.println("</body></html>");
    } // doPost
    }web.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
        "http://java.sun.com/xml/ns/j2ee
          http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
    <web-app>
      <display-name>Servlet 2.4 deployment descriptor</display-name>
      <servlet>
        <servlet-name>FirstServlet</servlet-name>
        <servlet-class>com.jspservletcookbook.FirstServlet</servlet-class>
       </servlet>
       <servlet-mapping>
         <servlet-name> FirstServlet </servlet-name>
         <url-pattern>/com.jspservletcookbook.FirstServlet</url-pattern>
       </servlet-mapping>
      <session-config>
        <session-timeout>15</session-timeout>
      </session-config>
    </web-app>
    Additional Notes:-
    The code has been complied in eclipse without any errors.
    I copied my Project directory structure from eclipse workspace to Tomcat. It appears in Tomcat as:|_Tomcat 5.5
    |__webapps
    |__jspservletscookbook
    |__WEB_INF
    |__classes
    |__lib
    'classes' folder include folder 'com', 'jspservletcookbook' and files FirstServlet.class and FirstServlet.java
    'lib' includes servlet-api.jar and catalina.jar
    'WEB_INF' folder has web.xml file
    Tomcat 5.5 is working properly.thanks!
    ravinder

    First thing is this, you've got spaces around the name FirstServlet in your mapping section:
    <servlet-mapping>
         <servlet-name> FirstServlet </servlet-name>
         <url-pattern>/com.jspservletcookbook.FirstServlet</url-pattern>
       </servlet-mapping>should be
    <servlet-mapping>
         <servlet-name>FirstServlet</servlet-name>
         <url-pattern>/com.jspservletcookbook.FirstServlet</url-pattern>
       </servlet-mapping>Second of all, I'm not a big fan of mapping the fully qualified name to the server, you may want to think about replacing /com.jspservletcookbook.FirstServlet with something smaller like, firstservlet or first_servlet.do, something like that.
    Lastly, how are you trying to load the servlet? Are you typing:
    http://<servername>:<port>/jspservletscookbook/com.jspservletcookbook.FirstServlet in the address bar?

  • Base URL Differences between eclipse and tomcat

    Hello friends. I'm sure that I am missing something basic, so please forgive my ignorance.
    I have several classes that work fine when run through main calls / test scripts in Eclipse. However, when I deploy the application to Tomcat, I see strange behavior in regards to interactions with files on the operating system.
    My logging component (log4j) wants to spit log files out to Tomcat 5.5/bin instead of to the base project directory in Eclipse. I guess I would have expected the logger to write out to webapps/myApplcationName.
    When loading other files from the OS (castor mapping files) I get a FileNotFoundException when I run the process in Tomcat. In this case, it would seem that it wants to load directly from c:\, again instead of from webapps/myApplicationName/whateverFolder.
    Is there any chance this is a classloader based issue?
    Can anyone help? Thanks
    -cm

    It is probably a 'working directory' issue. If you don't specify a directory to work with, most of the time Java will start from the directory that the app was launched from.
    Since Tomcat would be launched via a batch or exe in the Tomcat/bin directory, then that is where you start from there. But Eclipse sets the project directory as the working directory for input/output....
    Anyway, to get around it you should make sure you are getting files from/in the servlet context:
    For example, using:
    getServletContext().getRealPath(...);
    I would presume that Log4J has its own mechanism for defining paths for the log files. I am not particularly sure how, but you could here for more details:
    <http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html>

  • J2EE, Eclipse and Tomcat for Beginners

    Please teach us a simple project using above technology as its tough for many people while starting.
    So please could you help the fresher?

    Rameshglb wrote:
    Please teach us a simple project using above technology as its tough for many people while starting.
    So please could you help the fresher?There are many books on the many facets of Java enterprise technology, esp. servlets and JSPs.
    There are also quite a few good web sites that can teach you about the more commonly used APIs.
    If I were you, and I am glad I am not as you display no industry, I would go over to amazon.com to buy a book or coreservlets.com to do some reading.
    Jaa beta. Apna aap se kaam karo.

  • How do I set miminum # of connections for pool with Oracle and Tomcat?

    Hi,
    I can't seem to find any attribute to initialize the number of connections for my connection pool. Here is my current context.xml file under my /App1 directory:
    <Context path="/App1" docBase="App1"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="App1ConnectionPool" auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    url="jdbc:oracle:thin:@127.0.0.1:1521:oddjob"
    user="app1" password="app1" />
    </Context>
    I've been googling and reading forums, but haven't found a way to establish the minimum number of connections. I've tried all sorts of parameters like InitialLimit, MinLimit, MinActive, etc, with no success.
    Here is some sample code that I am testing:
    package web;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.jdbc.OracleConnection;
    import javax.naming.*;
    import java.sql.SQLException;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.Properties;
    public class ConnectionPool {
    String message = "Not Connected";
    public void init() {
    OracleConnection conn = null;
    ResultSet rst = null;
    Statement stmt = null;
    try {
    Context initContext = new InitialContext();
    Context envContext = (Context) initContext.lookup("java:/comp/env");
    OracleDataSource ds = (OracleDataSource) envContext.lookup("App1ConnectionPool");
    message = "Here.";
         String user = ds.getUser();
    if (envContext == null)
    throw new Exception("Error: No Context");
    if (ds == null)
    throw new Exception("Error: No DataSource");
    if (ds != null) {
    message = "Trying to connect...";
    conn = (OracleConnection) ds.getConnection();
    Properties prop = new Properties();
    prop.put("PROXY_USER_NAME", "adavey/xxx");
    if (conn != null) {
    message = "Got Connection " + conn.toString() + ", ";
              conn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME,prop);
    stmt = conn.createStatement();
    rst = stmt.executeQuery("SELECT username, server from v$session where username is not null");
    while (rst.next()) {
    message = "DS User: " + user + "; DB User: " + rst.getString(1) + "; Server: " + rst.getString(2);
    rst.close();
    rst = null;
    stmt.close();
    stmt = null;
    conn.close(); // Return to connection pool
    conn = null; // Make sure we don't close it twice
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    // Always make sure result sets and statements are closed,
    // and the connection is returned to the pool
    if (rst != null) {
    try {
    rst.close();
    } catch (SQLException e) {
    rst = null;
    if (stmt != null) {
    try {
    stmt.close();
    } catch (SQLException e) {
    stmt = null;
    if (conn != null) {
    try {
    conn.close();
    } catch (SQLException e) {
    conn = null;
    public String getMessage() {
    return message;
    I'm using a utility to repeatedly call a JSP page that uses this class and displays the message variable. This utility allows me to specify the number of concurrent web requests and an overall number of requests to try. While that is running, I look at V$SESSION in Oracle and occassionaly, I will see a brief entry for app1 or adavey depending on the timing of my query and how far along the code has processed in this example. So it seems that I am only using one connection at a time and not a true connection pool.
    Is it possible that I need to use the oci driver instead of the thin driver? I've looked at the javadoc for oci and the OCIConnectionPool has a setPoolConfig method to set initial, min and max connections. However, it appears that this can only be set via Java code and not as a parameter in my context.xml resource file. If I have to set it each time I get a database connection, it seems like it sort of defeats the purpose of having Tomcat maintain the connection pool for me and that I need to implement my own connection pool. I'm a newbie to this technology so I really don't want to go this route.
    Any advice on setting up a proper connection pool that works with Tomcat and Oracle proxy sessions would be greatly appreciated.
    Thanks,
    Alan

    Well I did some more experiments and I am able to at least create a connection pool within my example code:
    package web;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.jdbc.OracleConnection;
    import javax.naming.*;
    import java.sql.SQLException;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.Properties;
    public class ConnectionPool {
    String message = "Not Connected";
    public void init() {
    OracleConnection conn = null;
    ResultSet rst = null;
    Statement stmt = null;
    try {
    Context initContext = new InitialContext();
    Context envContext = (Context) initContext.lookup("java:/comp/env");
    OracleDataSource ds = (OracleDataSource) envContext.lookup("App1ConnectionPool");
    message = "Here.";
         String user = ds.getUser();
    if (envContext == null)
    throw new Exception("Error: No Context");
    if (ds == null)
    throw new Exception("Error: No DataSource");
    if (ds != null) {
    message = "Trying to connect...";
    boolean cache_enabled = ds.getConnectionCachingEnabled();
    if (!cache_enabled){
    ds.setConnectionCachingEnabled(true);
    Properties cacheProps = new Properties();
    cacheProps.put("InitialLimit","5");
         cacheProps.put("MinLimit","5");
    cacheProps.put("MaxLimit","10");
    ds.setConnectionCacheProperties(cacheProps);
              conn = (OracleConnection) ds.getConnection();
    Properties prop = new Properties();
    prop.put("PROXY_USER_NAME", "adavey/xyz");
    if (conn != null) {
    message = "Got Connection " + conn.toString() + ", ";
              conn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME,prop);
    stmt = conn.createStatement();
    //rst = stmt.executeQuery("SELECT 'Success obtaining connection' FROM DUAL");
    rst = stmt.executeQuery("SELECT user, SYS_CONTEXT ('USERENV', 'SESSION_USER') from dual");
    while (rst.next()) {
    message = "DS User: " + user + "; DB User: " + rst.getString(1) + "; sys_context: " + rst.getString(2);
    message += "; Was cache enabled?: " + cache_enabled;
    rst.close();
    rst = null;
    stmt.close();
    stmt = null;
    conn.close(OracleConnection.PROXY_SESSION); // Return to connection pool
    conn = null; // Make sure we don't close it twice
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    // Always make sure result sets and statements are closed,
    // and the connection is returned to the pool
    if (rst != null) {
    try {
    rst.close();
    } catch (SQLException e) {
    rst = null;
    if (stmt != null) {
    try {
    stmt.close();
    } catch (SQLException e) {
    stmt = null;
    if (conn != null) {
    try {
    conn.close();
    } catch (SQLException e) {
    conn = null;
    public String getMessage() {
    return message;
    In my context.xml file, I tried to specify the same Connection Cache Properties as attributes, but no luck:
    <Context path="/App1" docBase="App1"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="App1ConnectionPool" auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    url="jdbc:oracle:thin:@127.0.0.1:1521:oddjob"
    user="app1" password="app1"
    ConnectionCachingEnabled="1" MinLimit="5" MaxLimit="20"/>
    </Context>
    These attributes seemed to have no effect:
    ConnectionCachingEnabled="1" ; also tried "true"
    MinLimit="5"
    MaxLimit="20"
    So basically if I could find some way to get these attributes set within the context.xml file instead of my code, I would be a happy developer :-)
    Oh well, it's almost Miller time here on the east coast. Maybe a few beers will help me find the solution I'm looking for.

  • How to start weblogic in debug mode ? and how to set the eclipse in the deb

    how to start weblogic in debug mode ? and how to set the eclipse in the debug

    Put this in JAVA_OPTIONS :
    Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=3999,suspend=y,server=y
    After restarted weblogic, in eclipse set your breakpoint , open debug perspective then choose Remote Java Appliction and configure Connection Properties (host=localhost and port=3999)

  • Cannot make .war file using tomcat with eclipse and ant

    i have made all necesary configuration for deploying application using eclipse and ant for the tomcat server.
    when i start the server by clicking the tomcat icon on eclipse toolbar, the message is prompted that "missing application web.xml and using defaults". i have placed the web.xml file in the web/WEB-INF directory of the source project directory.
    also when i use ant by right-clicking on the build.xml file and choose Run as ant.. the process creates a desired .war file in webapps folder of the tomcat server but that war file does not works.
    where is the error i cannot figure out.
    am attaching the code of build.xml for reference.
    please help.
    build.xml:-
    <project name="BecilCTI" default="compile" basedir=".">
    <property file="build.properties"/>
    <property file="${user.home}/build.properties"/>
    <property name="app.name" value="BecilCTI"/>
    <property name="app.path" value="/${app.name}"/>
    <property name="app.version" value="0.1-dev"/>
    <property name="build.home" value="${basedir}/build"/>
    <property name="catalina.home" value="c:/Tomcat_5.5"/> <!-- UPDATE THIS! -->
    <property name="dist.home" value="${basedir}/dist"/>
    <property name="docs.home" value="${basedir}/docs"/>
    <property name="manager.url" value="http://localhost:8080/manager"/>
    <property name="src.home" value="${basedir}/src"/>
    <property name="web.home" value="${basedir}/web"/>
    <property name="compile.debug" value="true"/>
    <property name="compile.deprecation" value="false"/>
    <property name="compile.optimize" value="true"/>
    <!--<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>-->
    <path id="compile.classpath">
    <!-- Include all elements that Tomcat exposes to applications -->
    <pathelement location="${catalina.home}/common/classes"/>
    <fileset dir="${catalina.home}/common/endorsed">
    <include name="*.jar"/>
    </fileset>
    <fileset dir="${catalina.home}/common/lib">
    <include name="*.jar"/>
    </fileset>
    <pathelement location="${catalina.home}/shared/classes"/>
    <fileset dir="${catalina.home}/shared/lib">
    <include name="*.jar"/>
    </fileset>
    </path>
    <target name="all" depends="clean,compile"
    description="Clean build and dist directories, then compile"/>
    <target name="clean"
    description="Delete old build and dist directories">
         <echo message="Cleaning all dirs."/>
    <delete dir="${build.home}"/>
    <delete dir="${dist.home}"/>
    </target>
    <target name="compile" depends="prepare"
    description="Compile Java sources">
    <!-- Compile Java classes as necessary -->
    <mkdir dir="${build.home}/WEB-INF/classes"/>
    <javac srcdir="${src.home}"
    destdir="${build.home}/WEB-INF/classes"
    debug="${compile.debug}"
    deprecation="${compile.deprecation}"
    optimize="${compile.optimize}">
    <classpath refid="compile.classpath"/>
    </javac>
    <!-- Copy application resources -->
    <copy todir="${build.home}/WEB-INF/classes">
    <fileset dir="${src.home}" excludes="**/*.java"/>
    </copy>
    </target>
    <target name="dist" depends="compile"
    description="Create binary distribution">
    <!-- Copy documentation subdirectories
    <mkdir dir="${dist.home}/docs"/>
    <copy todir="${dist.home}/docs">
    <fileset dir="${docs.home}"/>
    </copy> -->
    <!-- Create application JAR file -->
    <jar jarfile="${catalina.home}/webapps/${app.name}.war"
    basedir="${build.home}"/>
    <!-- Copy additional files to ${dist.home} as necessary -->
    </target>
    <target name="install" depends="compile"
    description="Install application to servlet container">
    <deploy url="${manager.url}"
    username="${manager.username}"
    password="${manager.password}"
    path="${app.path}"
    localWar="file://${build.home}"/>
    </target>
    <target name="list"
    description="List installed applications on servlet container">
    <list url="${manager.url}"
    username="${manager.username}"
    password="${manager.password}"/>
    </target>
    <target name="prepare">
    <!-- Create build directories as needed -->
    <mkdir dir="${build.home}"/>
    <mkdir dir="${build.home}/WEB-INF"/>
    <mkdir dir="${build.home}/WEB-INF/classes"/>
    <!-- Copy static content of this web application -->
    <copy todir="${build.home}">
    <fileset dir="${web.home}"/>
    </copy>
    <mkdir dir="${build.home}/WEB-INF/lib"/>
    </target>
    <target name="reload" depends="compile"
    description="Reload application on servlet container">
    <reload url="${manager.url}"
    username="${manager.username}"
    password="${manager.password}"
    path="${app.path}"/>
    </target>
    <target name="remove"
    description="Remove application on servlet container">
    <undeploy url="${manager.url}"
    username="${manager.username}"
    password="${manager.password}"
    path="${app.path}"/>
    </target>
    </project>

    So is context.xml actually overwriting the settings found in server.xml?I think so. The way I understand it is the the context.xml file saves you from having to edit server.xml. It is preferred for each web app to do its own config, rather than lumping them all together in server.xml.
    And what would be the best way to create the war file? IAt its heart, a WAR is just a zip file with its contents laid out in according to the specification of a web application directory structure.
    So the simplest way to make a war file is to zip up your directory structure with a tool like winzip, and rename it to be myApp.war.
    Regarding ant, I would recommend you take a look through [url http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/index.html
    ]this tutorial. It explains the basics of website layout, configuration and deployment.
    On [url http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/source.html] this page  in particular, it includes a link to a basic ant file that you can use as a starting point.
    Cheers,
    evnafets

  • JSTL 1.1.2, TOMCAT 5.5, JDK 5, Eclipse and Problems

    I have been having trouble loading the JSTL library (standard.jar & jstl.jar)
    I'm using Eclipse 3.0.2 to do my development work on my JSP pages. So normally I will just create my Tomcat(5.5 on JDK5.0) project using Sysdeo(tm) plugin in its default directory (C:\eclipse\workspace\mytomcatproject).
    Then I would begin creating my JSPs and use JSTL(1.1.2) for my development. I'd put those standard.jar/jstl.jar into /WEB-INF/lib as recommended.
    The problem is I can't seem to get JSTL library working, even I tried out copy and pasting the example code into my pages.
    I have :
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    ... //some code
    ${fn:escapeXml(param["myreq"])} will show out in the JSP exactly "${fn:escapeXml(param["myreq"])}" without processing. Although no runtime errors comes out (meaning the TOMCAT successfully loaded the library) but seems that the taglib is not working!!!
    I did some experiments:
    Experiment 1 :-
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    (notice the uri, its without /jsp)
    and it works for /core taglib, but not the /functions taglib. Meaning somewhere in the TOMCAT library it load the older 1.0 version of JSTL.
    When I try using the /functions taglib
    <%@ taglib prefix="fn" uri="http://java.sun.com/jstl/functions" %>
    TOMCAT will complaint about the non-existence of this JSTL.
    Experiment 2 :-
    I tried to copy all the JSTL tld into my /WEB-INF/tld and and change my web.xml to include the tld location by using <jsp-config><taglib>.
    Doesn't work as well!!! The taglib just didn't get process.
    Experiment 3 :-
    I tried to modify the <Context> in server.xml to include tldNameAware and tldValidation to TRUE.
    Not Working as well!!!
    Experiment 4 :-
    I comment out the <my_tomcat_home>/conf/server.xml <Context> (the one that Eclipse created for my Tomcat project) and directly paste my project directory into <my_tomcat_home>/webapps and restarted my TOMCAT.
    IT WORKS!!!
    So does JSTL 1.1.2 only works in TOMCAT webapps home? Seems that TOMCAT only load the /WEB-INF/lib when the project is in its webapps, but when the project is outside of the webapps dir, it seems doesn't process the JSTL lib.
    Any idea how to make it work outside the Tomcat webapps cause I try to encourage my team to use Eclipse and CVS.

    The probable cause of the issue is your web.xml file.
    If your web.xml file is declared as being servlet version 2.3, then it disables the JSTL expression language (EL) by default.
    ie if you have this:
    <?xml version="1.0"?>
    <!DOCTYPE web-app PUBLIC
       "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
       "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>It should change to be this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">Undo all of that hacking you did through the config files.
    JSTL needs no tld files, and no entries in web.xml to make it work.
    Hope this helps,
    evnafets

  • Difference between Eclipse and Apache Tomcat?

    Can anyone let me know difference between these two? or give me a website link where i can find comparison of the two?I want to work on JAVA+Web services, so what is best bet for me to work with?

    eat your pizza then getinto car.or get into car ,
    reach the moon and then eat your pizza there.you see
    both are usefull somehow.well i asked as i dint know
    much about this stuff, so instead of making fun you
    could have helped me a bit. no?MAybe you could have just taken the sarcasm as what it was and yould have tried to find out what to use Eclipse and what to use Tomcat for... if you can't tell the terms "deleopment environment" and "servlet container" apart, writing servlets might still be too big a task for your present state of knowledge.

Maybe you are looking for

  • PowerMac G5 will not boot up

    Hello all - I have a PowerMac G5 Dual 2.3GHz (early 2005) that has recently started to have issues. It froze a few times in the last week, and then would not boot up again. I dug out the original install disks, and was able to boot and run the Apple

  • How do I open with one click all the windows that I have been minimized? When I right click on the lower bar Firefox icon, I only see the option to close all windows.

    It is used to be that I could right click on the Firefox icon on the toolbar at the bottom of the screen and I would then be given the option to open all windows. Now I only see the option to close all windows. The ability to open all windows is very

  • VF02 - Releasing billing document to accounting

    Hi SAP Gurus, Following error message is displayed while trying to release a billing document (Credit Memo) to accounting: "Tax statement item missing for tax code TB". I guess this should be in relation to pricing procedure. Could you please provide

  • Passing variable into url

    Am sure am missing something but why doesnt this work??? If I hardcode the string value it works fine... <cfset Str_Order =#rsorder.order_id#> <cfoutput> #Str_Order# </cfoutput> <p><a href="MyAccount.cfm?view=customsinvoice&OrderID=' #Str_Order# ' ">

  • PLEASE SEE THAT ANY ERROR IN THIS PROGRAM

    import java.sql.*; public class DB public static void main(String[] args)throws SQLException{           Class.forname("sun.jdbc.odbc.JdbcOdbcDriver");      String url="jdbc:odbc:bharat";      Connection conn=DriverManager.getConnection(url);      Sta