Please, HELP me. Servlet/JSP

Hi,
I have a servlet that builds an URl to extract the .XLS file fromt he repository. Becoz MS EXCEL is unable to open if there are more than 65000 records, I split the files which are holding over 60,000 records in to two parts. naming them like filenamePart1.XLS and Filenamepart2.XLS.
Now my problem is. How can i check whether my file has more than 60,000 records is there any direct method. I wrote the following program, but is not working fine.
One more problem is ,How can i display these split files?.Again Remember, I used to build the URL and open it using Request dispatcher and forwarding the request. But now I have two files. How can I go about it. Any suggestion or code would be appriciated. Thank you.

Infact I have the same file in .TXT format in the same
folder, So I am checking this from txt file(
filename.txt). It still doesn't work.I belive the
following servlet code explains better.1��. Try to call the method countLines with the full path of your file.(e.g. "C:\\reports\\filename.txt"). Should work.
If you want to count the records of your xls file
take a look at http://jakarta.apache.org/poi/hssf/index.html. Can help you manipulate Excel files from java.
2��. To display the 2 files in your browser (if that's what you want...)
you can respond from your servlet with an html like the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
     function openFiles() {
          window.open('url-of-filenamePart1.XLS ','file1','toolbar=yes,status=yes,scrollbars=yes,location=yes,menubar=yes,directories=yes,width=640,height=480');
          window.open('url-of-filenamePart2.XLS ','file2','toolbar=yes,status=yes,scrollbars=yes,location=yes,menubar=yes,directories=yes,width=640,height=480');
</SCRIPT>
<BODY onLoad="openFiles();">
</BODY>
</HTML>
2 windows for the 2 excel files will be popped up. url-of-filenamePart1.xls and url-of-filenamePart2.xls are the values of the String variables urlPdf1 and urlPdf2 in your code.
Regards
BG

Similar Messages

  • PLEASE HELP - error Jdbc/jsp

    Hello
    I have a jsp file myfile.jsp?id=...
    This file was working fine before. I was ready from my testing and i needed to clean my access database's data so i deleted some records manually and copied database again onto live through ftp.
    After this step, myfile.jsp?id=.. was giving me errors only on certain ids for eg. it worked fine myfile.jsp?id=3, but did not work fine for myfile.jsp?id=6 giving this error:
    The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NullPointerException
         org.apache.jsp.viewprofile_jsp._jspService(viewprofile_jsp.java:320)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    I tried an id which does not exist in database and it worked fine ie. jsp page was executing the html message that i composed for unexisting ids.
    I also checked the records' data and these all look fine and appropriately filled.
    PLEASE HELP - any ideas?
    Thanks lodes
    sabcarina

    You could try adding logging statements or SOPs in the JSP. It would help you locate the line where the exception is occuring.

  • Please help me on jsp problem

    Hi, I have installed tomcat 4.0 at directory d:\, which comes as d:\jakarata-tomcat4.0. i have java_home as c:\jdk1.3 and j2ee_home as c:\j2sdkee1.3.1. upto now i was practising servlets. I use to store my html file in webapps\examples\servlets and .class file in webapps\examples\web-inf\classes. It worked fine. now i started with JSP. I have created an html file which calls jsp file and passes the value of username.the sample code for jsp is<jsp : usebean id = rohit scope = "session">
    </jsp: usebean>
    <% if (request.getParameter("username").equals("rohit") { %>
    <jsp:forward page = "http://localhost/examles/servlets/welcome.html">
    <% } else { %>
    <jsp : include page = "http://localhost/examles/servlets/admin.html">
    <% } %>please tell me where should i place my .jsp file written in notepad so that it gets compiled and upto now i haven't used or ammended web.xml file as it was working fine with servlets.please help me on jsp

    hi rohit
    just keep it in the folder of your project and givr the path in the address and it will run. It will be compiled automatically.
    If there is some other problem do rite in details.
    TArun

  • Please help with servlet and database!!

    Hello,
    i first created a servlet that generated an html page and printed out the parameters of a user's username when they logged in. example, "Welcome user" and it worked fine...
    i inserted a database into my site that validates the username and password, and ever since i did that in dreamweaver, when a user logs in sucessfully, it returns the servlet page like its supposed to, only that it says "Welcome null" instead of "Welcome John." pretty strange, huh!? can anyone please help? thanks!

    Check whether the username textfield name has changed or not. Also print the code over here so that we can check the code.

  • Please help..servlet calling JSP

    I have a servlet that for the time being (cut out all validation code...everything) is just trying to call a JSP. I keep getting The requested URL /servlet/hellos was not found on this server.---I'm running this at my local host, so it is not a path problem. the code is below.--
    Note..when I use getServletContext().getRequestDispatcher("/servlet/log"); this works (calling another servlet) but when the below is executed I get the error.
    package hellos;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class hellos extends HttpServlet {
    public void doGet (HttpServletRequest req, HttpServletResponse res)
         throws ServletException, IOException
              RequestDispatcher dispatcher =
              getServletContext().getRequestDispatcher("/ITS/itsLoginhtml.jsp");
              dispatcher.forward(req, res);

    Ok here is what is going on. I don't want to use redirect I want to use the dispatcher. The code is below and it works with redirect, but not dispatcher???? It says the URL cannot be found on server?????Can anyone help me get the dispatcher to work??
    package hellos;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class hellos extends HttpServlet {
    public void doGet (HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException
              res.sendRedirect("/ITS/itsLoginhtml.jsp");
              //RequestDispatcher dispatcher =
                        //getServletConfig().getServletContext().getRequestDispatcher("/ITS/itsLoginhtml.jsp");
              //dispatcher.forward(req, res);

  • URGENT please help with servlets

    am using Jbuilder 3 and there is no servlet classs to import .imported JSDK and the javax files. but it keeps saying my class does not extend http servlet any ideas!!

    I've used JBuilder3 a few times and as far as I remember the default Target jdk (version 1.2) cannot be changed or ammended and so you can't really import javax.servlet stuff.
    Go to project -> properties.
    You probably just need to define a new jdk version call it "JDK 12 Servlets" or something. It'll prompt you most of the way and then you just need to edit the Class path and add the javax stuff.
    Alternatively you can just save the file with jbuilder and do the compiliation from the command line.
    Hope this helps.

  • Help with Servlet - JSP Newbie

    I'm trying to teach myself jsp. I've created a couple of classes to do my data I/O. I have a form to collect user data and the page the form posts to should write the data to a text file. When I run the form and form handler the data is presented back to the user and everything looks fine... no errors or anything. However, the text file I'm trying to create/append does not get modified. Any suggestions would be greatly appreciated as I can't move on with what I want to do until I figure this out.
    Thanks,
    Steven Lee / EMC
    [email protected]
    I'm running Apache 2.0.52/Tomcat 5.5 on Win 2000. Here's my directory structure:
    C:\Apache\Tomcat 5.5.\webapps\ROOT
    /ROOT
    index.jsp
    OptIn.jsp
    show_email_entry
    /admin
    /WEB-INF -->web.xml
    /classes
    /business -->User.class
    /data -->UserIO.class
    /lib
    ***UserIO.class:***
    package data;
    import java.io.*;
    import business.User;
    public class UserIO{
    public synchronized static void addRecord(User user, String filename)
              throws IOException{
                   PrintWriter out = new PrintWriter(
                        new FileWriter(filename, true));
                   out.println(user.getEmailAddress() + "|"
                        + user.getFirstName() + "|"
                        + user.getLastName() );
                   out.close();
    ***User.class***
    package business;
    public class User {
         private String firstName;
         private String lastName;
         private String emailAddress;
         public User() {}
         public User(String first, String last, String email) {
         firstName = first;
         lastName = last;
         emailAddress = email;
         public void setFirstName(String f) {
              firstName = f;
         public String getFirstName() { return firstName; }
         public void setLirstName(String l) {
              lastName = l;
         public String getLastName() { return lastName; }
         public void setEmailAddress(String e) {
              emailAddress = e;
         public String getEmailAddress() { return emailAddress; }
    ***OptIn.jsp***
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <!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=iso-8859-1">
    <title>Untitled Document</title>
    </head>
    <body>
    <p>Join E- Mail List</p>
    <form action="show_email_entry.jsp" method="get" name="FRMjoinList" id="FRMjoinList">
    <input name="txFN" type="text" id="txFN">
    first name
    <br>
    <input name="txLN" type="text" id="txLN">
    last name <br>
    <input name="txEMAIL" type="text" id="txEMAIL">
    e-mail <br>
    <input type="submit" name="Submit" value="Submit">
    </form>
    <p> </p>
    </body>
    </html>
    ***show_email_entry.jsp***
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    </head>
    <body>
    <%@ page import="business.*, data.*, java.util.Date" %>
    <%
         String firstName = request.getParameter("txFN");
         String lastName = request.getParameter("txLN");
         String emailAddress = request.getParameter("txEMAIL");
         User user = new User(firstName, lastName, emailAddress);
         UserIO.addRecord(user, "UserEmail.txt");
    %>
    <p>Today's Date is <%=new Date() %></p>
    <H2>Thanks for joining our list</H2>
    <p>Here's your information:</p>
    <table width="300" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="92">First Name </td>
    <td width="208"><%=user.getFirstName() %></td>
    </tr>
    <tr>
    <td>Last Name </td>
    <td><%=user.getLastName() %></td>
    </tr>
    <tr>
    <td>E-Mail</td>
    <td><%=user.getEmailAddress() %></td>
    </tr>
    </table>
    <p>Click here to enter another address.</p>
    <form name="form1" method="post" action="optIn.jsp">
    <input type="submit" value="Return">
    </form>
    <p> </p>
    </body>
    </html>

    I just realized that the file is given as just a filename. No path.
    Are you SURE the file isn't being created, just somewhere you don't expect?
    Try putting a full path in there instead of just a filename.

  • Urgent problem.. please help...JSP package..

    hi i have a 2 java classes
    one is using the other as an object... because i am using jsp... i have put the classes in packages.
    but it doesnt seem to get the class object when put in packages, when i remove them seems to work..
    but i need the packages to be there... or is there a way around this? can i use the classes without putting them into packages with tomcat and jsp?
    thanks!
    code below..
    this line normally works without the packages
    Connection conn = DBConnection.getDBConnection();
    package multipleChoice.test;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.sql.DataSource;
    import java.util.logging.*;
    public class DBConnection
         public static Connection getDBConnection() throws SQLException
              Connection conn = null;
              try
                   InitialContext ctx = new InitialContext();
                   DataSource ds = ( DataSource ) ctx.lookup( "java:comp/env/jdbc/MySQLDB" );
                        conn = ds.getConnection();
                   catch ( SQLException sqlEx )
                   System.out.println( "cannot get JDBC connection: " + sqlEx );
    catch ( NamingException nEx )
    nEx.printStackTrace();
    return conn;
    public static void closeConnection(Connection conDB) {
    // Return Connection to the pool
    try {
    conDB.close();
    catch(SQLException se)
    // handle any errors
    // Set object to be ready for garbage collection
    conDB = null;
    } // end closeConnection

    If you're going to crosspost, at least have the courtesy to provide a link back to your original thread. It's easy. Just like this:
    http://forum.java.sun.com/thread.jsp?forum=54&thread=502177&start=0&range=30#2375789

  • Please help me! JSP image upload + TOMCAT

    hello i hope someone hear me,
    my problem is after i upload an image in my application.
    i upload successfully because it to the "res" directory, i see it is there but
    i can not display it until i restart the server.
    <img src="resim/<%=ddbresim%>" width="180" height="120" border="1" align="right" />
    any suggestions?

    If that snippet is correct, I am more surprised that you can see the image after the restart. You say it should go in a 'res' subdirectory, yet you refer to a 'resim' directory in the snippet.

  • JSP Connection Pooling Please Help

    Hi,
    I have a bean that I want to use for connection pooling with my JSP's. Its constructor creates the pool of connections and I have a getConnection method which retrieves available ones.
    My problem is that I create a new instance of the bean on each jsp page I am using. So that means when I go to my next web page and want to grab a connection I recreate an instance of the bean and therefore am creating another pool all over again.
    How do I get around this. When I first create an instance of the bean from a .jsp should I make the scope of that bean equal session. That way will I be able to use the same instance throughout the whole site.
    Please help
    Thanks
    Natasha

    Hi,
    <jsp:useBean> first tries to locate in the scope specified for the bean.If it doesn't find any, then it will instantiates the bean.
    Set the beans scope as "application" which means the same bean is available throughout the application.
    Hope this helps.
    With Regards
    Gayam_Slash

  • It makes me crasy, please help!

    I just tried to pass a param to jsp page, I even hardcoded it. but in jsp, it always show null value. It drives me crasy, what is wrong? someone please help!
    SERVLET:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    public class SimpleServlet extends HttpServlet
      private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
      public void init(ServletConfig config) throws ServletException
        super.init(config);
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
        response.sendRedirect("simple.jsp?id=1234567");
    }JSP:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>untitled</title>
      </head>
      <body>
      <h2>The information of id is:<%=request.getParameter("id")%></h2>
      </body>
    </html>

    The code works on my system using the redirect so I suspect it is something else. Put some debug system out statments to make sure you are actually running the code that you think you are.

  • Please help me! Error setting property 'out' in bean of type null

    I got this "nice" exception 2 days ago, but I realy can't find the problem.
    As you can see next all beans have setters/getters and are initializated.
    Please help me:
    index.jsp:
    f:view>
    <h:dataTable value="#{DataBaseReaderBean.todayArticles}" var="articleBean">
    <h:column>
    <h:outputText binding="#{articleBean.out}"/>
    </h:column>
    </h:dataTable>
    </f:view>
    <faces-config>
    <component>
    <component-type>articleComponentType</component-type>
    <component-class>news.UiArticle</component-class>
    </component>
    <managed-bean>
    <description>
    Reads articles from database
    </description>
    <managed-bean-name>DataBaseReaderBean</managed-bean-name>
    <managed-bean-class>news.DataBaseReaderBean</managed-bean-class>
    <managed-bean-scope>application</managed-bean-scope>
    <managed-property>
    <property-name>todayArticles</property-name>
    <property-class>java.util.ArrayList</property-class>
    <value>#{todayArticles}</value>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <managed-bean-name>ArticleBean</managed-bean-name>
    <managed-bean-class>news.ArticleBean</managed-bean-class>
    <managed-bean-scope>none</managed-bean-scope>
    <managed-property>
    <property-name>out</property-name>
    <property-class>javax.faces.component.html.HtmlOutputText</property-class>
    <value>#{out}</value>
    </managed-property>
    </managed-bean>
    <lifecycle/>
    <application>
    <locale-config/>
    </application>
    <factory/>
    </faces-config>
    public class DataBaseReaderBean implements Serializable{
    private ArrayList todayArticles=new ArrayList();
    public DataBaseReaderBean() {
    todayArticles.add(new ArticleBean(new Article("First news","this is my first news","articlesimage/1.jpg","First img"),new Boolean(true)));
    todayArticles.add(new ArticleBean(new Article("Second news","this is my second news","articlesimages/2.jpg","Second img"),new Boolean(true)));
    todayArticles.add(new ArticleBean(new Article("Third news","this is my third news","articlesimages/3.jpg","Third img"),new Boolean(false)));
    todayArticles.add(new ArticleBean(new Article("Last news","this is my last news","articlesimages/4.jpg","Last img"),new Boolean(false)));
    public ArrayList getTodayArticles() {
    return todayArticles;
    public void setTodayArticles(ArrayList todayArticles) {
    this.todayArticles = todayArticles;
    public class ArticleBean implements Serializable {
    private Boolean collapsed;
    private news.UiArticle myUIArticle;
    private Article article;
    private HtmlOutputText out;
    public void setOut(HtmlOutputText out) {
    this.out = out;
    public HtmlOutputText getOut() {
    out.setValue("myText");
    return out;
    public ArticleBean() {
    out=new HtmlOutputText();
    }

    hi frank,
    I cross checked, all the entries in the bean, with those in the JSPX source code, and chceked in the auto comment of the JSPX page the name of the bean, i have checked the faces config, i am going to remove the the new models and re-add them, just tell me if i need to add any files other than those:
    MODEL X folder, which contains the model
    JSPX folder, which contans the pages
    SRC folder in view controller
    And the faces config to web-inf
    thanks in advance man
    regards
    Halim

  • PDF File not getting generated - PLEASE HELP

    I have a jsp in a portlet from where in I call another jsp to generate a PDF file on the fly. IT is not working I have tried all sorts of stream please help.
    Calling JSP (Portlet)
    <tr>
    <td><netui:anchor href="print.jsp" target="new">Print
    </netui:anchor>
    </td>
    Called JSP, print.jsp:
    try {
    ServletOutputStream outStream = (ServletOutputStream)response.getOutputStream();
    outStream.write("BINARY OUTPUT".getBytes());
    outStream.println("PRINTLN OUTPUT--"+request.getParameter("empID"));
    outStream.flush();
    outStream.close();
    } catch {}
    As you can see I am just trying to Write some string in the print.jsp
    The word opens up but nothing is WRITTEN in it. Have tried all the OutputStreams. Please help why is it not getting printed even if set proper headers.

    There are some issues with this PDF file.  It's not tagged but even still it has some real problems.  I checked the file to see what created it and it was something called "Wine Postscript Driver" and the PDF Producer was "GPL GhostScript 9.10"  When you check the file in Preflight then you will begin to understand that this is a poorly created PDF file.  Here is a bit of the PDF Syntax report:

  • Please help .. OutOfMemoryError   ServletException

    Hi All,
    I don't know why I am getting this exception while working with strings, I am just trying to compare two or more Strings, I did not use not StringBuff !!! ??
    Please help
    javax.servlet.ServletException:
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:485)
         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.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:2343)
         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.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.warp.WarpRequestHandler.handle(WarpRequestHandler.java:217)
         at org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java:194)
         at java.lang.Thread.run(Thread.java:484)
    root cause
    java.lang.OutOfMemoryError:
         at java.io.BufferedReader.(BufferedReader.java:83)
         at java.io.BufferedReader.(BufferedReader.java:94)
         at org.apache.jasper.compiler.ServletWriter.printMultiLn(ServletWriter.java:210)
         at org.apache.jasper.compiler.ScriptletGenerator.generate(ScriptletGenerator.java:85)
         at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:834)
         at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:241)
         at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:197)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:215)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
         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.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:2343)
         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.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.warp.WarpRequestHandler.handle(WarpRequestHandler.java:217)
         at org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java:194)
         at java.lang.Thread.run(Thread.java:484)

    thank you :)
    here is the piece of code where the error occures
    <%
    Vector Items = new Vector();
    Vector ItemsMatch = new Vector();
    String SearchText = "What ever";
    String ItemInfo = "";
    DbConnect temp;
    try{
    SearchText = SearchText.toLowerCase();
    creatConnection = godb.creatConn();
    Items = godb.selectViewedItems("items",1);
    creatConnection =creatConnection + godb.closeConn();
    }catch(Exception e){ out.println(e.toString()); }
    try{
                   for(j=0;j< Items.size();j++)
                   temp =(DbConnect)Items.elementAt(j);
                   ItemInfo = temp.getName().toLowerCase() + " "+temp.getDesc().toLowerCase()+" "+temp.getDimensions().toLowerCase()+" "+temp.getReference().toLowerCase()+" "+temp.getFound().toLowerCase()+" "+temp.getCondition().toLowerCase();
    if(ItemInfo.indexOf(SearchText)!=-1)
                   ItemsMatch.add(temp);
    }catch(Exception e){ out.println(e.toString()); }
    %>

  • PLEASE HELP!!! using servlet to generate an image in jsp page

    Hi,
    I am so stuck on this... please help.
    I have a servlet that generated a gif image dynamically. It uses a bean that stores the gif image in a byte array.
    The servlet outputs the byte data to the output stream. The code is really simple and looks like this:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            //HttpSession session = request.getSession();
            try {
                ServletOutputStream stream = response.getOutputStream();
                ImageByteInformation imageByteInfo = (ImageByteInformation) request.getAttribute("imageByteInformation");
                response.setContentType("image/gif");
                response.setContentLength(imageByteInfo.getByteData().length);
                stream.write(imageByteInfo.getByteData(), 0, imageByteInfo.getByteData().length);
                stream.flush();
            }catch( Exception e){   
                System.out.println("You are hooped!: " + e.getMessage() + " " + e.toString());           
            }When I redirect from the dispatch servlet straight to this servlet an image shows up in the browser window.
    However when I try to use this jsp page to display the image nothing happens...
    <%@page contentType="text/html" 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>
            <h2>Hello World!</h2>
            <img src="servlets/Map24ImageDisplayServlet"/>
             //I also tried src/servlets/Map24..., /src/servlets/Map24..., /display, servlets/display
            <h2>Did you see the image?</h2>
        </body>
    </html>My web.xml is here if it helps...
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      <display-name>HelloProject</display-name>
    <servlet>
        <display-name>ServletDispatcher</display-name>
        <servlet-name>ServletDispatcher</servlet-name>
        <servlet-class>servlets.ServletDispatcher</servlet-class>
      </servlet>
      <servlet>
        <display-name>Map24ImageDisplayServlet</display-name>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <servlet-class>servlets.Map24ImageDisplayServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>ServletDispatcher</servlet-name>
        <url-pattern>/hello</url-pattern>
      </servlet-mapping>
      <error-page>
        <error-code>404</error-code>
        <location>/404_error.html</location>
      </error-page>
      <servlet-mapping>
        <servlet-name>Map24ImageDisplayServlet</servlet-name>
        <url-pattern>/display</url-pattern>
      </servlet-mapping>
    </web-app>I can never get an image to come up. In fact I can never get the jsp page to run the servlet at all! HELP!!! What am I doing wrong?
    Thanks
    Edited by: Kind_of_Green on May 5, 2008 3:55 PM
    Edited by: Kind_of_Green on May 5, 2008 4:00 PM

    OK... so you WERE absolutely right about the src path for the image tag.
    However I also had another problem that was quite a bit more insidious and mostly just a symptom
    of how little I know about what goes on under the hood of a web app.
    My bean storing the image info was stored as a request attribute. When the servlet was called from the
    jsp page the request object was either reset or just never initialized. Anyway it is not the same request
    object I assumed it was being passed in the doGet method. I added my bean as a session
    attribute and everything is sparkly :)
    I can only assume that when a request is neither forwarded nor included (as is the case with
    calling the servlet from the img tag) it is disappeared.
    Anyway, thanks a mint man. I so totally appreciate your time.
    Ciao :)

  • JSP - Servlet - Please help

    Hi:
    Can any one suggest me the code for the following scenerio, Am new to jsp-Servlet....
    I need to give an EMPNAME in a Textbox on clicking GO button from my JSP page, a servlet must process thei query and display the output of that employee details back to that JSP page..
    Please help me out with some code snippets...
    Regards,

    The sun's site provides a detailed introduction to JDBC. or
    have to google for JDBC and once you've understood the JDBC concept, then you could progress from there. There is no simple way of doing what you asked.
    You will need a database, though you could use MS Access. But you still need the JDBC.

Maybe you are looking for

  • GR IR Clearing account posting to wrong profit center

    Dear All, Here I am encountering the live problem that , After the some customization changes , there was an impact on GR/IR Clearing account with regards to the profit center posting When we receive (GR) , the FI document line item is posting to the

  • Schedule line, delivered quantity disappeared

    We have a sales order with four line items. All are the same material, except the quantities and prices are different. On several of these positions we have had (partial) deliveries. When we check the schedule lines we can clearly see which quantity

  • Error while updating lookup table through PSI

    Hi, I am trying to update a lookuptable through PSI using following code :  $lookupTableGuid = $svcPSProxy.ReadLookupTables($EPMTYString, 0 , 1033).LookupTables | where {$_.LT_NAME -eq $Lookuptablename} $lookuptable = $svcPSProxy.ReadLookupTablesbyUi

  • AUDIO SAMPLES FROM IOMEGA 100 ZIP DRIVE TO MAC BOOK PRO / LOGIC?

    Posted: Fri, Feb 15 2013, 1:27pm    Post subject: AUDIO SAMPLES FROM ZIP 100 TO MACBOOK PRO / LOGIC? HI THERE I HAVE LOADS OF OLD AUDIO SAMPLES ON ZIP DISKS ( ZIP 100 using akai cd3000 sampler ) THAT I WOULD LIKE TO TRANSFER TO MY MAC BOOK PRO FOR LO

  • ICloud email same on 2 different iPad mini devices

    I was setting up 2 different iPad minis at the same time with 2 different iCloud emails.  The problem is that both the devices now have my daughter's iCloud email as the default mail.  How do I get my son's iPad mini to have his iCloud email as defau