Importing packages in JSP

Hi everybody !
I am trying to get a JSP page to access some java files I have placed in a package, by using the import statement at the top of the JSP page, i.e. <%@page import="x.y.z.*"%>
So far so good, everything compiles and looks good, but when I try to run the JSP page in the browser, I'm told that the package 'x.y.z' does not exist, and that the classes can not be understood.
The JSP server is running fine, I'm using Resin, and have set it up to use the directory where my JSP files is stored, so that should be OK !!
Is there anybody who can help me out, it may have something to do with the mounting points in netbeans, but I don't have a clue---!!??
Sincerely T.

Hi,
My only suggestion is temporarily add these files to your classpath, or copy them to a place where you have the classpath already set. If this doesn't work, then I'm not sure.
best,
kev

Similar Messages

  • Importing packages in JSP using iPlanet problem

    hi experts,
    i am new begi to iPlanet server6.0
    i have installed iPlanet6.0 in windowsNT(d:\iPlanet\servers)
    document root is d:\iPlanet\servers\Docs
    i have one jsp called test.jsp in document root dir.
    i imported one package called adminBeans in jsp file.
    i put adminBeans class folder in
    d:\iPlanet\servers\Docs\WEB-INF\classes
    whrn i am ruuning this jsp error shows as below
    ============================
    [04/Jul/2002:11:15:01] info ( 347): JSP: JSP1x compiler threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSPd:\iPlanet\Servers\https-ntserver.vsnl\config\..\ClassCache\_jsps\_test_jsp.java:15: Package adminBeans not found in import.
    import adminBeans.*;
    ^
    1 error
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
         at com.iplanet.server.http.servlet.NSServletEntity.load NSServletEntity.java:252)
         at com.iplanet.server.http.servlet.NSServletEntity.update(NSServletEntity.java:173)
         at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:416)
    =====================================================
    do i want to set any configuration for jsp running?.
    without any import,like helloworld.jsp file is working fine.
    any idea
    plz help me ya.
    thanks in adv.
    endrum anpudan
    maruthu

    hi,
    first of all u understand the way package works
    suppose u have package named mybeans and there r classes under this folder for e.g myBeans/AdminBean and many more so ur definetly going to import the classes in this way import myBeans.*; for all classes or import myBeans.AdminBean; for single class but before doin that make sure that u have set that package path in ur environment. how will u do that ? register the path just above one folder to myBeans for e.g
    D:\myClasses in the evironment and ur myBeans folder wil reside under D:\myClasses\myBeans

  • Import packages in JSP

    All my files are in C:\tomcat-4.1.24\webapps\ROOT\security, and I have a test.jsp in that same directory together with my package xmlHandler (in a folder xmlHandler) which contains DOMUtil.class ...
    It seems that I have a problem with this line in my jsp file ...
    <%@ page import = "xmlHandler.DOMUtil"%>
    Tomcat keeys saying this error ...
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac] /usr/local/tomcat4/work/Standalone/localhost/_/security/test_jsp.java:7: package xmlHandler does not exist
    [javac] import xmlHandler.DOMUtil;
    [javac] ^
    [javac] 1 error
    What's wrong ? I just have problem with this line only ... =(

    <%@ page import = "javax.xml.parsers.*"%>
    <%@ page import = "org.jdom.*"%>
    <%@ page import = "java.io.IOException"%>
    <%@ page import = "org.jdom.JDOMException"%>
    <%@ page import = "org.jdom.input.DOMBuilder"%>
    <%@ page import = "org.jdom.output.XMLOutputter "%>
    <%@ page import = "org.xml.sax.InputSource"%>
    <%@ page import = "org.apache.xerces.parsers.DOMParser"%>
    <%@ page import = "xmlPublisher.ws3"%>
    <html>
    <body>
    <%
    String xmlFile = request.getParameter("xmlFile");
    String formDate = request.getParameter("formDate");
    String formRisk = request.getParameter("formRisk");
    String formDesc = request.getParameter("formDesc");
    String xmlFileDir = "c:/localhost/security/" + xmlFile;
    org.w3c.dom.Document domDoc = null;
    DOMParser parser = new DOMParser();
    try{
         parser.parse(new InputSource(xmlFile));
         domDoc = parser.getDocument();
    catch(Exception e){
         e.printStackTrace();
    try{
         DOMBuilder builder = new DOMBuilder();
         org.jdom.Document jdomDoc = builder.build(domDoc);
         XMLOutputter outputter = new XMLOutputter();
         outputter.output(jdomDoc, System.out);
    catch ( java.io.IOException e){
         e.printStackTrace();
    %>
    <h1>xmlFile is <%out.println(xmlFile);%></h1>
    <h1>formDate is <%out.println(formDate);%></h1>
    <h1>formRisk is <%out.println(formRisk);%></h1>
    <h1>formDesc is <%out.println(formDesc);%></h1>
    <h1>xmlFileDir is <%out.println(xmlFileDir);%></h1>
    </body>
    </html>

  • Import Java package in JSP

    I hope this is an appropriate forum for this query.
    I want to be able to access a user-created Java package in JSP.
    I have this code:
    <%@page import="TPClass.*" %>
    <%
    xxx = TPClass
    session.setAttribute("response",xxx.GetTPResponse());
    %>
    The error display points to TPClass in the import statement with the message "TPClass not found".
    TPClass files are in the same location as the other project files.
    I have creatyed and compiled the TPClass package.
    Is there more I need to do?
    Brenton

    I think you are very new to java....
    anyway
    <%@page import="class name with full qualified package name"%>
    like
    <%@page import="com.x1.x2.TPClass"%>
    <%
    TPClass cls =new TPClass();
    //then do whatever you want...
    %>
    hope u understand now.....

  • Problem in import ejb package in jsp

    Hi friends
    I am doing one small project with Eclipse Europa,jsp , EJB. with XDoclet, weblogic server
    I first created all my jsp files as one project.Then i created one enterprise application project with XDocklet , after that i imported all the jsp files using import option in eclipse.
    at development time i am not getting any problem.after deployment when i try to run the jsp files i am getting error of
    Compilation of 'C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java' failed:
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:20: package order.headsess does not exist
    probably occurred due to an error in /jspPages/testing.jsp line 8:
    <%@page import = "order.headsess.*" %>
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:51: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 21:
    HeadHome home = null;
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:52: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 22:
    Head remote =null;
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:226: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 96:
    home =HeadUtil.getHome(env);
    Full compiler error(s):
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:20: package order.headsess does not exist
    import order.headsess.*; //[ /jspPages/testing.jsp; Line: 8]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:51: cannot resolve symbol
    symbol : class HeadHome
    location: class jsp_servlet._jsppages.__testing
    HeadHome home = null; //[ /jspPages/testing.jsp; Line: 21]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:52: cannot resolve symbol
    symbol : class Head
    location: class jsp_servlet._jsppages.__testing
    Head remote =null; //[ /jspPages/testing.jsp; Line: 22]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:226: cannot resolve symbol
    symbol : variable HeadUtil
    location: class jsp_servlet._jsppages.__testing
    home =HeadUtil.getHome(env); //[ /jspPages/testing.jsp; Line: 96]
    ^
    4 errors
    Fri Oct 26 01:40:14 GMT+08:00 2007

    Hi friends
    I am doing one small project with Eclipse Europa,jsp , EJB. with XDoclet, weblogic server
    I first created all my jsp files as one project.Then i created one enterprise application project with XDocklet , after that i imported all the jsp files using import option in eclipse.
    at development time i am not getting any problem.after deployment when i try to run the jsp files i am getting error of
    Compilation of 'C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java' failed:
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:20: package order.headsess does not exist
    probably occurred due to an error in /jspPages/testing.jsp line 8:
    <%@page import = "order.headsess.*" %>
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:51: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 21:
    HeadHome home = null;
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:52: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 22:
    Head remote =null;
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:226: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 96:
    home =HeadUtil.getHome(env);
    Full compiler error(s):
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:20: package order.headsess does not exist
    import order.headsess.*; //[ /jspPages/testing.jsp; Line: 8]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:51: cannot resolve symbol
    symbol : class HeadHome
    location: class jsp_servlet._jsppages.__testing
    HeadHome home = null; //[ /jspPages/testing.jsp; Line: 21]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:52: cannot resolve symbol
    symbol : class Head
    location: class jsp_servlet._jsppages.__testing
    Head remote =null; //[ /jspPages/testing.jsp; Line: 22]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:226: cannot resolve symbol
    symbol : variable HeadUtil
    location: class jsp_servlet._jsppages.__testing
    home =HeadUtil.getHome(env); //[ /jspPages/testing.jsp; Line: 96]
    ^
    4 errors
    Fri Oct 26 01:40:14 GMT+08:00 2007

  • How to import a package in jsp

    i've searching here and i've not found answer to this, so i write it here.
    i've created a class to send mail, it imports the javax.mail.* and javax.activation.*, in a package named jspbeans.
    now, when i try to use this package in my jsp page (using tomcat), gives me the error:
    Package jspbeans not found in import
    import jspbeans.*;
    the code for my jsp page is:
    <%@ page language="java" %>
    <html>
    <head>
    <title>Sending mail from JSP</title>
    </head>
    <body>
    <%@ page import="jspbeans.*"%>
    <jsp:usebean id="sendmail" class="jspbeans.SendMail" scope="page"/>
    <jsp:setProperty name="sendmail" property="host" value="mail.wavelinksystems.com"/>
    <jsp:setProperty name="sendmail" property="to" value="[email protected]"/>
    <jsp:setProperty name="sendmail" property="from" value="[email protected]"/>
    <jsp:setProperty name="sendmail" property="msg" value="testing 1 2 3..."/>
    <jsp:setProperty name="sendmail" property="subject" value="test"/>
    <%//sendmail.send();%>
    <p>
    Mail has been sent to <jsp:getProperty name="sendmail" property="to"/>
    </body>
    </html>and the path of this jsp page is:
    C:\WINDOWS\Desktop\tomcat\jakarta-tomcat-3.3.1\webapps\ROOT\pruebas\jspMailTest.jsp
    the path for the package is:
    C:\WINDOWS\Desktop\tomcat\jakarta-tomcat-3.3.1\webapps\ROOT\pruebas\jspbeans
    what am i doing wrong?
    what am i missing?
    how do i have to import the package?
    thanks

    it generates a
    java.lang.NoClassDefFoundError: javax/mail/MessagingException
    i changed the package to that directory and the import generates no errors, if i do nothing but the import, and soem printing, the page is generated, but when i try to assign the variables, generates that error, why is it?

  • Import package with .* in jsp

    If i want to use HashMap in jsp page i need to have HashMap of util package in import statment in
    page directive.
    What is difference in Using
    a) <%@ page import="java.util.HashMap"%>
    b) <%@ page import="java.util.*"%>
    Is there any performance issue using importing package with .*

    Ofcourse there will be a performance issue. In the
    second case (<%@ page import="java.util.*"%>
    ) , you are loading all the classes in java.util
    package into your JSP, where as in the first case you
    are getting only HashMap. So the second option will
    affect the performance. Always import only the
    required classes.
    rgdsThen you have no idea how import works. The only difference at all would come at compile time. After the page is compiled, there would be no performance issue whatsoever.
    The main reason for doing one or the other way (same for any Java class) is clarity for those reading the code. Meaning if you use the full import, when they see "HashMap" in the code, they can look at the import statements and be sure that it's in java.util package. But generally, most people are going to be familiar with the classes in the common packages, like java.util. So I wouldn't generally list the specific classes if you are using more then one from the same package. There are other considerations where packages have classes of the same name (java.sql.Date & java.util.Date) but generally, I would always just put the full class name in the code.

  • What to import in the JSP file??

    I want to use jsp and xsl to convert xml to html in order to display the file. But I come across a problem, I don't what should be import into the jsp file. Should I import these? <%@ page import="org.xml.sax.*" %>
    <%@ page import="org.apache.xalan.xslt.*" %>
    Since I'm not very good at this field, can anybody give me some suggestion to hlep me to work it out?
    thanks~

    One thing is sure. Whatever the classes you are going to use, need to be imported in your Jsp.
    There is no need for different import statements. You can write in a single import statement (comma separated).
    So, forget about the import statements and do your coding, finally you can look at the code and decide what classes (packages) you need to import.
    I think you need to import
    org.xml.sax.*;
    org.xml.sax.helpers.*;
    import javax.xml.parsers.*;
    Hope this helps.

  • Is it possible to send the packae name inside a import as a jsp expression

    Hi,
    I am using jsp pages
    <% @ page import="package names"%>
    How i can pass the package names as a jsp expressions
    Regards,
    ahamad

    I am doing templates.I am forwarding the request
    from other pages to the same page.At that case i
    neeed to change the value which is in import
    attribute.
    Is it possible to avoid hard-coded value inside a
    import attribute.Only by preprocessing the sources. But why would you need to change just an import statement? Wouldn't you have to replace all class references as well?

  • Having problems compiling *.java with import javax.servlet.jsp......

    I've been trying to do the tutorials in a book titled Apache Jakarta-Tomcat as part of my introduction to JSP. I'm new to Java but do know the basics. I have on my machine Java 1.3, Java 1.4, Java FrameWorks 2.1 and Jython 2.1 on Win2000 Pro. So enough about my configuration. I have never worked with packages also.
    I downloaded the files from the books site due to the fact I make a lot of typos when hand coding Java (I've become a pretty good debugger of my own code). But everytime I go to compile the *.java I get error messages. So below you will find HelloTag.java and beneath that the error messages that are thrown when I try and compile it. I tested other bits of *.java and have had no problem compiling them. Is there a JSP module I'm missing?
    Am I doing something wrong or am I missing something from my configuration.
    Marijan Madunic
    package chapter2;
    import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.JspTagException;
    import javax.servlet.jsp.tagext.TagSupport;
    public class HelloTag extends TagSupport
    public void HelloTag() {
    // Method called when the closing hello tag is encountered
    public int doEndTag() throws JspException {
    try {
    // We use the pageContext to get a Writer
    // We then print the text string Hello
    pageContext.getOut().print("Hello");
    catch (Exception e) {
    throw new JspTagException(e.getMessage());
    // We want to return SKIP_BODY because this Tag does not support
    // a Tag Body
    return SKIP_BODY;
    public void release() {
    // Call the parent's release to release any resources
    // used by the parent tag.
    // This is just good practice for when you start creating
    // hierarchies of tags.
    super.release();
    D:\Java\JDK 1.3\bin>javac HelloTag.java
    HelloTag.java:3: cannot resolve symbol
    symbol : class JspException
    location: package jsp
    import javax.servlet.jsp.JspException;
    ^
    HelloTag.java:4: cannot resolve symbol
    symbol : class JspTagException
    location: package jsp
    import javax.servlet.jsp.JspTagException;
    ^
    HelloTag.java:5: cannot resolve symbol
    symbol : class TagSupport
    location: package tagext
    import javax.servlet.jsp.tagext.TagSupport;
    ^
    HelloTag.java:7: cannot resolve symbol
    symbol : class TagSupport
    location: class chapter2.HelloTag
    public class HelloTag extends TagSupport
    ^
    HelloTag.java:14: cannot resolve symbol
    symbol : class JspException
    location: class chapter2.HelloTag
    public int doEndTag() throws JspException {
    ^
    HelloTag.java:20: cannot resolve symbol
    symbol : variable pageContext
    location: class chapter2.HelloTag
    pageContext.getOut().print("Hello");
    ^
    HelloTag.java:24: cannot resolve symbol
    symbol : class JspTagException
    location: class chapter2.HelloTag
    throw new JspTagException(e.getMessage());
    ^
    HelloTag.java:28: cannot resolve symbol
    symbol : variable SKIP_BODY
    location: class chapter2.HelloTag
    return SKIP_BODY;
    ^
    HelloTag.java:37: cannot resolve symbol
    symbol : variable super
    location: class chapter2.HelloTag
    super.release();
    ^
    9 errors

    Well, it looks like you've not got the servlet development kit JAR on your classpath. I think it'll probably be called servlet.jar on your system. Add that to the classpath if it's not already there.
    Incidentally, you've bumped into one of the areas Java's slightly lenient - declaring a method that looks like a constructor:
    public HelloTag() { }
    public void HelloTag() { }The first is a constructor, the second is a normal method. I'm assuming you intended to have the former instead of the latter.
    Anyway, hope this helps.

  • Import Package problems and error in the Java file created in runtime

    got the following error message when i try to load the JSP file given below (FlightSearch.jsp). Given also below the JAVA files (flightsearch$jsp.java) created by the compiler.
    Thanks for your help
    Susan
    Error message
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    C:\jakarta-tomcat\work\client\localhost\client\client\flightsearch$jsp.java:320: 'catch' without 'try'.
    } catch (Throwable t) {
    ^
    C:\jakarta-tomcat\work\client\localhost\client\client\flightsearch$jsp.java:328: 'try' without 'catch' or 'finally'.
    ^
    C:\jakarta-tomcat\work\client\localhost\client\client\flightsearch$jsp.java:328: '}' expected.
    ^
    3 errors, 1 warning
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
    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:536)
    FlightSearch.jsp
    <%@page import="java.util.*" errorPage="ErrorHandler.jsp"%>
    <%@page import="com.client.entity.Flight"%>
    <%@page import="com.client.wsclient.FlightServiceClient"%>
    <H3>Available Flight List</H3>
    <br>We have found the following Available flight(s) : </br>
    <table border="0" cellpadding="0" cellspacing="0" width="100">
    <tr>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Flight Company</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Flight Number</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Depart From<font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Arrive</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Departure Date</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Departure Time</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Arrival Date</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Arrival Time</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Adult Fare</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Child Fare</font></b></td>
    </tr>
    <%
    //Get the search information
    String des = request.getParameter("DFrom");
    String arr = request.getParameter("DTo");
    String fy = request.getParameter(FYear.value);
    String fm = request.getParameter(FMonth.value);
    String fd = request.getParameter(FDay.value);
    String f1 = fy + "-" + fm;
    String FDat = f1 + "-" + fd;
    String ty = request.getParameter(TYear.value);
    String tm = request.getParameter(TMonth.value);
    String td = request.getParameter(TDay.value);
    String t1 = ty + "-" + tm;
    String TDat = t1 + "-" + td;
    String type;
    if( request.getParameter(type[0].checked))
    type = "Return";
    else
    { type = "OneWay";
    String clas;
    if(request.getParameter(clas[0].checked))
    {clas = "ECO";
    else
    {clas = "BUSS";}
    String adult = request.getParameter(Adult.value);
    String child = request.getParameter(Child.value);
    //Get the server Flight Search Service URL
    // ServerFlightSearchBO SFSBO = new ServerFlightSearchBO();
    // ServerFlightSearch FlightSearch = SFSBO.getFlightSearchURL();
    // FlightSearchServiceClient FSearchServiceClient = new FlightSearchServiceClient
    String ServerFlightServiceURL = "http://localhost:7080/AServer/services/FlightService";
    //Find available Flight
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(des, arr, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    %>
    <tr>
    <td width= "10%"><%=flt.getFlightComp()%></td>
    <td width= "10%"><%=flt.getFlightNum()%></td>
    <td width= "10%"><%=flt.getDestination()%></td>
    <td width= "10%"><%=flt.getArrive()%></td>
    <td width= "10%"><%=flt.getFrDate()%></td>
    <td width= "10%"><%=flt.getFlightDptTm()%></td>
    <td width= "10%"><%=flt.getToDate()%></td>
    <td width= "10%"><%=flt.getFlightArrTm()%></td>
    <%
    int adt, chld;
    int far_A, tot_A, far_C, tot_C;
    adt = Integer.parseInt(adult);
    far_A = flt.getAdultFr();
    tot_A = adt * far_A;
    chld = Integer.parseInt(child);
    far_C = flt.getChildFr();
    tot_C = chld * far_C;
    %>
    <td width= "10%"><%=tot_A%></td>
    <td width= "10%"><%=tot_C%></td>
    </tr>
    <%
    if(type = "Return")
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(arr, des, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    %>
    <tr>
    <td width= "10%"><%=flt.getFlightComp()%></td>
    <td width= "10%"><%=flt.getFlightNum()%></td>
    <td width= "10%"><%=flt.getFlightDpt()%></td>
    <td width= "10%"><%=flt.getFlightArr()%></td>
    <td width= "10%"><%=flt.getFlightDptDt()%></td>
    <td width= "10%"><%=flt.getFlightDptTm()%></td>
    <td width= "10%"><%=flt.getFlightArrDt()%></td>
    <td width= "10%"><%=flt.getFlightArrTm()%></td>
    <%
    int adlt, chd;
    int fare_A, totA, fare_C, totC;
    adlt = Integer.parseInt(adult);
    fare_A = flt.getAdultFr();
    totA = adlt * fare_A;
    chd = Integer.parseInt(child);
    fare_C = flt.getChildFr();
    totC = chd * fare_C;
    %>
    <td width= "10%"><%=totA%></td>
    <td width= "10%"><%=totC%></td>
    </tr>
    <%
    %>
    </table>
    flightsearch$jsp.java
    package org.apache.jsp;
    import java.util.*;
    import com.client.entity.Flight;
    import com.client.wsclient.FlightServiceClient;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import org.apache.jasper.runtime.*;
    public class flightsearch$jsp extends HttpJspBase {
    static {
    public flightsearch$jsp( ) {
    private static boolean jspxinited = false;
    public final void jspxinit() throws org.apache.jasper.runtime.JspException {
    public void _jspService(HttpServletRequest request, HttpServletResponse response)
    throws java.io.IOException, ServletException {
    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    String _value = null;
    try {
    if (_jspx_inited == false) {
    synchronized (this) {
    if (_jspx_inited == false) {
    jspxinit();
    jspxinited = true;
    _jspxFactory = JspFactory.getDefaultFactory();
    response.setContentType("text/html;ISO-8859-1");
    pageContext = _jspxFactory.getPageContext(this, request, response,
    "ErrorHandler.jsp", true, 8192, true);
    application = pageContext.getServletContext();
    config = pageContext.getServletConfig();
    session = pageContext.getSession();
    out = pageContext.getOut();
    // HTML // begin [file="/client/flightsearch.jsp";from=(0,59);to=(1,0)]
    out.write("\r\n");
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(1,43);to=(2,0)]
    out.write("\r\n");
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(2,58);to=(19,0)]
    out.write("\r\n\r\n<H3>Available Flight List</H3>\r\n<br>We have found the following Available flight(s) : </br>\r\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100\">\r\n <tr>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Flight Company</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Flight Number</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Depart From<font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Arrive</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Departure Date</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Departure Time</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Arrival Date</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Arrival Time</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Adult Fare</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Child Fare</font></b></td>\r\n </tr>\r\n");
    // end
    // begin [file="/client/flightsearch.jsp";from=(19,2);to=(66,0)]
    //Get the search information
    String des = request.getParameter("DFrom");
    String arr = request.getParameter("DTo");
    String fy = request.getParameter(FYear.value);
    String fm = request.getParameter(FMonth.value);
    String fd = request.getParameter(FDay.value);
    String f1 = fy + "-" + fm;
    String FDat = f1 + "-" + fd;
    String ty = request.getParameter(TYear.value);
    String tm = request.getParameter(TMonth.value);
    String td = request.getParameter(TDay.value);
    String t1 = ty + "-" + tm;
    String TDat = t1 + "-" + td;
    String type;
    if( request.getParameter(type[0].checked))
    type = "Return";
    else
    { type = "OneWay";
    String clas;
    if(request.getParameter(clas[0].checked))
    {clas = "ECO";
    else
    {clas = "BUSS";}
    String adult = request.getParameter(Adult.value);
    String child = request.getParameter(Child.value);
    //Get the server Flight Search Service URL
    // ServerFlightSearchBO SFSBO = new ServerFlightSearchBO();
    // ServerFlightSearch FlightSearch = SFSBO.getFlightSearchURL();
    // FlightSearchServiceClient FSearchServiceClient = new FlightSearchServiceClient
    String ServerFlightServiceURL = "http://localhost:7080/AServer/services/FlightService";
    //Find available Flight
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(des, arr, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(66,2);to=(68,18)]
    out.write("\r\n<tr>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(68,21);to=(68,40)]
    out.print(flt.getFlightComp());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(68,42);to=(69,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(69,21);to=(69,39)]
    out.print(flt.getFlightNum());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(69,41);to=(70,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(70,21);to=(70,41)]
    out.print(flt.getDestination());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(70,43);to=(71,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(71,21);to=(71,36)]
    out.print(flt.getArrive());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(71,38);to=(72,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(72,21);to=(72,36)]
    out.print(flt.getFrDate());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(72,38);to=(73,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(73,21);to=(73,41)]
    out.print(flt.getFlightDptTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(73,43);to=(74,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(74,21);to=(74,36)]
    out.print(flt.getToDate());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(74,38);to=(75,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(75,21);to=(75,41)]
    out.print(flt.getFlightArrTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(75,43);to=(76,1)]
    out.write("</td>\r\n ");
    // end
    // begin [file="/client/flightsearch.jsp";from=(76,3);to=(87,1)]
    int adt, chld;
    int far_A, tot_A, far_C, tot_C;
    adt = Integer.parseInt(adult);
    far_A = flt.getAdultFr();
    tot_A = adt * far_A;
    chld = Integer.parseInt(child);
    far_C = flt.getChildFr();
    tot_C = chld * far_C;
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(87,3);to=(88,18)]
    out.write("\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(88,21);to=(88,26)]
    out.print(tot_A);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(88,28);to=(89,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(89,21);to=(89,26)]
    out.print(tot_C);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(89,28);to=(91,0)]
    out.write("</td>\r\n</tr>\r\n");
    // end
    // begin [file="/client/flightsearch.jsp";from=(91,2);to=(100,0)]
    if(type = "Return")
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(arr, des, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(100,2);to=(102,18)]
    out.write("\r\n<tr>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(102,21);to=(102,40)]
    out.print(flt.getFlightComp());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(102,42);to=(103,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(103,21);to=(103,39)]
    out.print(flt.getFlightNum());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(103,41);to=(104,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(104,21);to=(104,39)]
    out.print(flt.getFlightDpt());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(104,41);to=(105,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(105,21);to=(105,39)]
    out.print(flt.getFlightArr());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(105,41);to=(106,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(106,21);to=(106,41)]
    out.print(flt.getFlightDptDt());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(106,43);to=(107,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(107,21);to=(107,41)]
    out.print(flt.getFlightDptTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(107,43);to=(108,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(108,21);to=(108,41)]
    out.print(flt.getFlightArrDt());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(108,43);to=(109,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(109,21);to=(109,41)]
    out.print(flt.getFlightArrTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(109,43);to=(110,1)]
    out.write("</td>\r\n ");
    // end
    // begin [file="/client/flightsearch.jsp";from=(110,3);to=(120,1)]
    int adlt, chd;
    int fare_A, totA, fare_C, totC;
    adlt = Integer.parseInt(adult);
    fare_A = flt.getAdultFr();
    totA = adlt * fare_A;
    chd = Integer.parseInt(child);
    fare_C = flt.getChildFr();
    totC = chd * fare_C;
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(120,3);to=(121,18)]
    out.write("\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(121,21);to=(121,25)]
    out.print(totA);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(121,27);to=(122,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(122,21);to=(122,25)]
    out.print(totC);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(122,27);to=(124,0)]
    out.write("</td>\r\n</tr>\r\n");
    // end
    // begin [file="/client/flightsearch.jsp";from=(124,2);to=(126,0)]
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(126,2);to=(127,8)]
    out.write("\r\n</table>");
    // end
    } catch (Throwable t) {
    if (out != null && out.getBufferSize() != 0)
    out.clearBuffer();
    if (pageContext != null) pageContext.handlePageException(t);
    } finally {
    if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);

    You are missing a closing parens. You have :
    if(type = "Return")
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(arr, des, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){Which opens two parens but you only have one closing parens
    </tr>
    <%
    %>
    </table>

  • Import javax.servlet.jsp.*;

    I am new to JSP.I getting errors in compilation.Can anyone please tell me the following import file can be found in which development kit.
    "import javax.servlet.jsp.*;

    You can download J2EE from sun's website. What you need is servlet.jar package. Put it in your CLASSPATH.

  • 13 default packages in JSP

    Can anybody tell what are the 13 default packages in JSP.
    Thanks in advance!!!

    not entirely sure what you mean but the following are imported implicitly in all JSPs:
    java.lang.*
    javax.servlet.*
    javax.servlet.jsp.*
    javax.servlet.http.* hth,
    m

  • Using a package in JSP

    Hi,
    I've been learning java at Uni using the Elements Package. I've started learning JSP on my own and was wondering if i can use the package with JSP. For example if i wanted to use this code
    import element.*;
    import java.awt.Color;
    public class test
    public static void main(String args[])
         DrawingWindow d = new DrawingWindow();
         ConsoleWindow q = new ConsoleWindow();
    is it possible?

    You cannot have a main() method in a JSP. The JSP will be compiled (behind the scenes) by your J2EE container (Tomcat, Weblogic, JBoss, etc.) into a Servlet. As such, you have access in your JSP to the HttpServletRequest and HttpServletResponse, as well as the HttpSession, the Servlet OutputStream, and a few other Servlet variables. You write normal Java code within the JSP (or use a JSTL tag lib) between <% and %> blocks. You can import any package in your JSP that is in the web application's classpath.
    - Saish

  • Only a type can be imported. package.Class resolves to a package

    Hi,
    I made a class for database connection named ConnectionClass.class.
    The JSPs in public_html directory working fine with import and session variables.
    but JSPs under public_html/subdirectory are unable to import this Class and also unable to access session variables.
    I have deploy this class under public_html/WEB-INF/classes/ directory.
    and also in a jar file vidyabharti.jar under public_html/WEB-INF/lib directory
    I am importing it in JSPs like
    <%@ page import="vidyabharti.ConnectionClass, java.sql.*" %>
    but i am getting following error
    An error occurred at line: 6 in the generated java file
    Only a type can be imported. vidyabharti.ConnectionClass resolves to a package
    An error occurred at line: 110 in the jsp file: /welcome.jsp
    ConnectionClass cannot be resolved to a type
    109: <%
    110: ConnectionClass cs=null;
    An error occurred at line: 115 in the jsp file: /welcome.jsp
    ConnectionClass cannot be resolved to a type
    cs=new ConnectionClass();
    i am using Tomcat 5.5.28.
    please help me.

    Hello,
    It's a possible issue whith the JDT compiler version of your tomcat distribution.
    You know that jasper is the engine that transform jsp to classes and to achive this goal uses a jdt compiler or the ant task javac compiler.
    First check that the JDT compiler class is present in the trace of the exception you have.
    If this is the case follow the steps of the tomcat documentation in order to use the ant compiler.
    http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html
    Apache Ant, which was used in previous Tomcat releases, can be used instead instead of the new compiler by simply removing the common/lib/jasper-compiler-jdt.jar file, and placing the ant.jar file from the latest Ant distribution in the common/lib folder. If you do this, you also need to use the "javac" argument to catalina.sh.
    If you check the code of the tomcat compilation context seems that you can do the same, without removing any file, by setting the compile parameter of the JspServlet to an arbitrary value diferent from null.
    Try this other alternative by editing the file %TOMCAT_HOME%\conf\web.xml
    and set the compiler attribute as follow
        <servlet>
            <servlet-name>jsp</servlet-name>
            <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
            <init-param>
                <param-name>fork</param-name>
                <param-value>false</param-value>
            </init-param>
            <init-param>
                <param-name>xpoweredBy</param-name>
                <param-value>false</param-value>
            </init-param>
            <init-param>
                <param-name>compiler</param-name>
                <param-value>Ant</param-value>
            </init-param>
            <load-on-startup>3</load-on-startup>
        </servlet>If this works for your problem we can check the jdt code and perhaps make a patch.
    Best reggards,

Maybe you are looking for

  • Cannot uninstall because I get a message to close Firefox first, but it is not open

    Firefox stopped working, I tried to uninstall it and because I thought something was corrupted. It will not let me unistall because I am told to close Firefox first. I cannot find firefox, nor can I close it. I think that it is gone, but it still app

  • Unable to import Mac address book

    I am unable to import my Mac Address Book into Thunderbird. In thunderbird, I have gone to tools>import>address book>text file . Address Book is not highlighted, so I am not able to choose it. I have also tried to export it from Address Book. In Addr

  • Call Labview8 VI from TestExec5.1

    Hello, I need to call some Labview8 VI from TestExec5.1 (Agilent). It works fine with Labview 7.1, but exactly the same code with Labview 8.0 give me back an error with 2 error messages: "The file C:\Program Files\National Instruments\Labview 8.0\Fil

  • Footer menu and drop up menu

    Hi, anyone have implemented an iView for footer menu with a drop up menu? My menu is affected from some conflicts with javascript for drop up and javascript described in "Best Practices for Changing the Portal Look and Feel" ("Footer iView in Framewo

  • Problem while installting the J2E engine

    Hello All, while installing the Java WAS I am getting the following exception."Caught ESyException in Modulecall: ESAPinstException: error text undefined." This occurs when I am suppose to provide the OS user passwords.I am providing the correct pass