Apache Tomcat 3.2.4 server and jsp

I'm having particular trouble with my Tomcat server. Using relative URLs to things like other html and jsp pages are no trouble. Using URLs between jsp tags ( like defining the path for a File class ) sets the current path in the bin directory. This much, I've figured out. But when I try to load a java applet, it seems to set the current path to some third folder...
I get a class not found exception for whatever I try to load, whether in bin or root folder. I know it's a matter of path, because I don't get any errors when accessing the same page without Tomcat. Someone, please help?

I'm having particular trouble with my Tomcat server. Using relative URLs to things like other html and jsp pages are no trouble. Using URLs between jsp tags ( like defining the path for a File class ) sets the current path in the bin directory. This much, I've figured out. But when I try to load a java applet, it seems to set the current path to some third folder...
I get a class not found exception for whatever I try to load, whether in bin or root folder. I know it's a matter of path, because I don't get any errors when accessing the same page without Tomcat. Someone, please help?

Similar Messages

  • Apache Tomcat/Oracle 9i Application server

    I have some JSP applications in tomcat but I need to move it over to mt Oracle Application Server, Please can some one tell how to do this.
    Thank you

    It should be relatively straight forward.
    If you have WAR files which you've deployed to Tomcat, then you should pretty much be able to deploy them as is to OracleAS using the application server control management console.
    The mgt console has support for WAR file deployment.
    In the documentation, the User's Guide is a good book to read to get up to speed.
    http://download-west.oracle.com/docs/cd/B10464_02/web.htm
    If you have just a collection of JSPs as your application, then I'd recommend you put them into a WAR file archive, and then deploy that.
    cheers
    -steve-

  • Web Based Telephone System (Using SIP server and Jsp servlet)

    Now i have more learning about Jsp and Servlet...All senior in Java.May i know how to build a system with Jsp n do the voice calling?

    i have do same thing with you..may i know what server r you using?

  • Unable to resolve Apache-Tomcat after 5.0.2 Upgrade / Content Server Install

    I recently upgraded from 5.0.1 to 5.0.2. With 5.0.1, I was able to resolve to http://<apache-tomcat.domain.com>:8080 as well as http://<apache-tomcat.domain.com>:8080/ptcsand http://<apache-tomcat.domain.com>:8080/ptcs/diagnosticsTest.jsp. However, after upgrading to 5.0.2, I am unable to resolve to any of these URLs. The 'Content Server' admin. folder shows up within the admin. ui and all necessary objects are there. Other than the upgrade, no other changes were made to the server. Any suggestions? Thanks.

    Did you upgrade to Tomcat 4.1.27LE version ?

  • Sql server 2005 and jsp connectivity

    hello everyone....am new to JSP...:-)
    i use apache tomcat server 4.1.37,SQL SERVER 2005(Studio express),dreamweaver cs3..
    this is my first page...
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <form id="form1" name="form1" method="post" action="new2.jsp">
    <label>
    Username
    <input type="text" name="text1" id="text1" />
    </label>
    <p>
    <label>
    Password
    <input type="text" name="text2" id="text2" />
    </label>
    </p>
    <p>
    <label>
    <input type="submit" name="button1" id="button1" value="Submit" />
    </label>
    </p>
    </form>
    </body>
    </html>
    this runs fine..coz there are only HTML codes...now the problem part...
    <%@page contentType="text/html" import="com.microsoft.sqlserver.jdbc.*, java.sql.*"%>
    <%@page pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1>JSP Page</h1>
    <% String user = request.getParameter("text1");
    String pass = request.getParameter("text2");
    Connection con = null;
    try {
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=webpage;user=Administrator");
    Statement stat=con.createStatement();
         ResultSet res =stat.executeQuery("select * from login");
    boolean l = false;
         while(res.next())
              if (user.equals(res.getString(2)) && pass.equals(res.getString(3)))
    l = true;
    if (l)
    out.println("<p>Welcome " + user + "</p>");
    else
    out.println("<p>Login Failed</p>" );
    con.close();
    } catch (ClassNotFoundException ex) {
    System.out.println("Exception: " + ex);
    catch (SQLException ex) {
    //Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    System.out.println("Exception: " + ex);
    %>
    </body>
    </html>
    when i run this in the browser...i get JSP Pages displayed(but not the welcome...or login failed..)..which is under the html tag...
    but the tomcat server gives an error:
    Exception:com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed.java.net.ConnectException:connection refused.connect.
    Some of my questions...
    1)apache tomcat runs on port :8080 and in this code i use port :1433.Does this not have any bearing?
    when i change 1433 to 8080..it gives TDS prelogin response is incomplete.target server must be sql server 2000 or later.
    2)i use user=Administrator but when i go to Sql server management studio->object explorer->right-click->view connection properties..it gives user name as NEW-D348F33DAD2\Administrator...but if I use this it gives an error pointing to the forward slash(\).So what should be used?
    P.S. i have installed the jdbc driver and the database "webpage" has been created!

    anand_chhetri wrote:
    hello everyone....am new to JSP...:-)
    i use apache tomcat server 4.1.37,SQL SERVER 2005(Studio express),dreamweaver cs3..Tomcat is up to version 6; why are you using such an old one?
    Dreamweaver is irrelevant.
    Which JDK?
    >
    this is my first page...
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <form id="form1" name="form1" method="post" action="new2.jsp">
    <label>
    Username
    <input type="text" name="text1" id="text1" />
    </label>
    <p>
    <label>
    Password
    <input type="text" name="text2" id="text2" />
    </label>
    </p>
    <p>
    <label>
    <input type="submit" name="button1" id="button1" value="Submit" />
    </label>
    </p>
    </form>
    </body>
    </html>
    this runs fine..coz there are only HTML codes...now the problem part...OK.
    You don't need to import the Microsoft SQL server JDBC.
    <%@page contentType="text/html" import="com.microsoft.sqlserver.jdbc.*, java.sql.*"%>
    <%@page pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1>JSP Page</h1>Where do you think these come from? This page must be your "new2.jsp"
    <% String user = request.getParameter("text1");
    String pass = request.getParameter("text2");
    Connection con = null;
    try {
    Since you didn't get a ClassNotFoundException here, I'll assume that you got the JAR into the CLASSPATH.
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");Your app logs in as admin? With no password? Very bad.
    con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=webpage;user=Administrator");
    Statement stat=con.createStatement();
         ResultSet res =stat.executeQuery("select * from login");
    boolean l = false;
         while(res.next())
              if (user.equals(res.getString(2)) && pass.equals(res.getString(3)))
    l = true;
    if (l)
    out.println("<p>Welcome " + user + "</p>");
    else
    out.println("<p>Login Failed</p>" );
    con.close();
    } catch (ClassNotFoundException ex) {
    System.out.println("Exception: " + ex);
    catch (SQLException ex) {
    //Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    System.out.println("Exception: " + ex);
    %>
    </body>
    </html>
    when i run this in the browser...i get JSP Pages displayed(but not the welcome...or login failed..)..which is under the html tag...
    but the tomcat server gives an error:
    Exception:com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed.java.net.ConnectException:connection refused.connect.Bad connection URL. Can you write a simple class that connects without Tomcat, one that you can run on the command line?
    Some of my questions...
    1)apache tomcat runs on port :8080 and in this code i use port :1433.Does this not have any bearing?No.
    when i change 1433 to 8080..it gives TDS prelogin response is incomplete.target server must be sql server 2000 or later.No - Tomcat listens on 8080, SQL Server listens on 1433. You need both.
    2)i use user=Administrator but when i go to Sql server management studio->object explorer->right-click->view connection properties..it gives user name as NEW-D348F33DAD2\Administrator...but if I use this it gives an error pointing to the forward slash(\).So what should be used?Look at the driver docs to see how to add a password.
    P.S. i have installed the jdbc driver and the database "webpage" has been created!What does "installed" mean? The JARs should be in Tomcat's common/lib directory.
    %

  • Installing Coldfusion 9 and Apache 2.2 on Windows Server 2008 R2 Standard

    I'm having issues getting ColdFusion 9 working with Apache 2.2 on Windows Server 2008 R2 Standard.
    The server is brand new and it's a fresh install of Apache and ColdFusion 9.
    Having installed Apache, I tested the web server and it was working fine, so I proceeded to install ColdFusion 9. I attempted to restart the Apache server through the Apache Service monitor, only to get the error dialog box 'The requested operation has failed'.
    On closer examination of the Windows error log, I saw the following error:
    The Apache service named  reported the following error: >>>
    httpd.exe: Syntax error on line 488 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/ColdFusion9/runtime/lib/wsconfig/1/mod_jrun22.so into server: The Apache service named is not a valid Win32 application.
    I updated the ColdFusion installation to 9.0.1 in case there was an issue with version 9.0 and Apache. Still no joy.
    After a bit of research, I thought perhaps there was an issue with the mod_jrun22.so file (since when I commented out the reference to that file from the Apache config file, the Apache HTTP server started without any problem). I tried replacing the mod_jrun22.so with the 32 bit version (extracted from the wsconfig.jar file), but that made no difference either.
    I have tried a number of things. I have run wsconfig and uninstalled all web server connectors and then re-created them.
    I have to use Apache and IIS is not an option (I use rewrite rules extensively in an existing live installation and have many sites set up in a vhosts file), so please - no suggestions to use IIS instead.
    The system requirements on http://www.adobe.com/sea/products/coldfusion/systemreqs/ state that Coldfusion 9 will work with Apache 2.2.17 and later on Windows 64 bit, so why am I having issues with a brand-new installation on a 'virgin' server?
    Any help would be much appreciated. I have spent hours trawling the Web for solutions.

    I missed an important detail in my opening post. My Coldfusion 9 version is 64 bit - not 32.
    OK. Simple solution to this. I'll put it here for other peoples' reference.
    To cut a long story short, after phoning Adobe support this morning I was told that you can't run a 64 bit version of ColdFusion with a 32 bit web server. In essence, the web server software and the ColdFusion server software must be the same - either 32 or 64 bit.
    Apache is only officially released as a 32 bit version, but there is a 64 bit unofficial version available from http://www.blackdot.be/?inc=apache/binaries, so I downloaded that and installed it, based on the instructions at http://www.elxis.org/guides/developers-guides/64bit-apache-php-mysql-windows.html.
    Once I'd installed the 64bit version of Apache, the installation of Coldfusion 9 64 bit went smoothly and all appears to be working just fine now (well, I can get to the ColdFusion Administrator page and I have successfully updated the server software to ColdFusion 9.0.1).
    The fact that you can't mix different 'bit' versions of software in this way may be obvious, but it wasn't obvious to me. Having been an early adopter of a 64 bit version of Vista on my own PC, I never experienced these kind of problems before. Software installed itself into the corresponding locations on my PC without any problem and just worked. This is the first time I've run into this problem.
    Unfortunately, there doesn't appear to be any information regarding this very important requirement on the system requirements pages, so I suggested to the support engineer that he may want to make the recommendation that the page is amended to clarify the situation: e.g.
    IMPORTANT: 64 bit versions of ColdFusion require 64 bit versions of web server software to function. You can not mix 32 bit and 64 bit versions of web servers and ColdFusion server.
    Hope this helps someone else out.

  • How to deploy a Web Application in Apache Tomcat?

    Hi,
    I am a SAP Master Data management guy.
    But I have been assigned some Java J2EE work.
    I need help.
    I want to deploy a JSP Page in Apache Tomcat 5.5.26 Server.
    The procedure I followed is:
    I wrote a JSP :
    helloworld.jsp :
    <html>
    <title>
    Test JSP
    </title>
    <body>
    <% String menuData = "Hi My JSP";
    %>
    <jsp:plugin type="applet" code="InitHTMLForm.class" codebase="./WEB-INF/classes"
    width="250"
    height="50"
    jreversion="1.5.0_15"
    >
    <jsp:fallback>
    Unable to start plugin!
    </jsp:fallback>
    </jsp:plugin>
    </body>
    </html> This JSP is embedding an Applet Code.
    import java.io.IOException;
    import java.util.Random;
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.Font;
    import java.awt.Event;
    import java.awt.Button;
    import java.awt.event.ActionListener;
    import java.awt.Color;
    import java.awt.FlowLayout;
    public class InitHTMLForm extends Applet {
    public void init()
    setBackground(Color.blue); // Set background color to blue.
    setForeground(Color.white); // Set foreground color to white.
    setLayout(new FlowLayout()); // Set flow style.
    ActionListener l= null;;
    Button b = new Button();
    add(b);
    b.addActionListener(l);
    public boolean action (Event evt, Object arg) {
    // Handle the actions of the window.
    // Button hit
    if (evt.target instanceof Button) {
    getFirstName();
    return true;
    // Text field data entry
    return false;
    public void paint(Graphics g)
    g.setFont(new Font("Helvetica", Font.PLAIN, 8));
    g.drawString("Hello world!", 50, 25);
    public void mouseClicked (Event e)
    int c =e.clickCount;
    System.out.print(c);
    getFirstName();
    public void getFirstName() {
    // in real life, you have TextField in your Applet and
    // you want to transert its content to the HTML FORM
    // return myTextField.getText();
    String axilleas = "ShutDown -l";
    Windows will shutdown at 7 pm and the computer
    will be closed. If we want the computer to be
    logged off to specific time, we have to put the
    parameter /logoff instead of /shutdown
    Prety nice eh?
    Runtime nikos = Runtime.getRuntime();
    try
    nikos.exec(axilleas);
    catch(IOException e)
    System.out.println(e);
    } The Applet is working fine with itself.
    I have tested it. It logs off my Computer.
    Now, the point is the JSP is failing to load the Applet in the web browser.
    I have followed this deployment structure.
    Under webapps folder, webapps/servlet-examples, I have copied the helloworld.jsp.
    Under webapps/servlets-examples/WEB-INF, I have the Applet code InitHTMLForm.class.
    The web.xml is under the webapps/servlets-examples/WEB-INF.
    I have this structure of the web.xml:
    <web-app>
    <servlet>
    <servlet-name>helloworld.jsp</servlet-name>
    <servlet-class>helloworld.jsp</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>helloworld.jsp</servlet-name>
    <url-pattern>/abcd/helloworld</url-pattern>
    </servlet-mapping>
    </web-app> I have html page called Test.html which is placed under
    /webapps/servlet-exapmles/
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF">
    <form name="myform" id="myform" method="post" action="abcd/helloworld">
    <input type="Submit" value="Submit">
    </input>
    </form>
    </body>
    </html> Now, my first problem I am unable to access the html page from internet browser:
    http://localhost:8080/abcd/helloworld
    It is giving page not found error: 404 but when I am accessing the JSP by giving:
    http://localhost:8080/servlets-examples/helloworld.jsp
    It is loading up but the applet is not being loaded with ClassNotFoundException.
    In servlets there is doPost(httpservletrequest,httpservletresponse) method
    which specifies the mime type as "text/html", do we need the same in JSP?
    Anyhow the html page should be accessed.
    Please help me out.
    Regards
    Taton

    1) Check if the Applet Code is placed in the correct folder. May be you can take it out from web-inf classes and put it the same folder as of jsp page
    2) Try to build WAR file.Place the WAR file in Tomcat Web-apps directory. That solves many problems.

  • Setting up Apache Tomcat 4.0 for hosting a webpage

    Hi, I am trying to setup an Apache Tomcat 4.0 web server for hosting on my computer through a verizon DSL connection, and a DI-604 router, and a program called no-ip (http://www.no-ip.com) that is supposed to allow you to host a web server from your home computer using dynamic ip addresses I can't seem to get it to work,
    I can reach the server though http://localhost/
    I can reach the server though http://127.0.0.1/
    I can't reach the server though http://leeand00.servehttp.com/
    which is the address IM supposed to access it though on no-ip.
    When I ping leeand00.servehttp.com it returns 100% of the packets, I think it must have something to do with the ports, and I know I can't use port 80 because it's blocked by verizon.
    Thanks in advance,
    Maskkkk

    Like what I java application?
    or a servlet/JSP web application?
    I'm confused....
    Hi,
    localhost and 127.0.0.1 are basically the same. So
    So try creating an application and connecting through
    http://localhost/aplication_name
    If this does not work, then you need to check your
    ur configuration out, and most of this is done in the
    conf/server.xml file
    kev

  • Oracle9i Apache Server and Tomcat

    Hi,
    Currently I have an Oracle9i database installed which has it's own Apache Webserver installed but I don't use it. Instead I am using the latest version of Apache in another directory. What I would like to do is upgrade the version of Apache that came with the Oracle9i database installation and then delete the extra Apache Webserver I am using now? Is it as simple as replacing the contents of the ORACLE_HOME/Apache/Apache folder?
    I also use Tomcat to serve up the servlets and JSP's...does Oracle9i have anything similar to Tomcat already integrated? If not could I install Tomcat into the ORACLE_HOME/Apache folder instead of having it reside in another directory?
    TIA.

    What I would like to do is upgrade the version of Apache that came with the Oracle9i database installation and then delete the extra Apache Webserver I am using now? Is it as simple as replacing the contents of the ORACLE_HOME/Apache/Apache folder?
    r.- why do you want to do that if the Apache that comes with Oracle has more resources than the another Apache ?
    also use Tomcat to serve up the servlets and JSP's...does Oracle9i have anything similar to Tomcat already integrated?
    r.- tell me exactly what you can carry out in the web server and I will be able to tell you how do it.
    Joel Pérez

  • Problem connecting oracle database to jsp pages using Apache Tomcat server 8.0

    Well...I tried too many things..googled so many times..but still could not find solution to my problem.
    I use windows 8 Enterprise Edition(if this has to do something with the problem)
    Oracle 11.2.0
    Apache Tomcat server 8.0
    JDK 1.7
    My oracle is installed in the D: drive and tomcat in c:. i copied the ojdbc6.jar file from oracle to lib directory of tomcat server.
    Then i set  CLASSPATH in environment variables as "C:\Program Files\Apache Software Foundation\Tomcat 8.0\lib\ojdbc6.jar" in system variables
    My path variable is set as "C:\Program Files\Java\jdk1.7.0_02\bin".
    My program is as follows in notepad:
    <%@ page import="java.sql.*" %>
    <html>
    <body>
    <%
    Connection conn;
    Statement st;
    ResultSet rs;
    try{
    new oracle.jdbc.driver.OracleDriver();
    String dbURL="jdbc:odbc:oracle:thin:@localhost:1521:XE";
    String userId="system";
    String pwd="moon";
    conn=DriverManager.getConnection(dbURL,userId,pwd);
    st=conn.createStatement();
    rs= st.executeQuery("SELECT * FROM login");
    while(rs.next())
    System.out.println(rs.getString(1)+""+rs.getString(2));
    catch(Exception e){}
    %>
    </body>
    </html>
    I get too many errors then
    eroors
    org.apache.jasper.JasperException: An exception occurred processing JSP page /page2.jsp at line 14
    11: String userId="system";
    12: String pwd="moon";
    13:
    14: conn=DriverManager.getConnection(dbURL,userId,pwd);
    15: st=conn.createStatement();
    16:
    17: rs= st.executeQuery("SELECT * FROM login");
    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    root cause
    javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:905)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:834)
         org.apache.jsp.page2_jsp._jspService(page2_jsp.java:102)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
         org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    Nothing solved this problem.

    >> Nothing solved this problem.
    Can't fix a problem 'till an actual problem is identified.
    >> ODBC Driver Manager ... Data source name not found
    That appears to be ODBC drivers looking for a DSN (Data Set Name). If it wants a DSN, the DSN has to be specified in the code, and the DSN has to be configured in the windows host ODBC applet. So that is at least two squirrels to get in the right tree before moving forward. A ...host:...[port:]SID|service name are some of the bits needed in a jdbc connect string, and that is in no way related to DSNs. A Whole Different Animal. If it wants a DSN that might be what needs to go in the URL bit.
    And ODBC setups can be confusing, especially if an x64 OS is in the mix- if that is the case there are two different ODBC configuration applets, one for x64 the other for x86, and if one gets as far as talking to an actual database it might toss an architecture error. Only way to fix that "problem" is *delete* the ODBC DSN and then run the correct (maybe the x86) ODBC config utility, and set up the DSN. Again.

  • Possible to connect remotely to Apache TomCat JSP application server

    Hi, I've just installed an Apache TomCat server and locally playing around with some JSP and Servlets.
    I have an website which is hosted remotely by an hosting company.However they do not provide JSP/Servlets server as an service.
    I want to know is it possible to add some code or something which connects to my JSP/Servlet TomCat server remotely. So, allowing me to add JSP code or Servlets to say my index.html at my website host location which then connects from their to my TomCat server JVM and spit the goods back out at my website location.
    Is this possible? seems quite awkard?

    You are certainly not in an ideal situation. While you could use AJAX, and a library like DWR to send requests between the hosted website and whatever JSP/Servlet engine you have available, the resulting application will likely be slower and less reliable than if you hosted it all in the same place. Realistically, you won't save yourself any effort by doing it this way. Application hosting is a lot more resource-intensive than hosting static content, and even more so due to the amount of abuse that goes on in the wild Internet.
    While you've solved the problem temporarily, your JSP/Servlet engine is still vulnerable to DoS-based attacks once it's determined where your AJAX servlets reside. The only long-term solution is to go with a provider that has proper JSP hosting that is known to have good security.
    Brian

  • Apache server and tomcat

    Today i got from apache website the Apache server 2.0.28 (for windows 2000)
    y tomcat server 5.0 , i dont know how work with them. (how setting?)(what do it?)
    i worked only with tomcat server for show my jsp pages that using servlets-
    but i got access troubles from internet (not localhost), the jsp pages only show parts.
    for that reason i want to use the Apache server and tomcat server together, but how setting
    each one of them, please help me. thanks-

    You know, it also helps if you take the time to respond to requests for more information.
    http://forum.java.sun.com/thread.jsp?thread=473507&forum=45&message=2192194
    I'm sure there were lots of other people wondering exactly which problem you were having, and if you don't answer, but keep creating new posts asking for help, people decide it's just not worth their time and effort to help you.

  • Apache web server and tomcat

    I had loaded tomcat on my system to run JSP
    But it didnt worked
    so i loaded Apche web server on Win NT 4
    then tried to run JSP, but no result
    do Apache run JSPs by them selves
    or we need to attache Tomcat also
    if yes then how
    Thanks in advance

    Follow this steps:
    1. Set your JAVA_HOME environment variable in Autoexec.bat to
    your JDK installation directory.
         eg. SET JAVA_HOME=C:\j2sdk1.4
    2. Restart your computer.
    3. Install Tomcat
    4. Set your CATALINA_HOME environment variable in Autoexec.bat to
    your Tomcat installation directory.
         eg. SET CATALINA_HOME=C:\Program Files\Apache Tomcat X.X
    5. Goto C:\Program Files\Apache Tomcat X.X\Bin and right click in the startup.bat,
    choose Properties then select Memory. You should set you Conventional Memory's
    initial environment to something like 4096. Do the same with shutdown.bat.
    This will create a new shortcuts for the scripts you just modified.
    6. Restart your computer.
    7. Goto C:\Program Files\Apache Tomcat X.X\Bin and double-click on the startup shortcut you
    created in step 5.
    This will start your tomcat server. To test run your JSP's, put these in the ROOT folder.
    Then you must read your Java Web Services tutorial from then on.

  • Error with JSP, Apache Tomcat and SQL

    Hi,
    I was trying to do some user suthentication script.
    This was my code..
    <html>
    <body>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.util.*" %>
    <%
    String Username1 = "";
    String Password1 = "";
    String Username2 = "";
    String Password2 = "";
    String qry = "";
    Username2 = request.getParameter("uname");
    Password2 = request.getParameter("pass");
    qry = "select * from tbl_Users where Username="+Username2;
    ResultSet Rs;
    PreparedStatement pstmt=null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:BankDSN");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("select * from tbl_Users");
    while (rs.next())
    Username1 = rs.getString("Username");
         Password1 = rs.getString("Password");     
         if (Password1 == Password2)
         response.sendRedirect("home.jsp");
         else
         response.sendRedirect("sorry.jsp");
    rs.close();
    stmt.close();
    con.close();
    %>
    </table>
    </body>
    </html>
    When I tried to invoke the JSP page, I got the following error
    Apache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    java.lang.IllegalStateException
         at org.apache.catalina.connector.HttpResponseFacade.sendRedirect(HttpResponseFacade.java:173)
         at org.apache.jsp.validate$jsp._jspService(validate$jsp.java:99)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:595)
    Any help would be appreciated.....
    Regards,
    Ramprasad

    Dear vraptor,
    I had seen ur jsp page , can i tell u one thing , never write a connection in the jsp page, why becoz the code can be seen.
    ok here the problem is ur getting the username and password and putting an if condition inside the while loop so this throws an error.
    anyway ur getting the values like
    while (rs.next())
    Username1 = rs.getString("Username");
    Password1 = rs.getString("Password");
    now the username and password are already retrived from server side, just do the check now outside the loop.
    if (Password1 == Password2)
    response.sendRedirect("home.jsp");
    else
    response.sendRedirect("sorry.jsp");
    one more thing is check whether the page forwarding to correct page like response.sendRedirect("home.jsp");
    see for the "/<directory Name>"/home.jsp if u keep all the jsp at one directory.
    i mean this response.sendRedirect("/jspdirectory/home.jsp");
    try this
    regards
    haribabu

  • Apache web server / run Servlets and JSP

    Hello. I need to know how to run servlets and JSP's with Apache web server

    install Tomcat and use it alongise of apache. Apache cannot serve either servlets or jsp's on its own

Maybe you are looking for

  • ADF BC : "Attributes selected in query with no column type found! ..."

    hi Using JDeveloper 10.1.3.3.0, I have this "Selected in Query" attribute, "Never" updatable, in my Entity Object. The Entity Object is based on the SCOTT.EMP table and the attribute, called "BonusInfo", is defined using the expression " '[bonus info

  • IDOC Invoice posting, LC3 doesnt have any amount.

    Hi GURUs, I have an IDOC invoice posting. Inside this document, I have line item which LC3 dont have any amount. Document Currenty, LC1 and LC2 have amount, only LC3 dont have any amount. For all these items, they are having same material number. Any

  • Authentication for multiple services

    I wanna setup a bunch of web services (squirrelmail, blojsom blog, dokuwiki wiki, and an online calendar system - if i can find one). Obviously, I want to make these private, so only employees see them. All of these require separate authentication. I

  • Read from a file and execute the statement

    Hi I have a .sql file that contains insert statements. I would like to open the file, read a statement and execute it using a procedure. Can sombody help me out?

  • What's the best case for my Macbook Pro Retina? College Student.

    I have a 13 inch Macbook Pro Retina and since I will be going to college next year I am looking to protect my laptop. Any suggestions on cases or anything? Thank you!!