Javax.servlet classes...  very quick to answer

I have downloaded the javax classes, but I have no idea how to install them... when I try and compile code including
import javax.servlet.*;
I get the error package javax.servlet.http does not exist.
I have installed tomcat 4.0.1, and I have set my JAVA_HOME env variable to /usr/java/jdk1.3.1_02 which is where I installed my java stuff. I compiled as such
javac helloworld.java
help? please :) I just want to get off hte ground.
Oh yes I can also access my tomcat on port 8080, but I don't think that's involved cause it's compiling I am trying to do not run it yet.. that comes later :(
Josh.

After a break i noticed my stupidity... To stop people from needlessly answering this post, and to possibly help others who are as mentally challenged as myself, the answer to my question is that I had to set
CLASSPATH=mydirwithjavax
NOT
PATH=mydirwithjavax
Cheers,
Josh.

Similar Messages

  • Problem: package javax.servlet.jsp does not exist

    I am a novice JSP programmer. My projects that use any javax.servlet classes are not seeing those at all. I am working with a group of folks using Java SE 1.5. (Note: I'm using Windows so the directory separator is "\")
    What Used to work:
    1. Nearly all my projects were working using Java version 1.6. These projects were developed as examples from Wrox and Apress books about JSP and Struts.
    What has changed:
    1. I un-installed the version 1.6 of JDK and JRE, as well as tomcat, netbeans, and all the associated libraries/jars.
    2. I installed version 1.5 of JDK and JRE, as well as tomcat, netbeans, and all the associated libraries/jars.
    3. I updated my JAVA_HOME, CATALINA_HOME, CLASSPATH, and PATH environmental variables. I made sure that the path to servlet-api.jar (in the tomcat common\lib) is included in the classpath.
    What is wrong:
    1. References to javax.servlet.* are not satisfied--they are flagged in the source code in NetBeans and I get compiler errors with any project containing those references. For example:
    ... package javax.servlet.jsp does not exist
    import javax.servlet.jsp.*;
    What I've found:
    1. My CATALINA_HOME=C:\Java\Tomcat 5.5
    2. My JAVA_HOME=C:\Java\jdk1.5.0_11
    3. My CLASSPATH=.;C:\Program Files\QuickTime\QTSystem\QTJava.zip;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib;%JAVA_HOME%\lib\jsp-api.jar;%CATALINA_HOME%\common\lib\servlet-api.jar;C:\Java\logging-log4j-1.2.14\dist\lib\log4j-1.2.14.jar
    4. My PATH=c:\wint\BIN;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;%CATALINA_HOME%\bin;C:\MySQL\MySQL Server 5.0\bin;D:\MiKTeX 2.5\miktex\bin;C:\Perl\bin\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\SFU\Perl\bin\;C:\SFU\common\;C:\Program Files\Lahey-Fujitsu Fortran\v7.1\Bin;C:\Program Files\Lahey-Fujitsu Fortran\v7.1\Win32\Bin
    What I need:
    1. I need to have some reference to the servlet classes satisfied in my configuration. Any help is appreciated.
    thanks
    jondr

    Oh. I got some over-the-shoulder debug help.
    My error was in the classpath specification:
    The path: %JAVA_HOME%\lib\jsp-api.jar
    Should be: %CATALINA_HOME%\lib\jsp-api.jar
    That contains the javax.servlet.jsp.*
    Thimk.
    Message was edited by: jon
    jondr

  • How to install servlet classes in order to compile a simple servlet...

    When trying to compile a simple servlet (java file), I get errors having to do with not finding any object of the javax.servlet class. I am using J2SE v.1.4, and from what I know, it does not have built-in support for Servlets-JSP.
    Do I need to install myself the servlet classes (downloaded from Sun's site) in order for my servlet to be able to compile and work under tomcat? And if so, where should I put them? Or is there something else I have to do?
    Thank you in advance for your assistance!

    If you have Tomcat already, the files you require are in:
    (Tomcat4)
    [TOMCAT_HOME]/common/lib/servlet.jar
    or
    (Tomcat5)
    [TOMCAT_HOME]/common/lib/servlet-api.jar
    [TOMCAT_HOME]/common/lib/jsp-api.jar
    This file needs to be added to your classpath when compiling a servlet.

  • Searching for javax.servlet.jsp.tagext.*

    Hi,
    I am looking for the library which contains javax.servlet.jsp.tagext.*.
    Does anyone know what to download to get this library.
    Thanks,

    hi,
    You can get the javax.servlet.jsp.tagext.*. in servlet.jar.
    To unjar it in linux use the following command
    jar -xvf servlet.jar
    You will get the tagext folder in : /javax/servlet/jsp/
    ullas

  • Servlet failed with Exception java.lang.LinkageError: Class javax/servlet/ServletConfig

              Hi
              I registered a web app with Weblogic 5.1 in the weblogic.properties file. I try
              to run the web app from my browser typing http://localhost:7001/xxx(Webapp name)
              and a jsp page. Following is the error I get. It would be helpful if some one
              could point me to a fix for this problem
              Tue May 01 13:56:41 CDT 2001:<I> <ServletContext-omxclient> Generated java file:
              D:\weblogic\myserver\omxclient\_tmp_war\jsp_servlet\_omx\_login.java
              Tue May 01 13:56:43 CDT 2001:<E> <ServletContext-omxclient> Servlet failed with
              Exception
              java.lang.LinkageError: Class javax/servlet/ServletConfig violates loader constr
              aints
              at jsp_servlet._omx._login._jspService(_login.java:59)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:105)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:123)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:742)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:686)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              ContextManager.java:247)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              a:361)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              

              Sorry, I didn't look very closely - the exception is for
              javax.servlet.ServletConfig - should be in weblogicaux.jar.
              Is there anything wrong with it? What service pack are you
              using? Could be a problem with weblogic.policy.
              mike
              >>java.lang.LinkageError: Class javax/servlet/ServletConfig
              "KC" <[email protected]> wrote:
              >
              >Hi Mike
              >The login.jsp page just contains a javascript function and two text boxes
              >in it.
              >Will try making changing it. If that is not the issue could you let me
              >know of
              >any other issues.
              >
              >"mreiche" <[email protected]> wrote:
              >>
              >>I would guess that login.jsp is a very large JSP and that
              >>the generated service method is too large for the classloader's
              >>liking. Try making it smaller.
              >>
              >>Mike
              >>
              >>
              >>"KC" <[email protected]> wrote:
              >>>
              >>>Hi
              >>>I registered a web app with Weblogic 5.1 in the weblogic.properties
              >>file.
              >>>I try
              >>>to run the web app from my browser typing http://localhost:7001/xxx(Webapp
              >>>name)
              >>>and a jsp page. Following is the error I get. It would be helpful if
              >>>some one
              >>>could point me to a fix for this problem
              >>>
              >>>Tue May 01 13:56:41 CDT 2001:<I> <ServletContext-omxclient> Generated
              >>>java file:
              >>> D:\weblogic\myserver\omxclient\_tmp_war\jsp_servlet\_omx\_login.java
              >>>Tue May 01 13:56:43 CDT 2001:<E> <ServletContext-omxclient> Servlet
              >>failed
              >>>with
              >>>Exception
              >>>java.lang.LinkageError: Class javax/servlet/ServletConfig violates
              >loader
              >>>constr
              >>>aints
              >>> at jsp_servlet._omx._login._jspService(_login.java:59)
              >>> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              >>> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              >>>pl.java:105)
              >>> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              >>>pl.java:123)
              >>> at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              >>>textImpl.java:742)
              >>> at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              >>>textImpl.java:686)
              >>> at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              >>>ContextManager.java:247)
              >>> at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              >>>a:361)
              >>> at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
              >>>
              >>> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >>>
              >>>
              >>
              >
              

  • Error in compiling: file javax\servlet\jsp\PageContext.class not found

    Hi,
    i'm getting an error when I'm trying to compile an java file. The error is as follows:
    cannot access javax.servlet.jsp.PageContext
    file javax\servlet\jsp\PageContext.class not found
    Isn't the javax package included in jdk? I've installed jdk 1.3.1_03 and j2re1.4.0_02. Shouldn't this PageContext.class be automatically loaded when i've installed jdk?
    I'm getting desperated! I've tried almost everything: i've changed the classpath, moved the directory of the java file I'm trying to compile over and over but i'm getting no success!
    Any help is very welcome!
    Thankx,
    Nuno.

    hmmm... i had a look and it seems that what you are trying to "import" is actually in a package... instead of import try:
    package javax.servlet.jsp;you may need to go download this "package" and complile it in the directory you are working in.
    my advice: try the above statement (which does compile for me), if it doesn't work, you will need to find the source code for this package and compile it just like you do any other source code.
    hope this helps.

  • Class not found javax.servlet.jsp.jstl.sql.Result in Richfaces

    When I try to run the richfaces application using Weblogic 10.3 AS and Netbean IDE 6.9.1, I found ClassNotFoundException on javax.servlet.jsp.jstl.sql.Result class.
    I class path the following libs.
    commons-beanutils-core-1.8.0.jar
    commons-digester-1.8.jar
    commons-fileupload-1.2.1.jar
    commons-io-1.2.jar
    commons-logging-1.1.1.jar
    glassfish.el_2.1.1.jar
    glassfish.jsf_1.2.9.0.jar
    javassist-3.8.0.GA.jar
    jhighlight-1.0.jar
    jsf-facelets.jar
    jsf-api.jar
    log4j-1.2.14.jar
    richfaces-api-3.3.0.GA.jar
    richfaces-impl-3.3.0.GA.jar
    richfaces-ui-3.3.0.GA.jar
    glassfish.jstl_1.2.0.1.jar
    Also I try to deploy without using some jar files already exists in application server.
    My web.xml configuration is-
    <context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>#{skinSelector.skin}</param-value>
    </context-param>
    <context-param>
    <param-name>org.richfaces.CONTROL_SKINNING</param-name>
    <param-value>enable</param-value>
    </context-param>
    <context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <context-param>
    <param-name>org.ajax4jsf.SKIN</param-name>
    <param-value>skin_name</param-value>
    </context-param>
    <filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <login-config>
    <auth-method>BASIC</auth-method>
    </login-config>
    <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    I also try to configure <library-ref>....</libray-ref> configuration in weblogic.xml and weblogic-application.xml and I also deploy JSF-2.0.war as library in application.
    Please
    h5.MUTU

    So why didn't you think that the JSP forum here wasn't a good place to ask JSP questions like this one?
    You can use <c:for-each> with a List. That's how it's designed. I don't understand why you say you can't. Perhaps you were confused by the SQL tags in JSTL. But anyway, you should just return a List from your EJB and forget about using obscure internal JSP classes.

  • Javax.servlet.jsp.JspException: Exception creating bean of class ProdFormFB

    Hi I am trying to deploy a struts based web application using "DynaActionForms"
    When I am trying to access the jsp page I am getting the following error.
    I am providing as much as details as it can help full to u.
    Thank u.
    FormBean class ProdFormFB.java
    ========================================================================
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.apache.struts.action.*;
    public class ProdFormFB extends DynaActionForm
    public void reset(ActionMapping mapping, HttpServletRequest request)
         System.out.println("reset() called. . . . ");
    set("prodId", new Integer(10));
         set("prodName", new String("XYZ"));
         set("price", new Float(22.25));
    public ActionErrors validate(ActionMapping mappings, HttpServletRequest request)
    System.out.println("=== validate() called ===");
    ActionErrors aes=new ActionErrors();
         System.out.println("aes.size() ===> "+aes.size());
         String prodName = (String)get("prodName");
         if( prodName==null || prodName.equals("") )
              System.out.println("Adding prodName.req error . . . . . . .");
              aes.add("prodName",new ActionError ("prodName.req.error"));
    return aes;
    ========================================================================
    Action Class ProdAction.java
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.apache.struts.action.*;
    public class ProdAction extends Action
       public ActionForward execute(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response)throws Exception
          ProdFormFB fb = (ProdFormFB)form;
          System.out.println("fb.get('prodId')==> "+fb.get("prodId"));
          System.out.println("fb.get('prodName')==> "+fb.get("prodName"));
          System.out.println("fb.get('price')==> "+fb.get("price"));
           return mapping.findForward("dres");
    }========================================================================
    jsp page : npform.jsp
    <%@ taglib uri = "/tags/struts-html" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <html:html>
      <head>
         <title>Product Form</title>
      </head>
      <body>
              <html:form action="/pAction">
              <center>
                <br><br>
                <center> <font color="green" style="bold" size=5>Product Form using Struts</font></center><br><br>
                <table>
                <tr>
                   <td>
                          <b> Product ID : </b>  <html:text property="prodId"/> </td><td><font color="red" style="bold"><html:errors property="prodId"/> </font>
                 </td>
             </tr>
               <tr>
                   <td>
                          <b> Prod Name : </b> <html:text property="prodName"/>  </td><td> <font color="red" style="bold"> <html:errors property="prodName"/> </font>
                 </td>
              </tr>
    <!--           <tr>
                   <td>
                          <b> Price : </b> <html:text property="price"/>  </td><td> <font color="red" style="bold"> <html:errors property="price"/> </font>
                 </td>
              </tr> -->
               <tr  colspan="2" align="center">
                   <td>
                      <html:submit property="submit" value="Store"/>
                </td>
              </tr>
              </table>
                          </center>
           </html:form>
      </body>
    </html:html>========================================================================
    Configuration in struts-config.jsp
        <form-beans>
             <form-bean name="NewProdForm" type="ProdFormFB">
                  <form-property name="prodId" type="java.land.Integer"/>
                    <form-property name="prodName" type="java.land.String"/>
                  <form-property name="price" type="java.land.Float"/>
            </form-bean>
    </form-beans>
    <action-mappings>
           <action name="NewProdForm" path="/pAction" type="ProdAction" input="/npform.jsp" validate="true" scope="request">
                  <forward name="dres" path="/dres.jsp"/>
           </action>
    </action-mappings>========================================================================
    After deploying successfully I am I am entering the following URL
    http://localhost:7001/oursapp/npform.jsp
    The following Exception on Browser: and also on the server console ......
    javax.servlet.jsp.JspException: Exception creating bean of class ProdFormFB: {1}
         at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:463)
         at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:433)
         at jsp_servlet.__npform._jspService(__npform.java:178)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)     
    Plz... Help me out is solving the problem .......
    my email :   [email protected]

    I never used DynaActionForm, what I have noticed here is, don't you need to declare the form bean? I may be wrong.
    <form-beans>
    <form-bean name="newProdForm" type="com.package.form.NewProdForm"></form-bean>
    </form-beans>

  • Using classes not specified in javax.servlet.*;

    I have a java program whose pupose is to execute a Login function. It uses the servlet and jsp classes although it also uses java.io.*; and java.sql.*;. When I attempt to execute the class from Tomcat I receive a 405 error listing one of my methods ("Get" which is part of the sql class) as not supported. Is there a way for Tomcat to accept these external classes? (They are of course imported in the compiled code which I have written.)
    Any help would be appreciated!

    I have implemented your suggestion and unfortunately it states that (now instead of not supporting the Get Method) it does not support the Post Method.
    This does seem to say that I need both a doGet() and a doPost().
    I am stumped on this one, any help would be appreciated. My code (including the change as suggested in the previous reply) is as follows:
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Login extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    doPost(req, res);
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    String userId = req.getParameter("name");
    String password = req.getParameter("password");
    try {
    String uName = validateUser(userId, password);
    if (uName == null) {
    PrintWriter out = res.getWriter();
    out.println("Please verify the UserId and password");
    out.close();
    else
    HttpSession userSession = req.getSession(true);
    userSession.setAttribute("userName", uName);
    RequestDispatcher rd =
    getServletContext().getRequestDispatcher
    ("/SF_board.jsp");
    if (rd != null)
    rd.forward(req,res);
    catch (SQLException e)
    catch (ClassNotFoundException ex)
    }

  • Javax.servlet.ServletException: Cannot create bean of class

    People,
    HELP!! I am getting desperate!!!
    I am a newbie when it comes to TOMCAT, but i have been using Blazix before.
    My current system is using APACHE/TOMCAT on a Solaris machine and I keep hitting the same problem. I have gone through the archives but the only thing it states is to check the directory which i have done.
    I keep getting:
    Error 500
    Internal Error
    javax.servlet.ServletException: Cannot create bean of class MyClass
    The code used to work on the Blazix server so i am assuming it is something to do with a config parameter somewhere - but i do not know where. I have checked the directory/package structure and they seem to work. It even serves it when they are html pages not jsp, but obviously wont use the bean. :(
    I can post code if necessary.
    Please help
    Steve

    The FormData.class file is in examples/WEB-INF/classes/ directory.
    Is this wrong? then should it be in a package called examples.steve???
    <TITLE> Poc </TITLE>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <META NAME="Generator" CONTENT="Mozilla/4.61 [en] (WinNT; I) [Netscape]">
    <META NAME="Author" CONTENT="Steve Brodie">
    <META NAME="Proof of Concept order entry system" CONTENT="">
    <META NAME="PROOF OF CONCEPT ORDER ENTRY SYSTEM " CONTENT="">
    </HEAD>
    <%@ page import="steve.FormData" %>
    <jsp:useBean id="user" class="steve.FormData"/>
    <jsp:setProperty name="user" property="*"/>
    <FORM METHOD=POST ACTION="SaveDetails.jsp">
    <CENTER>
    <H1>     
    POC CNS demo <BR>
    POC Order Entry System <BR></H1>
    <H2><CENTER>PROOF OF CONCEPT ORDER ENTRY SYSTEM <BR>
    in order to illustrate the use of an new product<BR></H1>
    </CENTER>
    <BODY>
    Please enter the following details: <BR>
    Second name <INPUT TYPE=TEXT NAME=secondName SIZE=20><BR>
    First name <INPUT TYPE=TEXT NAME=firstName SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address1 SIZE=20><BR>
    Address <INPUT TYPE=TEXT NAME=address2 SIZE=20><BR>
    Post Code <INPUT TYPE=TEXT NAME=postCode SIZE=10><BR>
    Phone NO. <INPUT TYPE=TEXT NAME=phone SIZE=10><BR>
    <BR>
    Credit Card<INPUT TYPE=TEXT NAME=credit SIZE=15><BR>
    <BR>
    Quality of Service:
    <SELECT TYPE=TEXT NAME="QoS">
    <OPTION SELECTED TYPE=TEXT NAME=Gold>Gold <BR>
    <OPTION TYPE=TEXT NAME=Silver>Silver <BR>
    <OPTION TYPE=TEXT NAME=Bronze>Bronze <BR>
    </SELECT>
    <BR>
    <BR>
    <INPUT TYPE=RESET>
    <P><INPUT TYPE=SUBMIT>
    <BR>
    <BR>
    <IMG SRC=../images/Cisco.gif>
    </FORM>
    </BODY>
    </HTML>
    package steve;
    * @author Steven Brodie
    * @date
    * @version 0.0
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    public class FormData {
         String secondName = null;
         String firstName = null;
         String address1 = null;
         String address2 = null;
         String postCode = null;
         int credit = 0;
         int phone = 0;
         String qos = null;
         String file = "out";
         String filex = "xout";
         PrintWriter pout = null;
         PrintWriter xout = null;
         FormData() {
              try {
                   pout = new PrintWriter(new BufferedWriter(new FileWriter(file + ".txt")));
                   xout = new PrintWriter(new BufferedWriter(new FileWriter(filex + ".xml")));
              xout.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
              xout.println("<OrderEntry xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
              xout.println("xsi:noNamespaceSchemaLocation=\"http://machine2.com:8080/xml/xsd/OrderEntry.xsd\">");
              } catch (IOException ioe) {
                   System.err.println("DataFileWriter error ioe on init");
                   ioe.printStackTrace();
                   System.exit(1);
    public void setFirstName( String value ) {
    firstName = value;
              System.out.println(firstName);
              pout.println(firstName);
              xout.println("<firstname value= \"" + firstName + "\"/>");
    public void setSecondName( String value ) {
    secondName = value;
              System.out.println(secondName);
              pout.println(secondName);
              xout.println("<secondname value= \"" + secondName + "\"/>");
    public void setAddress1( String value ) {
    address1 = value;
              System.out.println(address1);
         pout.println(address1);
              xout.println("<address1 value= \"" + address1 + "\"/>");
    public void setAddress2( String value ) {
    address2 = value;
              System.out.println(address2);
              pout.println(address2);
              xout.println("<address2 value= \"" + address2 + "\"/>");
    public void setPostCode( String value ) {
    postCode = value;
              System.out.println(postCode);
              pout.println(postCode);
              xout.println("<postCode value= \"" + postCode + "\"/>");
    public void setCredit( int value ) {
    credit = value;
              System.out.println(credit);
              pout.println(credit);
              xout.println("<creditCard value= \"" + credit + "\"/>");
         public void setPhone( int value) {
              phone = value;
              System.out.println("0" + phone);
              pout.println("0" + phone);
              xout.println("<phoneNo value= \"0" + phone + "\"/>");
    public void setQoS( String value ) {
    qos = value;
              System.out.println(qos);
              pout.println(qos);
              xout.println("<QoS value= \"" + qos + "\"/>");
              xout.println("</OrderEntry>");
              pout.flush();
              pout.close();
              xout.flush();
              xout.close();
    public String getFirstName() {
              return firstName;
    public String getSecondName() {
              return secondName;
    public String getAddress1() {
              return address1;
    public String getAddress2() {
              return address2;
    public String getPostCode() {
              return postCode;
    public int getCredit() {
              return credit;
         public int getPhone() {
              return phone;
         public String getQoS() {
              return qos;

  • Class javax.servlet.jsp.PageContext compilation error

    During Rebuild/compilation of the JSP files inside JDeveloper, I am encountering the compilation error "Error(548,78): method handlepageException (java.lang.Throwable) not found in class javax.servlet.jsp.PageContext. When I developed the same application under IBM WSAD, I included the library com.ibm.servlet.jar and will take care of it. Which Oracle Jdeveloper lib I need to include? Since it is a servlet library error, I tried to include the Oracle "Servlet APIC Classes" but it didn't fix the problem. Thanks in advance!

    hmmm... i had a look and it seems that what you are trying to "import" is actually in a package... instead of import try:
    package javax.servlet.jsp;you may need to go download this "package" and complile it in the directory you are working in.
    my advice: try the above statement (which does compile for me), if it doesn't work, you will need to find the source code for this package and compile it just like you do any other source code.
    hope this helps.

  • Why all classes in javax.servlet.jsp are abstract?

    Hi all,
    I have two questions about how the package was designed:
    1.) why all the classes in the javax.servlet.jsp are abstract? what is the benefits?
    2.) why almost all the methods in the class, such as jspWriter, are abstract too? And we can use these abstract methods in the way we use "concrete" methods?
    3.) the same thing for HTTPServlet class at javax.servlet package.
    Thanks in advance
    yllx

    Thanks for the message. In fact, you don't need to reply to the message if you don't have the answer.
    I suspect that this has something to do with the abstract factor design pattern. It allows each container engine to implement the detail based on its own specification. I just need some body to put more details on that.
    Since this happens quite often if the J2EE library, it's good for us to understand why they do this way, and how we can use it in our design.
    yylx

  • Custom Class file errors out on import javax.servlet.http.HttpSession

    I am trying to write a class file to handle events. This is a test class file copied from the UIX Docs. When I put this in JDeveloper 903 ,and build it the compiler gives the error:
    Error(2,27): cannot access class javax.servlet.http.HttpSession; file javax\servlet\http\HttpSession.class not found
    I am not sure what is the problem? Can anyone please help?
    Here is the code:--
    package mypackage1;
    import javax.servlet.http.HttpSession;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    public class MyClass
    /** This is handleStoreNameEvent version 1 */
    public static EventResult handleStoreNameEvent(BajaContext context,
    Page page,
    PageEvent event)
    String userName = event.getParameter("txt1");
    HttpSession session = context.getServletRequest().getSession(true);
    session.putValue("User Name", userName);
    Page nextPage = new Page("NextPage");
    return new EventResult(nextPage);
    }

    Hi, you are missing the servlet.jar file from your classpath.
    In JDeveloper, you can add this by opening up your project -> libraries and adding the servlet runtime library.

  • Class javax.servlet.Servlet not found - problem

    Hello,
    i'm using intellij and tomcat . when i try to configure intellij to use tomcat it says that it doesn't find javax.servlet.Servlet class.
    i'm using jdk1.5.0_05. what can i do to fix this error?
    tnx,
    clauditza

    ok!
    and where can i find this particular jar? i have searched it on java.sun.com, but all i could find was j2ee that includes support for servlets

  • Where cannot i access class javax.servlet

    i dont kwon whta happend this: "OutputFilterBase.java": Error #: 302 : cannot access class javax.servlet.ServletResponse; java.io.IOException: class not found: class javax.servlet.ServletResponse at line 62, column 22
    please help me
    thanks

    You need a servlet engine for servlets. Like resin, tomcat etc. Then add it to classpath.
    Andreas

Maybe you are looking for