Java servlets - JDBC

hi,
I have a problem... i would like to fetch some strings from the database using JDBC and create a tree structure using java servlets to be displayed on a browser using html.
Currently i have tried using a hashtable as well as defaultmutabletreenode, both of which grew complicated and did not give the desired results.
Pls help...

I tried using both a DefaultMutableTreeNode
containing all the other nodes as child nodes and a
hashtable with a series of internal hashtables -- and
passed it to the servlet displaying the html
l content.
Is there a better/simpler data structure to use in
this case other than a Hashtable and a
DefaultMutableTreeNode?How should we know? You're asking what is better to solve your problem, without saying what your problem is. (Hint: "I can't do this" or "It doesn't work" are not useful problem descriptions.)
If I were doing this, and if I had to build a tree structure in memory before producing HTML from it, I would use DefaultMutableTreeNode. But then I don't know anything about your problem.

Similar Messages

  • Calling a COBOL stored proc from Java Servlet

    I am trying to call a COBOL stored proc from a Java Servlet. The stored proc is stored on a DB2 database. I need to send 6 inputs to the COBOL stored proc and the output will be the return code of the stored proc. I'm not sure if I'm going about this the right way. This is how my code looks...
    public int callStoredProc(CallableStatement cstmt,
    Connection con,
    String sYear,
    String sReportNbr,
    String sSystemCode,
    String sUserId,
    String sModuleNbr,
    String sFormId){
    int iParm1 = 0;
    try{
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(ClassNotFoundException ex){
    System.out.println("Failed to locate database driver: "
    + ex.toString());
    return iParm1;
    try{
    cstmt = con.prepareCall("{? = CALL MKTPZ90C
    cstmt.registerOutParameter(1, Types.INTEGER);
    cstmt.setString(2, sYear);
    cstmt.setString(3, sReportNbr);
    cstmt.setString(4, sSystemCode);
    cstmt.setString(5, sUserId);
    cstmt.setString(6, sModuleNbr);
    cstmt.setString(7, sFormId);
    cstmt.execute();
    iParm1 = cstmt.getInt(1);
    CloseSQLStatement(cstmt);
    catch(SQLException ex) {
    CloseSQLStatement(cstmt);
    System.out.println("SQL exception occurred:" +
    ex.toString());
    return iParm1;
    return iParm1;
    Could someone tell me if this is the right way to go about doing this?
    Thanks!!!!!!

    I didn't see the code where you create the database connection (variable "con"). However, the answer to your question "Is this the right way...", for me, is "Anything that works is the right way." So try it. That's a first approximation, but once you have something that works you can start on improving it, if that becomes necessary.

  • Java Servlet Error in oracle 10.1.2 (10g)

    Hello,
    This question belongs to our company project,which is a Govt.Organization. We are using AIX 5.3 Server OS with Oracle 10.1.2 (10g) Application Server on it.
    We have installed all the above OS & Oracle Application on IBM P-Series High End Servers.
    Now, We have successfully installed "Oracle 10g AS" on AIX but after installation, we are getting some common errors which is related to JAVA & Servlet. Below is the error file.
    09/05/02 19:01:50 Started
    09/05/02 19:01:51 vatwebsite: jsp: init
    09/05/02 19:01:51 vatwebsite: FrontServlet: init
    09/05/02 19:01:52 vatwebsite: action: init
    09/05/02 19:01:54 vatwebsite: barbecue: init
    09/05/02 19:01:54 vatwebsite: Started
    09/05/02 19:01:55 vatwebsite: Servlet error
    java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(HashMap.java(Compiled Code))
        at java.util.HashMap$KeyIterator.next(HashMap.java(Compiled Code))
        at java.util.Collections$6.nextElement(Collections.java:2493)
        at org.apache.struts.util.RequestUtils.getModulePrefixes(RequestUtils.java:1907)
        at org.apache.struts.util.RequestUtils.getModuleName(RequestUtils.java:1803)
        at org.apache.struts.util.RequestUtils.getModuleName(RequestUtils.java:1788)
        at org.apache.struts.util.RequestUtils.selectModule(RequestUtils.java:1768)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1481)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
        at com.vat.website.utils.LogRecorderServlet.doPost(LogRecorderServlet.java:38)
        at com.vat.website.utils.LogRecorderServlet.doGet(LogRecorderServlet.java:29)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
        at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
        at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
        at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
        at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
        at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
        at java.lang.Thread.run(Thread.java:568)
    I need some solution to remove this error. Kindly let me know how to go further to sort out this error. Another thing is,I am not a JAVA/Programmer person But still this is a part of my job.
    So,please do the needful & provide me some guidence & document about "How to solve this JAVA Error".
    Advanced Thanks,
    Nishith Vyas.

    See this thread for a JDBC bug number reference
    JDev 10.1.3 : Error running my first ADF application.

  • JSP Servlet JDBC connection

    Below is the code for handling login.
    However I am new to servlets, and I am wondering is the code below correct?
    Can anyone give me some advice if it is not correct?
    package gcd;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.mysql.jdbc.*;
    public class LoginHandler extends HttpServlet
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    res.setContentType("text/html");
    PrintWriter out = res.getWriter();
    //Load the driver
    Class.forName("com.mysql.jdbc.Driver");
    //Get a connection to the database
    java.sql.Connection connection=java.sql.DriverManager.getConnection("jdbc:mysql://localhost/gcdBB_db");
    //Create a statement object
    java.sql.Statement statement = connection.createStatement();
    Enumeration parameters = request.getParameterNames();
    if(parameters.hasMoreElements())
    // Get the user's account number, and password
    String username = req.getParameter("username");
    String password = req.getParameter("password");
    statement.executeUpdate("INSERT INTO users (username,password) VALUES ('"+username+"','"+password+"')");
    // Check the name and password for validity
    if (!allowUser(username, password))
    out.println("<HTML><HEAD><TITLE>Access Denied</TITLE></HEAD>");
    out.println("<BODY>Your login and password are invalid.<BR>");
    out.println("You may want to <A HREF=\"Login.jsp\">try again</A>");
    out.println("</BODY></HTML>");
    else
    // Valid login. Make a note in the session object.
    HttpSession session = req.getSession();
    session.setAttribute("logon.isDone", account); // just a marker object
    // Try redirecting the client to the page he first tried to access
    try
    String target = (String) session.getAttribute("login.target");
    if (target != null)
    res.sendRedirect(target);
    return;
    catch (Exception ignored) { }
    // Couldn't redirect to the target. Redirect to the site's home page.
    res.sendRedirect("/");
    protected boolean allowUser(String username, String password)
    return true; // trust everyone
    }

    I made the following changes as suggested, to the LoginHandlaer code.
    I also want to ask about the code for ProtectedResources. Do I need to inlude anything in the program. Will I need to include code for the JDBC connection?
    Are the 2 java servlets below correct, as I want JSP-Servlet-JSP operation for login? I can also include the code for Login.jsp if requested?
    PS: I am using Tomcat 3.1 as my server.
    package gcd;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.mysql.jdbc.*;
    public class LoginHandler extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
                   response.setContentType("text/jsp");
              PrintWriter out = response.getWriter();
              try
                   //Load the driver
                   Class.forName("com.mysql.jdbc.Driver");
                        //Get a connection to the database
                        java.sql.Connection connection=java.sql.DriverManager.getConnection("jdbc:mysql://localhost/gcdBB_db");
                        //Create a statement object
                        java.sql.Statement statement = connection.createStatement();
                        Enumeration parameters = request.getParameterNames();
                        // Get the user's username, and password
                        String username = request.getParameter("username");
                        String password = request.getParameter("password");
                        statement.executeUpdate("INSERT INTO users (username,password) VALUES ('"+username+"','"+password+"')");
                   // Check the username and password for validity
                   if (!allowUser(username, password))
                        out.println("<HTML><HEAD><TITLE>Access Denied</TITLE></HEAD>");
                        out.println("<BODY>Your login and password are invalid.<BR>");
                        out.println("You may want to <A HREF=\"Login.jsp\">try again</A>");
                        out.println("</BODY></HTML>");
                   else
                        // Valid login. Make a note in the session object.
                        HttpSession session = request.getSession();
                        session.setAttribute("logon.isDone", username); // just a marker object
                        // Try redirecting the client to the page he first tried to access
                        try
                             String target = (String) session.getAttribute("login.target");
                             if (target != null)
                                  response.sendRedirect(target);
                                  return;
                        catch (Exception ignored) { }
                             // Couldn't redirect to the target. Redirect to the site's home page.
                             response.sendRedirect(request.getContextPath() + "http://localhost:8080/jsp/gcdBB");
                   catch (ClassNotFoundException e)
                        out.println("Could not load database driver: " + e.getMessage());
                   catch(SQLException e)
                        out.println("SQLException caught: " + e.getMessage());
         protected boolean allowUser(String username, String password)
              return true; // trust everyone
    package gcd;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.mysql.jdbc.*;
    public class ProtectedResources extends HttpServlet
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
              response.setContentType("text/plain");
              PrintWriter out = response.getWriter();
              // Get the session
              HttpSession session = request.getSession();
              // Does the session indicate this user already logged in?
              Object done = session.getAttribute("logon.isDone"); // marker object
              if (done == null)
                   // No logon.isDone means he hasn't logged in.
                   // Save the request URL as the true target and redirect to the login page.
                   session.setAttribute("login.target",
                   HttpUtils.getRequestURL(request).toString());
                   response.sendRedirect(request.getContextPath() + "http://localhost:8080/jsp/gcdBB/Login.jsp");
                   return;
              // If we get here, the user has logged in and can see the bulletin boards
              out.println("The GCD Computing Bulletin Board awaits you!");
    Any help would be greatly appreciated!

  • Connecting Pooling using Java Servlets

    Hello Friends I am in search of a programme to make a connection pooling using Java Servlets.
    Please let me know where i will get it or do post it.

    If you mean JDBC connection pools, one solution can be found here - http://www.javaexchange.com
    Chuck

  • Help: No Parameters, HTML Output from Java Servlet

    I have a Java Servlet that reads parameters passed from an HTML form and displays them to another HTML page. I know the servlet is being invoked; however, I am not seeing any HTML output. Sending the output to a file reveals the parameters are coming in as NULL as well.
    I attempted a simple sample app with the same results. Here is what I am running:
    The HTML Form:
    <!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="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>
    The Java Code:
    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";
    out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
         "Transitional//EN\">\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>");
    What happens when I "submit" from the form is the same form reloads with the query string in the URL: "http://localhost:8080/ThreeParams/?param1=1&param2=2&param3=3"
    Any assistance with either (or both) would be thoroughly appreciated:
    a) why the parameters are not being passed correctly to the servlet
    b) why the HTML output page is not displayed
    Thanks in advance!
    - Steve

    I have found the answer to my problem listed in another thread.
    Thank you.

  • Problem with JSP and Java Servlet Web Application....

    Hi every body....
    I av developed a web based application with java (jsp and Java Servlets)....
    that was working fine on Lane and Local Host....
    But when i upload on internet with unix package my servlets and Java Beans are not working .....
    also not access database which i developed on My Sql....
    M using cpanel support on web server
    Plz gave me solution...
    Thanx looking forward Adnan

    You need to elaborate "not working" in developer's perspective instead of in user's perspective.

  • Java servlets

    I am using Java Servlet and SQL.. i want to open two tables with two resultset objects...
    i closed the first resultset and statement object. now open the second resultset and statement..
    here the objects are created but the while doling "while(rs.next())" is not executed...
    please solve this problem ...
    another one is i am using the requestdispatcher
    in the first servlet i havae the dopost method in this i put the requestdispatcher with forward or include from one servlet to another servlet .. here gives the expection is
    do not match with post url
    why this is happened....

    ramkrishna.goli wrote:
    I am using Java Servlet and SQL.. make sure you aren't putting database calling directly in your Servlet
    create a DAO layer to decouple the business logic from the data access methods
    i want to open two tables with two resultset objects...i think you mean you want to perform 2 queries and get back 2 ResultSets
    i closed the first resultset and statement object. now open the second resultset and statement..
    here the objects are created but the while doling "while(rs.next())" is not executed...was an error thrown?
    if not, just sounds to me like no database records were found/returned
    i.e. empty ResultSet
    please solve this problem ...that's your job!

  • Long running reports using java servlets

    Hello,
    I'm running into a problem using java servlets to produce database reports and sending them back to the client browser as excel or html. The problem comes into play when the user has submitted two reports then goes to run a third and the browser hangs. I realized now that this is because of the two active connections that the user already has to the app server. Does anyone have any suggestions on how to get around this? I'm trying to now write the report to the server, and provide the browser with a url, but it seams as though the connection isn't totally closed even though I close the response printwriter.... Any suggestions would be greatly appreciated....

    Unfortunately I dont have an answer to your question, but:
    If the reports are large/long running, should they be generated on demand? You could schedule the reports to be generated every day, month or whenever appropriate, stored on the server and then quickly pulled by the user whenever needed.

  • Error when deploying EAR file: Operation failed with error: java:/app/jdbc/

    I created application using JDeveloper 11g, and have the deploy file EAR read to deploy to oracle application server 10g, but I am encouting the error of Operation failed with error: java:/app/jdbc/jdbc/HRConnDS not found
    Below is the log. What did i do wrong? I have created the datasource of HRConnDS, and it shows in EM.
    Nov 6, 2009 10:06:12 AM] Application Deployer for hra1 STARTS.
    [Nov 6, 2009 10:06:12 AM] Copy the archive to /u01/OraHome_app1/j2ee/home/applications/hra1.ear
    [Nov 6, 2009 10:06:12 AM] Initialize /u01/OraHome_app1/j2ee/home/applications/hra1.ear begins...
    [Nov 6, 2009 10:06:12 AM] Unpacking hra1.ear
    [Nov 6, 2009 10:06:12 AM] Done unpacking hra1.ear
    [Nov 6, 2009 10:06:12 AM] Unpacking webapp2.war
    [Nov 6, 2009 10:06:12 AM] Done unpacking webapp2.war
    [Nov 6, 2009 10:06:12 AM] Initialize /u01/OraHome_app1/j2ee/home/applications/hra1.ear ends...
    [Nov 6, 2009 10:06:12 AM] Starting application : hra1
    [Nov 6, 2009 10:06:12 AM] Initializing ClassLoader(s)
    [Nov 6, 2009 10:06:12 AM] Initializing EJB container
    [Nov 6, 2009 10:06:12 AM] Loading connector(s)
    [Nov 6, 2009 10:06:12 AM] Starting up resource adapters
    [Nov 6, 2009 10:06:12 AM] application : hra1 is in failed state
    [Nov 6, 2009 10:06:12 AM] Operation failed with error: java:/app/jdbc/jdbc/HRConnDS not found
    Thank you very much for your help.

    How did you create your datasource, can you post the content, without passwords of course.
    Greetings.

  • Inputting an excel file to the java servlet program

    Hi,
    How can I input an excel file into the java servlet program? I am using POI HSSF programming to read the content of that excel file.I have created a form that will accept the path from the user and in the servlet program, I have called a post method to retrieve the path of the file. I am getting the path of the file as a string.Then I have to access the file to read the data. But it is not working. What should I do?.Please help me.
    I have created an html file to create a form that will ask the path of the file to be loaded into the servlet program.Please give me a solution,thanks in advance. The servlet program that receives the file is shown below. It just only take the name of the file and prints if that is ok.
    <html>
    <body bgcolor="green">
    <center>
    <form method="post"  action="http://localhost:8080/examples/servlet/Ron1">
    <table>
    <tr>
    <td><B>ENTER THE PATH OF THE FILE</td>
    <td><input type=file name="path"></td>
    </tr>
    </table>
    <input type=submit value= "submit" >
    </form>
    </body>
    </html>
    import java.io.*;
    import javax.servlet.*;
    import java.lang.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.text.*;
    import java.util.*;
    import com.oreilly.servlet.MultipartRequest;
    import org.apache.poi.hssf.usermodel.*;
    public class Ron1 extends HttpServlet
       public void doPost(HttpServletRequest request, HttpServletResponse response)   throws IOException, ServletException
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            String u = request.getParameter("FileToUpload");
            out.println("The Path is "+u);
            System.out.println("The path is "+u);
            MultipartRequest multi = new MultipartRequest(request,u,10 * 1024 * 1024);
            System.out.println("path is "+u);
            Enumeration files = multi.getFileNames();
            File fUploadedFile = null;
            String sFileName = "";
            out.println("path is "+u);
            while(files.hasMoreElements())
                            String name = (String)files.nextElement();
                            out.println("file is "+name);
                            sFileName = multi.getFilesystemName(name);
                            String type = multi.getContentType(name);
                            fUploadedFile = multi.getFile(name);
                    FileInputStream fis= new FileInputStream(fUploadedFile);
                   HSSFWorkbook wb=new HSSFWorkbook(fis);
                    System.out.println("The path is "+u);
                    out.println("File has identified successfully\n");
                    out.close();
       }

    Hi,
    Can you try to use classes from java.net package (URL, URLConnection) to pass the contents of excel file to servlet?
    HTH
    Vishal

  • Tomcat 6 – Calling a  Java Servlet from a JSP Page

    Below is a very simple JSP Page that calls a Java Servlet. The question is given Tomcat security constraints, is it possible to call a servlet from a JSP and get the correct output without getting an error message? If so, how would you code the web.xml file?
    c:\apache-tomcat-6.0.18
    Under conf
    catalina
    localhost
    HelloWorldExample.xml is directly under localhost
    The application would have this directory structure:
    webapps
    HelloWorldExample
    hello.jsp is directly under HelloWorldExample
    Under HelloWorldExample
    src
    WEB-INF
    classes
    Under classes
    jservlets
    HelloWorld.java is in src folder
    HelloWorld.class is in jservlets folder
    HelloWorldExample.xml
    <Context path="/HelloWorldExample" docBase="HelloWorldExample" debug="0"
          reloadable="true" crossContext="true">    
    </Context>**************************
    hello.jsp
    <HTML>
    <HEAD>
    <TITLE>Hello</TITLE>
    </HEAD>
    <BODY>
    <FONT SIZE="4">
    <P>
    Please enter your name:
    <FORM 
       METHOD="Post"
       ACTION="servlet/jservlets.HelloWorld">
    <TABLE BORDER="3" CELLPADDING="1" WIDTH="100%" ALIGN="CENTER">
    <TR>
        <TD><B>Name:</B></TD>
        <TD><INPUT TYPE="text" NAME="Name" VALUE="" SIZE="65"> </TD>      
    </TR>
    </TABLE>
    <P>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    </FORM>
    </FONT>
    </BODY>
    </HTML>******************
    HelloWorld.java
    package jservlets;
    import java.io.*;
    import java.util.Date;
    import java.util.*;
    import java.text.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorld extends HttpServlet
       PrintWriter out;
       PrintWriter err; 
       String strName;
    public void displayMessage(HttpServletRequest request, HttpServletResponse response)
          throws Exception
             try
                if (!strName.equals("") && strName != null)
                   out.println("Hello " + strName + "" + "<P>");
                    out.println("Hello World" + "<P>");
                else
                    out.println("Hello World" + "<P>");
            catch (Exception e)
                out.println("Exception: Could not display message." + "<P>");
                err.println (e.getMessage () ) ;
                out.println("<P>");
    public void doPost(HttpServletRequest request, HttpServletResponse response)
               throws ServletException, IOException
          try
               response.setContentType("text/html"); 
               out = response.getWriter();
               err = response.getWriter();
               strName = request.getParameter("Name").trim();
               out.println("<html><head><title>");        
              out.println("</title></head><body>");
               out.println("<FORM");
               out.println("METHOD=POST");
               out.println("ACTION=http://localhost:8080/HelloWorldExample/hello.jsp>");
             out.println("<TABLE ALIGN='RIGHT'>");
             out.println("<TR>");
             out.println("<TD>");          
               out.println("<INPUT TYPE=\"SUBMIT\" VALUE=\"Hello World Page\";>");
               out.println("</INPUT>");
              out.println("</TD>");
             out.println("</TR>");
             out.println("</TABLE>");
             out.println("</FORM>");
             out.println("<BR CLEAR='all'>");
               out.println("<P>");        
               displayMessage(request, response);
               out.close();
             out.println("</body></html>");               
           catch(Throwable e)
              e.printStackTrace();
          public void doGet(HttpServletRequest request, HttpServletResponse response)
             throws ServletException, IOException
             doPost(request, response);
    web.xml
    <servlet>
          <servlet-name>HelloWorld</servlet-name>
          <servlet-class>jservlets.HelloWorld</servlet-class>
    </servlet>  
    <servlet-mapping>
            <servlet-name>HelloWorld</servlet-name>
            <url-pattern>/servlet/HelloWorld</url-pattern>
    </servlet-mapping>      ******************************
    HelloWorld.java can be compiled by using javac.
    Once compiled, HelloWorld.class would be moved to the jservlets folder.
    FYI, coding the above url-pattern results in:
    HTTP Status 404
    The requested resource (/HelloWorldExample/servlet/jservlets.HelloWorld) is not available
    The following url-pattern in the web.xml file permits the servlet to be executed but results in a null pointer exception:
    <servlet-mapping>
            <servlet-name>HelloWorld</servlet-name>
            <url-pattern>/ </url-pattern>
    </servlet-mapping>      **************************************************
    Robin

    This problem was resolved.
    In hello.jsp
    ACTION="servlet/jservlets.HelloWorld">
    was replaced with
    ACTION="servlet/HelloWorld">
    Robin

  • How to get a CA certificate installed in the web trust db from java servlet

    Hi all.
    Hi, I have a web-app that requires a client certificate from a CA. The CA cert is in the trust db of the webserver. And I would like to get the CA certificate (X509Certificate) corresponding to the issuer of the current client certificate of the request. Is there an easy way of doing this from a java servlet?
    I'm using Sun Java System Web Server 6.1
    Thanks in advance.

    Hi, thanks for your quick answer.
    I have to check the client certificate revocation status using ocsp protocol. I'm cheking ogro project ocsp library (http://dev.globus.org/wiki/Incubator/OGRO) to check this status against my CA validator agency. In order to use this library in my servlet to check the status I need both the client cert and the issuer cert. So that is why I need to get the CA cert from my trust db.
    There is another way, I have the cert as file (the same I used to import the CA cert in my trust db), and I get the cert from the file. With this cert and the cert from the client I do the ocsp request and it works. But I trying to avoid having the CA cert in a file and recover the cert from the trust db.
    Thanks

  • When Streaming a PDF from a java servlet I get a grey screen on the Adobe Reader X plugin.

    I work on a webapp where we serve pdfs to clients by streaming via java servlets. Once we began to use Reader X we noticed that in IE the pdf will load Reader X with a grey screen. Chrome and firefox both work perfectly fine. If we use Adobe 9 it also works fine. We have no control over what our users use so any client side fix is not useful.
    We serve these pdfs to our user by opening a popup window to a url that streams the pdf directly to the response. We have noticed that if we have one popup window that has hit the grey screen - each new pdf in a popup works correctly - as long as the original grey screen is up, once all popups are closed the problem happends again. Refreshing the window with the grey screen will also show the pdf correctly.
    The problem is very similar to what is described here:
          http://forums.adobe.com/message/3335266
    However, we are not setting any caching headers - I have full control over what we can send and I have tried the suggestions - nothing works. Any ideas how to resolve this?

    You are prevented from Airplay mirroring certain things like DVD content as the material is usually protected so you get a checkerboard type display.  I think there is a theoretical risk that the Airplay stream could be intercepted and the protected video copied, albeitin lower quality.
    Apple may be being cautious or are required to do so with the DVD player app by movie studios/licensing authorities.  It makes no sense to the average consumer who is just trying to send their purchased DVD to the TV via the computer and AppleTV.
    Playback in something like VLC should work - not tried it myself but others have commented it doesn't have the restriction.

  • Is java servlet a good way for developing a website

    Hi,
    i am developing a website that has to download huge data and upload huge data .also money transactions through credit cards need to be involved.is java servlet a good way to do this or should i use an ejb or any other technology.
    Any help is appreciated.

    Thanks for the reply.But di i need to use threading of some sort or can i directly write private methods to fulfill the purpose.Also is there any way my servlet can recognise when a device is connected to a usb port of local machine
    any help is appreciated

Maybe you are looking for

  • What are the default apps that come with a macbook pro Mid 2014

    Hi all, so what happened is that I forgot my password (the computer's) and I did erase all and came back on the factory reset. All is fine so far, but I am missing a lot of my apps - I sure did chat with apple and they made something so that I can ge

  • Adobe Illustrator CS6 won't open in Mac 10.10 without Java SE 6 Runtime. Where do I get it.

    Adobe Illustrator CS6 won't open in Mac 10.10 without Java SE 6 Runtime. Where do I get it. I went to Jave and downloaded the latest version of Java 8 Update 31 for Mac, but it still won't open.

  • Thread Pool Callback Mechanism

    I am using java.util.concurrent.ExecutorService to create a thread pool. I need a way to inform the user of the progress of the threads in the pool. Does anyone have any ideas of how to do this?

  • Trying to increase the sound of recorded screen captures

    Hi. I'm making screen capture movies with Snapz PRo 2 and they are being saved as QT movies on my desktop. When I open them in QT and try to increase the sound volume, the setting don't stick if I try to raise the volume over 0db. I read somewhere th

  • Quarterly TDS Returns

    Dear Experts, when we are trying to run the transaction code "J1INQEFILE - Quarterly TDS Returns "for quarterly TDS Returns i am not getting any output / display  on the screen. Is there any special customization required before i run that transactio