Subclassing a servlet

Hi,
I am trying to call a method in a super class from a servlet. I packaged the superclass in a jar file and tried importing it in the servlet. I put the jar file in the lib directory of tomcat. In my servlet I try Myclass class = new Myclass();
when I compile the servlet, the error reads "class not found in import"
there must be a different way to subclass in a servlet versus a standard java application.
can someone help? thanks

DrClap...............thanks again
scratch the above !!
my classpath problem is solved. there is alot to be said about getting a good nights sleep and solving your problem the next morning.
NOW I have a new problem
my sub class is accessing a method in my super class correctly. however, in my super class I passed a parameter from another class and my method does not recognize the parameter.
I am using the servlet service method with request and response objects. My method does not recognize the request object ie: request.getParameter("xxx");
If I treat the request object like a class variable by passing it into a string, my method still does not recognize the string. (because my method is outside the class like I believe it should be)
PS: my method code is outside the class and works just fine when that particular class makes a call to that method. but when my subclass makes a call to that method it does not recognize the super class' request object.

Similar Messages

  • Read file in servlet

    In the servlet file, I create a new object which is class A(which is not subclass of servlet).
    And class A have a method to read a txt file.
    However, no matter I put the file in what directory such as tomcat/webapps/home/WEB-INF/classes, or just in home, when the servlet file and new the object of class A, and then call the read file method. java.lang.NullPointerException occurs.
    How should I do?
    thx~~

    use the absolute path in the constructor
    of the reader you use to read the file.
    then it should work.

  • How many types of servlets are there

    posted June 12, 2006 03:36 AM
    HI EveryOne
    what are the different types of servlets.
    If we want to write our own servlet for particular protocol
    what to do ?

    I don't think it goes as far as needing to change the server. You just have to do a bunch of subclassing and servlet mapping.
    I would start with a subclass of GenericServlet that mimics the functionality of HttpServlet. For example, if I had an FtpServlet it might override the service method to read the FTP request and forward it to a doUser, doPass, doChangeWorkingDirectory, doQuit, doPort, doMode, doRetrieve, doStore, doAppend, etc... methods (there are a lot of commands for FTP.
    You would probably want to make FtpServletRequest and FtpServletResponse classes as well. For instance, your FtpServlet would probably make an FtpServletRequest (that would double as the user's FTP session since FTP really is a sequence of requests) that stores all the user's previous commands and their order. It is maintained (probably mapped to the user's IP address) on a per-user basis until they doQuit.
    The FtpServletResponse would be a a little more complicated. I would probably design it to do the data transfer part of FTP. It would then be a Thread that managed a URLConnection to the client to get or send data to.
    You design your servlets to extend your FtpServlet and override those methods whose default functionality you want to change and maybe design a good wrapping system to make it easy to do the different FtpResponses that would be required.
    You configure the server to listen to port 21, and your firewall to allow two way traffic on port 20. You would map all incoming calls to a default FtpServlet whose actual class you define in web.xml.
    I think you then have a working FtpServlet without the need to force the web server to recognize that it is doing it.
    Come to think of it, you probably wouldn't need a lot of subclassing of the FtpServlet. Probably just one for every site you want to host (would you want to have special cases for specific files?).
    I guess the real room for developement would be to get an FTP command that does one of the myriad of FTP actions. As you develope them you could probably use servlet parameters in web.xml to define which class to call for each of the actions...
    I digress. What meant to say was that all you have to do is some subclassing and URL mapping. No real change to the server itself.

  • Servlet Debugging

    I have an abstract servlet class extending HttpServlet; from that abstract class I have a few subclasses, but I cannot debug those subclasses within JDev, although they run fine on server? Is this a bug of JDev?
    I am using JDev 3.1.1.2

    This bug seems not to be fixed in JDev 3.2
    Currently I try to avoid to subclass from other than HttpServlet...
    It may be possible to create a additional startup servlet, which calls the other subclassed servlet, which is not recognized as a runable program
    I hope Oracle provides a bug fix in the near future. I am really dissapointed thas this known bug was not fixed in JDev.
    Klaus
    null

  • JSP Subclassing in weblogic.properties

    Hi,
              I'd like to have my JSP classfiles subclass one of our servlet classes,
              rather than the default. I'm able to do this at the command-line, by using a
              command like:
              java weblogic.jspc -keepgenerated -d /home/gkushida/weblogic/jsp -package
              com.kiko.jsp -superclass com.kiko.servlet.CustomJSP test.jsp
              This works fine, but I have two additional questions:
              1. I noticed that I have to provide an abstract _jspService() method in my
              CustomJSP servlet class, and then call it from within my doGet/doPost
              service methods manually. Is this the right thing to do?
              2. I'd like to do this automatically in my weblogic.properties file, where
              the JSPServlet is registered for *.jsp. I can't find any reference to a
              'superclass' initArg for the JSPServlet - is this functionality only
              available from the command-line compiler?
              We are running WebLogic 5.1.0, Service Pack 6 on Sun Solaris 2.7, JDK 1.3.
              Gene Chuang
              Join Kiko.com!
              

    See JSP 1.1 spec 3.2.4 for the contract of JSP page superclass.
              Gene Chuang <[email protected]> wrote:
              > Hi,
              > I'd like to have my JSP classfiles subclass one of our servlet classes,
              > rather than the default. I'm able to do this at the command-line, by using a
              > command like:
              > java weblogic.jspc -keepgenerated -d /home/gkushida/weblogic/jsp -package
              > com.kiko.jsp -superclass com.kiko.servlet.CustomJSP test.jsp
              > This works fine, but I have two additional questions:
              > 1. I noticed that I have to provide an abstract _jspService() method in my
              > CustomJSP servlet class, and then call it from within my doGet/doPost
              > service methods manually. Is this the right thing to do?
              > 2. I'd like to do this automatically in my weblogic.properties file, where
              > the JSPServlet is registered for *.jsp. I can't find any reference to a
              > 'superclass' initArg for the JSPServlet - is this functionality only
              > available from the command-line compiler?
              > We are running WebLogic 5.1.0, Service Pack 6 on Sun Solaris 2.7, JDK 1.3.
              > Gene Chuang
              > Join Kiko.com!
              Dimitri
              http://dima.dhs.org
              

  • Configuration file for servlets

    Hi, everyone
    I have one problem,I can't solve:
    I want write configuration file for several servlets (by incapsulating my static class Config in DBServlet subclass), but I don't know how can I find this config file in runtime( it will be placed, as I think in root documents directory of web-server).
    I can't use no method of DBServlet and HTTPRequest on its initialization phase (suche methods as getServletContext, getServerName, getServerPort and others), so
    I can't get real path of root documents directory of web-server.
    If I will read this file by URL like "localhost/config.cfg" there will be problem in web-server configuration with access permissions, I think.
    Is there some standard ways to find and read in servlet runtime from file , which is placed in root documents directory of web-server.
    Thanks in advance, Ed

    Ed,
    Your configuration file must be in your CLASSPATH.
    Regards
    Blaise

  • How to invoke a Servlet method from application

    please help me.the scenario is as follows
    1)a servlet is placed on the server and application has invoked servlet with URL and URL Connection class
    but how do i call a certain method of servlet on the server from the application.Let suppose the servlet's method to be invoked is print(String s).How it can be done from application.

    As GrayMan suggested, Servlets are intended to be used for HTTP communication.
    If you want to open common logic to multiple clients, use EJBs, CORBA or some type of Web Service (SOAP, XML-RPC).
    When you send a request to a servlet, the doPost or doGet method will be invoked. Products such as STRUTS allow you do 'map' to other classes. I suggest avoiding this.
    Personally, I avoid STRUTS like a bad disease. Using STRUTS instead of just learning Servlets/JSP adds a lot of overhead. I prefer performance over development time. A good example of this is that ANY request that comes in over the WEB has ALL variables from the calling page (text boxes, radio buttons and such) made avaialable through the HttpServletRequest.getParameter(String parameterName) method. STRUTS requires you to build a subclass of it's ActionForm classes that is nothing more than a JavaBean with fields that match that of the web page. STRUTS will look at all the parameters in the request and all the fields in the Bean and assign any matches from the request to the Bean. The Bean is instanciated and the matching logic performed just to give you access to objects you already have access to.
    Just my 2 cents, avoid STRUTS like an STD.

  • Non-HTTP servlet

              I need to support concurrent access from multiple clients using a non-HTTP protocol
              over socket connection. One way is to write my socket server and create a new
              thread for each request. But WLS forbids user-created threads from calling into
              WLS components such as EJB. So I would like to write a non-HTTP servlet so that
              the WLS servlet container will create a new thread calling into the servlet and
              have the servlet calling EJBs on this WLS created thread. But is there a way to
              plug a subclass of GenericServelt into WLS?
              Thanks,
              T Tse
              

    I don't think there is a way to use non-HTTP servlet's, but still you can use WLS
              execute queue and execute threads, for example:
              ServerSocket serverSocket = new ServerSocket(...);
              for(;;) {
              new MyThread(new RequestHandler(serverSocket.accept())).start();
              class RequestHandler implements Runnable {
              Socket socket;
              public RequestHandler(Socket socket) {
              this.socket = socket;
              public void run() {
              // to see if this is executing on a WebLogic execute thread
              new Exception().printStackTrace();
              try {
              socket.close();
              } catch(Throwable whatever) {}
              class MyThread implements Schedulable, Triggerable {
              boolean done = false;
              Runnable runnable = null;
              Object sync = new Object();
              ScheduledTriggerDef std;
              public void join() throws InterruptedException {
              synchronized(sync) {
              if(!done) {
              sync.wait();
              public void run() {
                   if(runnable != null) {
                   runnable.run();
              public MyThread() {
              public MyThread(Runnable runnable) {
                   this.runnable = runnable;
              public boolean start() {
                   boolean ok = false;
                   try {
                   T3ServicesDef t3 = (T3ServicesDef)(new InitialContext()).lookup("weblogic.common.T3Services");
                   std = t3.time().getScheduledTrigger(this, this);
                   std.schedule();
                   ok = true;
                   } catch(NamingException ne) {
                   System.out.println(ne.getMessage());
                   } catch(TimeTriggerException tte) {
                   System.out.println(tte.getMessage());
                   return ok;
              public void trigger(Schedulable sched) {
                   try {
                   run();
                   } catch(Throwable t) {
                   System.out.println(t);
              synchronized(sync) {
              done = true;
              sync.notify();
              public long schedule(long time) {
                   return done ? 0 : 1;
              ttse <[email protected]> wrote:
              > I need to support concurrent access from multiple clients using a non-HTTP protocol
              > over socket connection. One way is to write my socket server and create a new
              > thread for each request. But WLS forbids user-created threads from calling into
              > WLS components such as EJB. So I would like to write a non-HTTP servlet so that
              > the WLS servlet container will create a new thread calling into the servlet and
              > have the servlet calling EJBs on this WLS created thread. But is there a way to
              > plug a subclass of GenericServelt into WLS?
              > Thanks,
              > T Tse
              Dimitri
              

  • Using servlets for custom protocol???

    Is it possible to use servlets for my own custom protocol??
    Can somebody PLEASE say yes or no!!!!
    I've been struggling with this for hours!
    Is there an easier way?

    Yes, I searched through the API docs, doesn't tell me anything. I need proven examples.
    There's nothing out there .... strange!!!Actually, not so strange.
    I think the original design of the servlet API permitted protocols other that HTTP, but in practice it was found that it didn't work as well. I think I've heard of an FTPServlet subclass, but that's it.

  • How choose between post and get when calling a servlet from a java class ??

    Hi !!
    I have an urgent question : in fact some java programs that call servlets are published on the web, and the principle is to make an url.openconnection() to reach the servlet.
    What I don't understand is how we choose if we want to call the get or the post method on the servlet ?????
    please answer very fast.....
    thanks...

    from the URL documentation of openConnection():
    "If for the URL's protocol (such as HTTP or JAR), there exists a public, specialized URLConnection subclass belonging to one of the following packages or one of their subpackages: java.lang, java.io, java.util, java.net, the connection returned will be of that subclass. For example, for HTTP an HttpURLConnection will be returned, and for JAR a JarURLConnection will be returned."
    Obviously, in case of a http servlet, normally an instance of HttpURLConnection will be returned. If you don't change the request method, GET is the default.

  • Non-HTTP(S) Servlets

    I'd like to use servlets to provide services over a non-HTTP protocol (e.g. FTP, NNTP, SMTP, etc.). The existence of the Servlet -> GenericServlet -> HTTPServlet hierarchy suggests this is supposed to be possible but I'm not sure how to do it. The main problem I see is getting my servlet container to know what protocol (IP port) I want to use.
    So, are non-HTTP servlets supposed provide their own logic to set up a socket listener in the Servlet.init() method, manage their own thread pool, and dispatch requests to servlet instances as they are received? Or, is there some service provider API I can use to plug a non-HTTP service into my servlet container?
    BTW, I'd like to do this in a J2EE v1.3 server.
    Thanks, Dave

    I'd like to use servlets to provide services over a
    non-HTTP protocol (e.g. FTP, NNTP, SMTP, etc.)My first reaction would be "don't".
    In an HTTP request, there is a bunch of headers, which the servlet container uses to decide which servlet it will invoke. There are no such headers in e.g. FTP. Even if you manage to subclass Servlet to FTPServlet, the web server doesn't know how that FTP requests should be routed to that servlet.
    The piece of code that listens to port 80 etc really wants to see "GET", "POST" etc plus an URL on the first line of incoming data. That code won't respond well to seeing SMTP's "HELO".
    That being said, you can put such protocols in a web server or app server. Write a thread that creates a server socket for the appropriate port and then sits in accept(). When a connection comes in, it starts a new per-client thread which talks SMTP or whatever over the incoming socket. Pretty basic client/server socket programming.
    Also, to me, the servlet model appears inappropriate for FTP et al: a servlet services one request, then exits. FTP, NNTP and SMTP are all more like a discussion than request-reply.
    In theory, it would be possible to fashion e.g. an SMTP server as a sort of a servlet. Instead of doGet() and such perhaps you'd have doHELO(), doMAIL_FROM(), doDATA() etc. But that seems overly complicated... Seems easier to me to do simply:
        while (true)
            read socket input a line at a time;
            if (in data mode) {
                check for end-of-message;
                append to string buffer;
            } else {
                tokenize it;
                obey the incoming command;
        }Maybe if you really want to use the servlet model, write a Servlet-like class that has a doCommand() method and make the "obey the incoming command" bit above call that. I'm not sure how much that buys, though. There are enough small differences in things like command tokenizing to make code reuse in the various protocol "servlets" difficult.
    Btw, FTP in particular is an incredibly messy protocol. Implement that one only if you absolutely must, and even then crib some existing public domain implementation as a base. Active/passive, separate command/data channels, a wide range of buggy FTP clients, security difficult to get right, ... ouch...

  • Can weblogic  handle user defined subclass of HttpServletRequest?

    i implemented HttpServletRequest and am trying to pass it to
              requestDispatcher.forward
              but get the following error.
              i'm trying o give developer unifiorn way of accessing request parameter
              irrespective
              the html form is urlencoded or multipart.
              Is is possible to do in WLS.
              Thanks
              Wasiq
              java.lang.ClassCastException: com.ibos.util.RequestWrapper
              at
              weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
              l.java:112)
              at CHandler.doPost(CHandler.java:133)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              , Compiled Code)
              at weblogic.servlet.ServletServlet.service(ServletServlet.java:46)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              , Compiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java, Compiled Code)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java, Compiled Code)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              Manager.java, Compiled Code)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java,
              Compiled Code)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
              Compiled Code)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              IBOS, Inc.
              Buyer Driven e-Commerce Solutions
              Wasiq Hasan
              http://www.ibos.com
              p. 877.464.IBOS
              f. 714.685.3988
              

    I think you are looking for HttpServletRequestWrapper...
              "John gurdes" <[email protected]> wrote in message
              news:[email protected]...
              >
              >
              > Any workaround for this one? Finding the class taht implements the
              interface in
              > weblogic and subclassing it?
              >
              > >No, the implementation of Weblogic is tightly bound to itself.
              > >
              > >Peace,
              > >
              > >--
              > >Cameron Purdy
              > >Tangosol, Inc.
              > >http://www.tangosol.com
              > >+1.617.623.5782
              > >WebLogic Consulting Available
              > >
              > >
              > >"wasiq" <[email protected]> wrote in message
              > >news:[email protected]...
              > >> i implemented HttpServletRequest and am trying to pass it to
              > >> requestDispatcher.forward
              > >> but get the following error.
              > >> i'm trying o give developer unifiorn way of accessing request parameter
              > >> irrespective
              > >> the html form is urlencoded or multipart.
              > >>
              > >> Is is possible to do in WLS.
              > >>
              > >>
              > >> Thanks
              > >> Wasiq
              > >>
              > >>
              > >> java.lang.ClassCastException: com.ibos.util.RequestWrapper
              > >> at
              > >>
              >
              >weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherIm
              p
              > >> l.java:112)
              > >> at CHandler.doPost(CHandler.java:133)
              > >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
              > >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              > >> at
              > >>
              >
              >weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.jav
              a
              > >> , Compiled Code)
              > >> at weblogic.servlet.ServletServlet.service(ServletServlet.java:46)
              > >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              > >> at
              > >>
              >
              >weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.jav
              a
              > >> , Compiled Code)
              > >> at
              > >>
              >
              >weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextIm
              p
              > >> l.java, Compiled Code)
              > >> at
              > >>
              >
              >weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextIm
              p
              > >> l.java, Compiled Code)
              > >> at
              > >>
              >
              >weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContex
              t
              > >> Manager.java, Compiled Code)
              > >> at
              > >weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java,
              > >> Compiled Code)
              > >> at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
              > >> Compiled Code)
              > >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              > >Code)
              > >>
              > >> --
              > >> IBOS, Inc.
              > >> Buyer Driven e-Commerce Solutions
              > >>
              > >> Wasiq Hasan
              > >> http://www.ibos.com
              > >> p. 877.464.IBOS
              > >> f. 714.685.3988
              > >>
              > >>
              > >
              > >
              >
              

  • Subclassing via XML: IFS-30002

    Hi,
    I have a problem subclassing via XML files:
    After having created a new class, and deleted it (with iFS Manager), I can't reload an other class with the same name (IFS-30002:Unable to create new LibraryObject)
    thanks,
    Xavier

    I did my subclassing through the Web interface, so I can't catch the exception.
    But JWS gives some info:
    javawebserver: oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObje
    ct
    javawebserver:
    javawebserver: at java.lang.Throwable.<init>(Compiled Code)
    javawebserver: at java.lang.Exception.<init>(Compiled Code)
    javawebserver: at java.sql.SQLException.<init>(SQLException.java:43)
    javawebserver: at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
    javawebserver: at oracle.jdbc.oci8.OCIDBAccess.check_error(Compiled Code)
    javawebserver: at oracle.jdbc.oci8.OCIDBAccess.executeFetch(Compiled Code)
    javawebserver: at oracle.jdbc.driver.OracleStatement.executeNonQuery(Compiled Code)
    javawebserver: at oracle.jdbc.driver.OracleStatement.doExecuteOther(Compiled Code)
    javawebserver: at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(Compiled Code)
    javawebserver: at oracle.jdbc.driver.OracleStatement.doExecute(Compiled Code)
    javawebserver: at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Compiled Code)
    javawebserver: at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(Compiled Code)
    javawebserver: at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatem
    ent.java)
    javawebserver: at oracle.ifs.server.S_LibraryObject.insertRow(S_LibraryObject.java:2789)
    javawebserver: at oracle.ifs.server.S_LibraryObject.insertRows(Compiled Code)
    javawebserver: at oracle.ifs.server.OperationState.executeAtomicOperations(Compiled Code)
    javawebserver: at oracle.ifs.server.S_ClassObject.extendedPostInsert(Compiled Code)
    javawebserver: at oracle.ifs.server.S_LibraryObject.postInsert(S_LibraryObject.java:1344)
    javawebserver: at oracle.ifs.server.OperationState.executeAtomicOperations(Compiled Code)
    javawebserver: at oracle.ifs.server.S_LibraryObject.createInstance(S_LibraryObject.java:2
    351)
    javawebserver: at oracle.ifs.server.S_LibrarySession.newLibraryObject(S_LibrarySession.ja
    va:6596)
    javawebserver: at oracle.ifs.server.S_LibrarySession.newSchemaObject(S_LibrarySession.jav
    a:6707)
    javawebserver: at oracle.ifs.server.S_LibrarySession.newSchemaObject(S_LibrarySession.jav
    a:6689)
    javawebserver: at oracle.ifs.server.S_LibrarySession.DMNewSchemaObject(S_LibrarySession.j
    ava:6515)
    javawebserver: at oracle.ifs.beans.LibrarySession.DMNewSchemaObject(LibrarySession.java:7
    168)
    javawebserver: at oracle.ifs.beans.LibrarySession.NewSchemaObject(LibrarySession.java:476
    9)
    javawebserver: at oracle.ifs.beans.LibrarySession.createSchemaObject(LibrarySession.java:
    2731)
    javawebserver: at
    javawebserver: at
    javawebserver: at
    javawebserver: at
    javawebserver: at
    javawebserver: at
    javawebserver: at oracle.ifs.utils.common.ParserHelper.parseExistingDocument(ParserHelper
    .java:352)
    javawebserver: at oracle.ifs.clients.webui.FileUtils.parseAndDelete(FileUtils.java:714)
    javawebserver: at ifs.webui._jsps._upload2._jspService(Compiled Code)
    javawebserver: at oracle.ifs.protocols.http.jsp.pagecompile.jsp.runtime.HttpJspBase.servi
    ce(HttpJspBase.java:94)
    javawebserver: at javax.servlet.http.HttpServlet.service(Compiled Code)
    javawebserver: at oracle.ifs.protocols.http.jsp.IfsJspServlet.runServlet(IfsJspServlet.ja
    va:865)
    javawebserver: at oracle.ifs.protocols.http.jsp.IfsJspServlet.processJspPage(Compiled Cod
    e)
    javawebserver: at oracle.ifs.protocols.http.jsp.IfsJspServlet.service(IfsJspServlet.java:
    240)
    javawebserver: at javax.servlet.http.HttpServlet.service(Compiled Code)
    javawebserver: at com.sun.server.ServletState.callService(Compiled Code)
    javawebserver: at com.sun.server.ServletManager.callServletService(Compiled Code)
    javawebserver: at com.sun.server.ProcessingState.invokeTargetServlet(Compiled Code)
    javawebserver: at com.sun.server.http.HttpProcessingState.execute(Compiled Code)
    javawebserver: at com.sun.server.http.stages.Runner.process(Compiled Code)
    javawebserver: at com.sun.server.ProcessingSupport.process(Compiled Code)
    javawebserver: at com.sun.server.Service.process(Compiled Code)
    javawebserver: at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code)
    javawebserver: at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code)
    javawebserver: at com.sun.server.HandlerThread.run(Compiled Code)
    javawebserver:
    The xml file I upload doesn't seem to be responsible for problems, but here it is:
    <?xml version='1.0' encoding = 'ISO-8859-1' standalone='yes'?>
    <!--Module.xml-->
    <CLASSOBJECT>
    <Name>Module</Name>
    <Description> Module </Description>
    <Superclass Reftype='name'>Document</Superclass>
    <BeanClassPath>ifs.demo.topdoc.Module</BeanClassPath>
    <Attributes>
    <ATTRIBUTE>
    <Name> Donnees </Name>
    <DataType> String </DataType>
    <DataLength> 128 </DataLength>
    </ATTRIBUTE>
    <ATTRIBUTE>
    <Name> ApplicabiliteDocumentaire </Name>
    <DataType> String </DataType>
    <DataLength> 12 </DataLength>
    </ATTRIBUTE>
    <ATTRIBUTE>
    <Name> UniteDeProduction </Name>
    <DataType> String </DataType>
    <DataLength> 12 </DataLength>
    </ATTRIBUTE>
    <ATTRIBUTE>
    <Name> Langue </Name>
    <DataType> String </DataType>
    <DataLength> 5 </DataLength>
    </ATTRIBUTE>
    </Attributes>
    </CLASSOBJECT>
    Since the corresponding bean has to be deployed afterward, it must not have any influence...
    thanks

  • Get all values from multi select in a servlet

    Hello,
    I have a multi <select> element in a HTML form and I need to retrieve the values of ALL selected options of this <select> element in a servlet.
    HTML code snippet
    <select name="elName" id="elName" multiple="multiple">
    Servlet code snippet
    response.setContentType("text/html");
    PrintWriter out = null;
    out = response.getWriter();
    String output = "";
    String[] str = request.getParameterValues("elName");
    for(String s : str) {
    output += s + ":";
    output = output.substring(0, output.length()-1); // cut off last deliminator
    out.println(output);But even when selecting multiple options, the returned text only ever contains the value of the first selected option in the <select>
    What am I doing wrong? I'm fairly new to servlets
    Edited by: Irish_Fred on Feb 4, 2010 12:43 PM
    Edited by: Irish_Fred on Feb 4, 2010 12:44 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:14 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:26 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:26 PM
    Edited by: Irish_Fred on Feb 4, 2010 2:32 PM

    I am using AJAX.
    I will show you how I'm submitting the <select> values by showing you the flow of code:
    This is the HTML code for the <select> tag and the button that sends the form data:
    <form name="formMain" id="formMain" method="POST">
         <input type="button" id="addOpts" name="addOpts" value="Add Options" style="width:auto; visibility:hidden" onClick="jsObj.addOptions('servletName', document.getElementById('elName'))">
         <br>
         <select name="elName" id="elName" multiple="multiple" size="1" onChange="jsObj.checkSelected()">
              <option value="0"> - - - - - - - - - - - - - - - - </option>
         </select>
    </form>Note that the "visibility:hidden" part of the button style is set to "visible" when at least one option is selected
    Note that "jsObj" relates to a java script object that has been created when the web app starts ( The .js file is included in the .jsp <head> tag )
    The following code is taken from the file: "jsObj.js"
    jsObj = new jsObj();
    function jsObj() {
    //=================================================
         this.addOptions = function(url, elName) {
              var theForm = document.getElementById('formMain');          
              if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
                   xmlhttp=new XMLHttpRequest();
              } else { // code for IE6, IE5
                   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              url += this.buildQueryString(theForm.name);
              xmlhttp.open("POST",url,true);
              xmlhttp.send(null);
              xmlhttp.onreadystatechange=function() {
                   if(xmlhttp.readyState==4) { // 4 = The request is complete
                        alert(xmlhttp.responseText);
    //=================================================
    this.buildQueryString = function(formName) {
              var theForm = document.forms[formName];
              var qs = '';
              for (var i=0; i<theForm.elements.length; i++) {
                   if (theForm.elements.name!='') {
                        qs+=(qs=='')? '?' : '&';
                        qs+=theForm.elements[i].name+'='+escape(theForm.elements[i].value);
              return qs;
         //=================================================
    }And this is a code snippet from the "servletName" servlet:public synchronized void doGet(HttpServletRequest request,
              HttpServletResponse response) throws ServletException,IOException {
              PrintWriter out = null;
              try {
                   response.setContentType("text/html");
                   out = response.getWriter();
                   String output = "";
                   String[] values = request.getParameterValues("elName");
                   for(String s : values) {
                        output += s + ":";
                   output = output.substring(0, output.length()-1); // cut off last delimitor
                   out.println(output);
                   } catch (Exception e) {
         }So anyway, everthing compiles / works, except for the fact that I'm only getting back the first selected <option> in the 'elName' <select> tag whenever I select multiple options
    Edited by: Irish_Fred on Feb 7, 2010 10:53 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Open Jasper Report in new page using servlet

    Guys,
    Looks very simple but i am having problem making this process work. I am using 11.1.1.4
    This is my use case:
    - From a employee page, user clicks on a menu item to open report for current employee. I need to pass appropriate report parameters to servlet and open report into new page.
    I can successfully call servlet using commandmenuitem and set request parameters and call servlet from backing bean.... but that doesn't open report in a new page.... any way i can do this?
    Another option i tried was that using gomenuitem and setting target=blank but in that case i need to pass the parameter using servlet url which i like to avoid.(in case i need to pass many parameters in future) (also values will be set on page so i need to generate url when then click the menuitem...... so there are some hoops and loops i need to go through) I don't know a way to pass the request parameter using backing bean to servlet... i don't think it is possible.
    Those are the two approaches i tried.
    If you have any better approach...I would appreciate if you can let me know. (i have searched on internet for two days now.... for the solution)
    -R
    Edited by: polo on Dec 13, 2011 7:22 AM

    Hi,
    Hope following will useful
    http://sameh-nassar.blogspot.com/2009/10/using-jasper-reports-with-jdeveloper.html
    http://www.gebs.ro/blog/oracle/jasper-reports-in-adf/

Maybe you are looking for

  • Any help appreciated jsp...

    hi ive got a problem regarding jsp.... for starters i cant even view the jsp examples on the tomcat index page.... the servlet examples run fine and i can create my own servlets as well.. but when i try to create my own simple jsp page or run the exa

  • Exporting to Powerpoint 2007 using the 2007 formats

    I'm currently running Xcelsius 2208 and Office 2007.  Because I was the first to get Office 2007 I've had to continue saving in the Office 97-2003 format (.ppt).  Now that everyone has caugth up if I save in the .pptx or .pptm format the .swf appears

  • No Dynamic navigation iView inside a room

    Hi My problem is that when i create a room based on SAP_Project_template_2 the iViews that were in navigation panel like my rooms, room menbers, related rooms doesn't appear. I've checked if the dynamic, related links... iviews in the innerpage that

  • More info on plugin API "slapi_be_get_instance_info"

    Hi How can I read the info returned by the plugin API "void * slapi_be_get_instance_info(Slapi_Backend *be)". thanks, sanjay

  • Can I use facetime on my windows xp machine?

    How do can I use facetime on my windows xp machine.  I have friends that have ipads and want to know if I can communicate w/them via facetime.