Bad to import servlets?

I am developing an application that makes use of several servlets. However, there are a few methods in one of the servlets that I would like to use at different points from the application. This method does db checks so, I don't want to duplicate the method.
My understanding of servlets, is that they are constant running applications on that run 1 instance of itself on the server. So, if I import that class, am I creating another instance of that class, or am I using the already created instance of it?
Also, are there any reasons not to do this?
Thanks,
Matt

I was thinking of that, but then that is one instance of each class per user. Would it be better to use an EJB for this? Since then I am getting one instance of the class, the load would be less on the server, right? Unless synchronization would slow the process down and make the difference negligable.

Similar Messages

  • Problems importing servlet classes

    When I try to compile a bean which has import statements for importing servlet classes, I get the message that the class is not found in import when I compile the code. I have all these class files and I'm not sure whether I've placed them aptly. Please give me the details about placing the servlet classes and configuring my javac to import these classes.
    Thanks!

    If you place your classes in the %JAVA_HOME%/jre/lib/ext, they will be automatically accepted by the javac and the java. But, depending on the classes you use, it would be better to include them in %application path%/WEB-INF/lib, so they will only be used by that application.

  • BADI implementation for importing values from excel

    Hi All,
    This is my first ever post in this forum and I am a newbie in ABAP. I have this doubt rather I would say I am stuck while implementing a BADI for importing Excel values.
    We have a BADI for 'Upload flow rate' button which is built on PLM frame work on webdynpro.
    The requirement is that after clicking the ' 'Upload flow rate'  button it should prompt for selecting the excel file and after selecting that file, the values should get loaded to the internal table.
    what I have tried till now is that
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
       EXPORTING
        I_FIELD_SEPERATOR    =
         I_LINE_HEADER        = 'X'
         I_TAB_RAW_DATA       = IT_RAW       " WORK TABLE
         I_FILENAME           = 'C:\abcdl\book1.xlsx'
       TABLES
         I_TAB_CONVERTED_DATA = lt_result
       EXCEPTIONS
         CONVERSION_FAILED    = 1
         OTHERS               = 2.
    IF SY-SUBRC <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endmethod.   
    I tried hard coding the xls file but it gives error as 'CNTL_error' which I guess is a known issue when we use this function module in webdynpro.
    So how can I get the values from excel without using datasource and just by hard coding the file name?
    Regards,
    Anand
    Anand

    There is no solution to this - SAP have said they will re-introduce this functionality, but they havent said when (as far as I am aware).
    However, we have developed a workaround (for Web reports anyway), let me know if you are interested.
    Patrick

  • Form 10g import an servlet

    Hi
    Everyone
    I'm trying to import an servlet on form10g, i set the jar file o classpath and when i
    import the classe i´m getting the following error:
    Importing Class br.com.blobdocumento.view.WordBlob...
    Exception occurred: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
    Any ideia?
    I think form dosen´t import servlet classe.
    Thanks
    7gxj22sG

    Hello Zhxiang,
    If your image file (abc.jpg) exists on server machine then you can use following built in
    READ_IMAGE_FILEOr if you want to get this file from any other machine other than server then you need to configure WebUtil and use following package
    Client_Image
    please mark if it help you or correct
    Regards,
    Danish

  • Custom exit or badi for changing the user fields in operation of process order

    Hi all
        I want to find a exit or badi to set default value to the user fields in operation of process order when COR1.
        I have tried exit 'PPCO0001', but this exit is call after commit work, so I can not change any thing
        I also tried to use badi 'workorder_update', 'before_update', but all parameters in this BADI are importing, can't be changed, I've tried to change it and then program dump.
        Do you have any solution for this question?
    Thanks

    Do a Implicit Enhancement at the PBO of this subscreen.

  • Importing to LR and Moving Source Files?

    Is it "bad" to import to LR and then move the source files?  AKA I want to import to LR from files stored locally on my machine and then move that local folder at a later time to an external drive.  Will this cause problems and or is there something specific to do so it won't (cause problems?)
    Thanks.

    teekv1 wrote:
    Is it "bad" to import to LR and then move the source files?  AKA I want to import to LR from files stored locally on my machine and then move that local folder at a later time to an external drive.
    Why don't you just import to that external drive and eliminate a step? Seems to me that eliminating the step of moving the photos at a later time makes your work simpler.

  • How to import Data (For Dummies) into a table

    I have a excel spreadsheet that is an export of an oracle database table. I want to now import that data into another Oracle Database (same table and format). What is the best way to do that. Someone told me t ouse SQL*Loader, but that is not as straightforward as I had hoped. I tried to use access, but I got an invalid argument on one attempt, and a Reserved Error (-2007) on another attempt.
    Any help would be appreciated.

    Now it seemed to run w/o the INSERT error this time, but now when I look at the log, i see the following errors:
    SQL*Loader: Release 9.2.0.1.0 - Production on Tue Jun 27 10:29:01 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Control File: sqlloader-ctrl.ctl
    Data File: import.txt
    Bad File: import.bad
    Discard File: none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 256000 bytes
    Continuation: none specified
    Path used: Conventional
    Table INQUIRIES, loaded from every logical record.
    Insert option in effect for this table: APPEND
    Column Name Position Len Term Encl Datatype
    INQUIRYID FIRST * WHT O(") CHARACTER
    PERSONID NEXT * WHT O(") CHARACTER
    FIRSTNAME NEXT * WHT O(") CHARACTER
    LASTNAME NEXT * WHT O(") CHARACTER
    ADDRESS1 NEXT * WHT O(") CHARACTER
    ADDRESS2 NEXT * WHT O(") CHARACTER
    ADDRESS3 NEXT * WHT O(") CHARACTER
    CITY NEXT * WHT O(") CHARACTER
    STATE NEXT * WHT O(") CHARACTER
    ZIPCODE NEXT * WHT O(") CHARACTER
    COUNTRY NEXT * WHT O(") CHARACTER
    SEX NEXT * WHT O(") CHARACTER
    MATRICDATE NEXT * WHT O(") CHARACTER
    DEGREEPROGRAM NEXT * WHT O(") CHARACTER
    PACKETCODE NEXT * WHT O(") CHARACTER
    SOURCECODE NEXT * WHT O(") CHARACTER
    NONUS NEXT * WHT O(") CHARACTER
    DUPLICATE NEXT * WHT O(") CHARACTER
    EMAIL NEXT * WHT O(") CHARACTER
    INQUIRYDATE NEXT * WHT O(") CHARACTER
    NOTES NEXT * WHT O(") CHARACTER
    GOODCANDIDATE NEXT * WHT O(") CHARACTER
    POSTED NEXT * WHT O(") CHARACTER
    LABELPRINTED NEXT * WHT O(") CHARACTER
    PHONE NEXT * WHT O(") CHARACTER
    PERMANENTRESIDENCE NEXT * WHT O(") CHARACTER
    LABELPRINTDATE NEXT * WHT O(") CHARACTER
    LASTMODIFIED NEXT * WHT O(") CHARACTER
    MODIFYINGUSER NEXT * WHT O(") CHARACTER
    APPRECEIVED NEXT * WHT O(") CHARACTER
    INTERVIEWED NEXT * WHT O(") CHARACTER
    INTERVIEWEDDATESCHEDULED NEXT * WHT O(") CHARACTER
    INTERVIEWEDDATE NEXT * WHT O(") CHARACTER
    INTERVIEWEDBY NEXT * WHT O(") CHARACTER
    INTERVIEWEDRATING NEXT * WHT O(") CHARACTER
    DUALDEGREE NEXT * WHT O(") CHARACTER
    Record 1: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 2: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 3: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 4: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 5: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 6: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 7: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 8: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 9: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 10: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 11: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 12: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 13: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 14: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 15: Rejected - Error on table INQUIRIES, column PERMANENTRESIDENCE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 16: Rejected - Error on table INQUIRIES, column PHONE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 17: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 18: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 19: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 20: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 21: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 22: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 23: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 24: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 25: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 26: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 27: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 28: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 29: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 30: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 31: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 32: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 33: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 34: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 35: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 36: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 37: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 38: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 39: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 40: Rejected - Error on table INQUIRIES, column MODIFYINGUSER.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 41: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 42: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 43: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 44: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 45: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 46: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 47: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 48: Rejected - Error on table INQUIRIES, column LASTMODIFIED.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 49: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 50: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 51: Rejected - Error on table INQUIRIES, column LABELPRINTDATE.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    MAXIMUM ERROR COUNT EXCEEDED - Above statistics reflect partial run.
    Table INQUIRIES:
    0 Rows successfully loaded.
    51 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 250776 bytes(27 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 51
    Total logical records rejected: 51
    Total logical records discarded: 0
    Run began on Tue Jun 27 10:29:01 2006
    Run ended on Tue Jun 27 10:29:01 2006
    Elapsed time was: 00:00:00.21
    CPU time was: 00:00:00.05
    So now i need to do some google searching to see what those erros mean...... ahh the life of IT... ya gotta love it

  • User exit or BADI for determining the output type inme21n orme22n

    hi all,
         i have used the user exit 'exit_sapmm06e_012', it is getting triggered in me22n, i am able to check whether the vendor email id is present or not, but this is happening all the time that is even when the user dont want to send a email to the vendor i.e. he just wants to print the purchase order, even at that time this user exit is getting triggered and giving a message that the vendor email id is not maintained.
      the reson why this is happening is there is no import parameter to this user exit which gives the "medium of data transfer"  the user has entered. if i get this parameter visible inside the user exit, then i can check this parameter inside the user exit and do the required operation.   i checked up with all the user exits in "me" package and even the other related packages but none of them is getting triggered,
      do antone know a user exit or badi which imports this parameter and also gets triggered at the time of creation of purchase order.
      plz give me a solution.
    regards,
    santosh.

    Hi Santosh,
    Why not continue the other post ?
    Anyway, i am not sure to understand your requirement.
    Do you want to check that vendor email exist and issue a message only if email is not available ?
    Kind regards,
    Yann

  • Import command in OO

    I need to import some tables in badi IF_EX_ CUSTOMER_ADD_DATA ~ CHECK_ALL DATE, to save some tables that I use the screens. I used the export code on the screens and badi in import command, but it seems the import field is not supported in OO.
    Anyone know any way to pass these tables to badi?

    Hi Lucas,
    Import & Export statements are supported in OO context! There is another syntax of Import & Export which allows to achieve the necessary i.e,
    EXPORT <var> FROM <var>
    TO MEMORY ID 'VAR'.
    IMPORT <var> TO <var>
    TO MEMORY ID 'VAR'.
    as compared to earlier syntax
    Sample Code
    " Since a lot of internal tables would have been declared with OCCURS addition
    " we can declare our own internal table and pass it along for IMPORT.
    DATA: IT_EXPORT TYPE STANDARD TABLE OF ITAB.
         DELETE FROM MEMORY ID 'IT_EXPORT'.
         IT_EXPORT[] = ITAB[].
         EXPORT IT_EXPORT
         FROM IT_EXPORT
         TO MEMORY ID 'IT_EXPORT'.
    In Calling Program you can write -
    " Please note here your structure for IT_IMPORT should be same as IT_EXPORT. 
         IMPORT IT_EXPORT
         TO IT_IMPORT
         FROM MEMORY ID 'IT_EXPORT'.
    Cheers,
    Varun

  • Importing a class from another context?

    Hi JSP techies,
    Im using RESIN and having a simple problem of figuring out how to import classes from another context, if Im using the right word.
    ie.
    My .jsp files are under $home/resin/doc/test dir. And in the jsp file, I would like to import a servlet class or a plain java class. But the servlet classes and all other classes are located under $home/resin/webapps/project/WEB-INF/classes/a/b/c
    Hence when I say
    <% page import="a.b.c.*" %>
    I get an error saying "a" not found.
    1. When I say "servlet classes are in a different CONTEXT", is that right? or is it just another directory?
    2. How can I make the jsp file import the classes from the servlets class path?
    Note: Ofcourse, when I copy the package to the
    $home/resin/doc/WEB-INF/classes dir, everything works fine. But thats simply not an efficient way to get around. Could anyone clear my doubts on this regd.?
    Thanks in advance.
    Arun

    Oh... I get it now. I'm sorry, I had you poorly misunderstood. You are trying to import servlets from another web app or servlet context. I would suggest you put servlets that are common to all web apps in the system classpath and not tie them to any particular web app. In other words create a package directory structure from the system's root directory or any where outside of any web apps and point the system classpath to the beginning of that directory structure. I have a similar thing going with Tomcat. I have a folder in my root called Java_Class which is in my classpath. I build all common utilities in this directory. So I have a com/craig/web structure that holds my AppServlet which is in package com.craig.web. This servlet is visible to all web apps via the Windows classpath. Servlets particular to an application like say an MusicOrderProcess servlet would reside in a package under the webserverhome/webapps/MusicStore/WEB-INF/classes directory where webserver home is the home directory of the webserver you are using. I've tested this across webservers as well (orionserver and Tomcat) and it works.
    From the prompt you include in your posts I am guessing that you are running on UNIX. Move your common servlets out of their respective web apps and into a common directory structure. Configure the UNIX $CLASSPATH (or is it $classpath?) environment variable to point to this sturcture and you'll be on your way!
    Post again if you have more questions!

  • Error in invoking servlet from JSP

    Hi - again!
    after being thoroughly reprimanded for posting on the wrong board, and hence seeing the error in my ways, all help greatly appreciated....
    I have read elsewhere that it is possible to call a servlet (which produces HTML) from within a JSP, thus keeping a nice clean MVC paradigm and making it easier for non-java people to design the front-end.
    I am having difficulty getting it to work and any help is much appreciated:
    My servlet (Mole):
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                out.write("###some html stored in DB#####");
            } finally {
                out.close();
        }my JSP:
    <jsp:include page="Mole" flush="false"></jsp:include>the error I get
    Internal error flushing the buffer in release()
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.io.IOException: Stream closed
            at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:257)
            at org.apache.jasper.runtime.JspWriterImpl.clearBuffer(JspWriterImpl.java:206)
            at org.apache.jsp.CMS.services_jsp._jspService(services_jsp.java from :176)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
            at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
            at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
            at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
            at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)Any pointer as to what I am donig wrong?
    many thanks

    in your web.xml
    <servlet>
    <servlet-name>Mole</servlet-name>
    <servlet-class>srvlt.Mole</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Mole</servlet-name>
    <url-pattern>/Mole</url-pattern>
    </servlet-mapping>
    package srvlt;
    // Import servlet packages
    import javax.servlet.*;
    import javax.servlet.http.*;
    // Import other Java packages
    import java.io.*;
    public class Mole extends HttpServlet {
            public void init() throws ServletException {}
            public void doGet(HttpServletRequest request, HttpServletResponse response)
                    throws ServletException, IOException {
                response.setContentType("text/html;charset=UTF-8");
                PrintWriter out = response.getWriter();
                try {
                    out.write("###some html stored in DB#####");
                } finally {
                    out.close();
    }in your jsp
    <jsp:include page="/Mole" flush="false"></jsp:include>

  • Servlet cannot access bean

    Hi all,
    I am having some problems accessing JavaBeans from my servlets, but I can access them from my JSP page(i used the import command, <%@ page import="servlets.myBeans.login.User" %>, and it works).
    I have placed my User bean in the following package
    \webapps\ROOT\WEB-INF\classes\servlets\myBeans\login
    Here's the java code for User Bean
    package servlets.myBeans.login;
    * A simple Java Bean for users.
    public class User implements java.io.Serializable{
    private String username = null;
    private String password = null;
    public User() {}
    public User (String u, String p) {
         username = u;
         password = p;
    public String getUsername() {
         return username;
    public void setUsername(String username) {
         this.username = username;
    public String getPassword() {
         return password;
    public void setPassword(String password) {
         this.password = password;
    public String toString() {
         return username + ":" + password;
    This compiles and creates a class file.
    My servlet LoginControlServlet is in the following path
    \webapps\ROOT\WEB-INF\classes\servlets
    when I try to compile this servlet i get the following errors
    C:\jakarta-tomcat-4.1.1.12-LE\jakarta-tomcat-4.1.24-LE-jdk14\webapps\ROOT\
    WEB-INF\classes\servlets\LoginControlServlet.java:18:
    cannot resolve symbol
    symbol : class User
    location: class servlets.LoginControlServlet
    User up = (User)session.getAttribute("up");
    ^
    C:\jakarta-tomcat-4.1.1.12-LE\jakarta-tomcat-4.1.24-LE-jdk1\webapps\ROOT
    \WEB-INF\classes\servlets\LoginControlServlet.java:18:
    cannot resolve symbol
    symbol : class User
    location: class servlets.LoginControlServlet
    User up = (User)session.getAttribute("up");
    ^
    C:\jakarta-tomcat-4.1.1.12-LE\jakarta-tomcat-4.1.24-LE-jdk1\webapps\ROOT
    \WEB-INF\classes\servlets\LoginControlServlet.java:27:
    cannot resolve symbol
    symbol : class User
    location: class servlets.LoginControlServlet
    up = new User(user,pass);
    ^
    3 errors
    I have already included the \webapps\ROOT\WEB-INF\classes in my class path
    infact, I have even included \webapps\ROOT\WEB-INF\classes\servlets and
    \webapps\ROOT\WEB-INF\classes\servlets\myBeans\login in my classpath.
    Any ideas, as to why I am having the above errors.
    thanks,
    manish

    I think it's pretty much got to be a compile time classpath problem. Either your bean is compiling to a funny place, or you classpath is wrong when you compile the servlet. Probably the latter if your jsp picks it up OK.
    The entry in the classpath should be
    <tomcat directory>/webapps/ROOT/WEB-INF/classes
    Check the syntax carefully.
    putting package directories on your classpath can only confuse things.
    Make sure that ...../webapps/servlets/myBeans/login/User.class exists.

  • Import itab in memory in user exit

    I am trying to export an internal table to memory in BADI and import from memory into an internal table in User exit . It looks like the export works, but when I import in program2, the internal table is empty. Even when the command returns sy-subrc = 0.
    Has anyone made this work?
    Program1
    DATA: wa_medoc LIKE MEASUREMENT_DOC.
    DATA: WA_TEXT LIKE LINE OF CE_MEASUREMENT.
    TYPES: BEGIN OF obj_line,
                MEASUREMENT_POINT(12) ,
                READING_DATE(8),
                READING_TIME(6),
                RECORDED_UNIT(6),
                LONG_TEXT(16384),
                END OF obj_line.
    DATA: obj_tab_wa TYPE obj_line.
    Move: MEASUREMENT_DOC to wa_medoc.
    LOOP AT CE_MEASUREMENT INTO WA_TEXT.
    MOVE:  wa_medoc-MEASUREMENT_POINt TO obj_tab_wa-MEASUREMENT_POINT,
           wa_medoc-READING_DATE  TO obj_tab_wa-READING_DATE ,
           wa_medoc-READING_TIME  TO obj_tab_wa-READING_TIME,
           wa_medoc-RECORDED_UNIT TO obj_tab_wa-RECORDED_UNIT,
           WA_TEXT-LONG_TEXT TO obj_tab_wa-LONG_TEXT.
    EXPORT obj_line FROM  obj_tab_wa  TO MEMORY ID 'SQ'.
    ENDLOOP.
    Program 2 : User exit   EXIT_SAPLIMR0_001  and include ZXMRCU01.
    TYPES: BEGIN OF obj_line,
                MEASUREMENT_POINT(12) ,
                READING_DATE(8),
                READING_TIME(6),
                RECORDED_UNIT(6),
                LONG_TEXT(16384),
                END OF obj_line.
    DATA: obj_tab_wa TYPE obj_line.
    IMPORT obj_line FROM  MEMORY ID 'SQ'.

    Try this......
    Program1
    DATA: wa_medoc LIKE MEASUREMENT_DOC.
    DATA: WA_TEXT LIKE LINE OF CE_MEASUREMENT.
    TYPES: BEGIN OF obj_line,
    MEASUREMENT_POINT(12) ,
    READING_DATE(8),
    READING_TIME(6),
    RECORDED_UNIT(6),
    LONG_TEXT(16384),
    END OF obj_line.
    DATA: obj_tab_wa TYPE obj_line.
    data: obj_tab_tab type standard table of obj_line.
    Move: MEASUREMENT_DOC to wa_medoc.
    LOOP AT CE_MEASUREMENT INTO WA_TEXT.
    MOVE: wa_medoc-MEASUREMENT_POINt TO obj_tab_wa-MEASUREMENT_POINT,
    wa_medoc-READING_DATE TO obj_tab_wa-READING_DATE ,
    wa_medoc-READING_TIME TO obj_tab_wa-READING_TIME,
    wa_medoc-RECORDED_UNIT TO obj_tab_wa-RECORDED_UNIT,
    WA_TEXT-LONG_TEXT TO obj_tab_wa-LONG_TEXT.
    append obj_tab_wa to obj_tab_tab.
    ENDLOOP.
    if sy-subrc = 0.
    EXPORT obj_tab_tab[] TO MEMORY ID 'SQ'.
    endif.
    Program 2 : User exit EXIT_SAPLIMR0_001 and include ZXMRCU01.
    TYPES: BEGIN OF obj_line,
    MEASUREMENT_POINT(12) ,
    READING_DATE(8),
    READING_TIME(6),
    RECORDED_UNIT(6),
    LONG_TEXT(16384),
    END OF obj_line.
    DATA: obj_tab_wa TYPE obj_line.
    data: obj_tab_tab type standard table of obj_line.
    IMPORT obj_tab_tab[] FROM MEMORY ID 'SQ'.
    Edited by: Joyjit Ghosh on Jul 8, 2008 2:22 PM

  • The import collides with another import statement

    What is this? Why this happens? I've just imported a class name to the JSP that has much more level imports. This JSP isn't even validated. I don't wanna rename my class has the same name as in one of the jar files on the class path.

    nromanc wrote:
    Skipping imports is not possible."skipping" as in not having any. Not possible? Why?
    More naturally fully qualified names could be used in the rarely used practices.
    much more typing and increase in the file size happens.The size of your source file might increase, yes.
    Wild-cards also lead to not optimized imports hence bad performance.Imports are a compile-time only construct. Any performance impact import wildcards might have are limited to compile-time.
    I didn't find correct answer in an old thread.
    I've posted correct answer but a moderator is blocked it.The reason for blocking it is given as "your post as it doesn't make much sense, and detracts from the good advice already given and well received."
    I do not know what you wrote. I cannot see blocked posts. I have no reason to doubt the reason given.

  • Check in BAdi if delivery processed with IDOC or with transaction

    Hello to everyone!
    I have encountered an issue and hopefully you could help me in solving this.
    I have developed an enhancement (BAdi) in delivery processing.
    Every time delivery is being changed - method is triggered and line item is being validated against some conditions
    But now I would like to prevend BAdi from being launched when delivery comes in IDOC.
    For this purpose I just put a simple condition in BAdi method:
    IF sy-batch NE 'X'.
         //here perform validation.
    ENDIF.
    Unfortunately validation is still performed. Looks like when IDOC is being sent to ECC from PI, sy-batch is empty.
    I would also like to prevent validation from being launched when IDOC re-processed manually (BD87 or sth.)
    But then sy-batch is also empty.
    Could you please advise some solution for this?
    How to check in BAdi if delivery is being processed with IDOC or with transaction (VL32N, VL31N, VL32, ...)
    I would appreciate every comment on this.
    Kind Regards,
    P.
    Edited by: Piotr Wojciechowski on Jul 28, 2011 8:59 PM

    Hi Max,
    Thanks a lot for your reply!
    Yes, indeed, IDOC is processed by FModule IDOC_INPUT_DELVRY.
    You mean I should for example
    find some place in this FModule (exit/enhancement point/...)  where I could put-Z-code
    and raise a delivery number (or just some flag) to memory (EXPORT TO MEMORY..)
    and later on catch it from memory in my BAdi method (IMPORT FROM MEMORY ...)
    to check if delivery processed by IDOC/not IDOC ?
    Kind Regards,
    Piotr.
    PS. Maybe you also have some idea how to debug such communication triggered from PI to ECC?
    I have posted this in separate [thread|PI-ECC connection (IDOC scenario), how to debug? (External BP);.

Maybe you are looking for

  • Implementing badi ME_GUI_PO_CUST

    Hi, I created implementation for the badi ME_GUI_PO_CUST. In the method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE I've written the below code DATA: ls_subscriber LIKE LINE OF re_subscribers.   CHECK im_application = 'PO'.   CHECK im_element     = 'HEADER'.   CL

  • Recordsets per Message not working

    I found that Recordsets per Message will split the source message into multiple messages and process them separately.  This will save my alot of time and is exactly what I need - but it does not work. I have in my sender file adapter the following pa

  • Search is not showing folder info in the results panel

    Hello, When I search for documents using UI search, the results panel contains following columns: Name,size,Last modifiied, description and status. What I need is directory column also. With out this it is very difficult for users to understand where

  • Uploading tool

    Hi, Could you please advise client’s questions as below? 1. Client want some utilities to help them to upload Intial balances GL, Vendor, Customer, Asset. Any excel format upload. 2. They want to copy GL accounts in production system from one co code

  • Udf in Banks - validate accountnumber

    Hello, In the Netherlands almost every accountnumber can be validate with a check digit formula. Some banks use this check digit formula and some banks don't. I would like add an udf in banks with a checkbox. When someone add a new accountnumber on t