Regarding servlet

I know java,,i nstalled tomcat,& i do one simple servlet program when i compile it doesn't compile & shows that javax,servlet not found error appeared..I set path as C:\Program Files\Java\jdk1.5.0_07\bin; & class path as +C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib.*;        but idoesn't compile whats the problem                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

regarding servlet
Posted: Jun 17, 2008 12:39 AM
I know java,,i nstalled tomcat,& i do one simple servlet program when i compile it doesn't compile & shows that javax,servlet not found error appeared..I set path as C:\Program Files\Java\jdk1.5.0_07\bin; & class path as +C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib.*; but idoesn't                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Regarding servlet exception

    Hi,
    while i am testing an application, which was deployed in weblogic , iam getting the folling error, pelase help , its littlebit urgent.
    <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@14d5aaf - appName: xxxxxxxxxx', name: 'xxxxxxxxxxxxxxxxxr', context-path: '/xxxxxxxxxx/xxxxxxxxxxxxxxxx spec-version: 'null', version: 'Default_Version'] Root cause of ServletException.
    java.lang.UnsatisfiedLinkError: Can't load library: /xxxxxxxxx/weblogic/java/jrockit_160_05/jre/lib/i386/xawt/libmawt.so
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1005)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    Truncated. see log file for complete stacktrace

    Hi,
    From the following exception, I think the issue could be related to the context path
    <[weblogic.servlet.internal.WebAppServletContext@14d5aaf - appName: xxxxxxxxxx', name: 'xxxxxxxxxxxxxxxxxr', context-path: '/xxxxxxxxxx/xxxxxxxxxxxxxxxx spec-version: 'null', version: 'Default_Version']
    Did you had a chance to check the context root matching and DD (deployment descitors). Also, can I hav the system out log or the server log after you had deployed the application!!
    regards,
    Zeno

  • Problem regarding servlets+ threads

    <meta http-equiv=\"refresh\"" " content=\"5\" ";URL=\"\">";
    Iam using meta refresh tag for refreshing browser for every 5 seconds.
    When i invoke doPost () then iam creating thread and for every 5 sec it calls doGet() .
    If i close browser then servlet is not invkoing but thread is running
    How to stop a thread when we close browser?

    iam using Tomcat
    <Connector acceptCount="100"
    connectionTimeout="20000"
    disableUploadTimeout="true" port="8080"
    redirectPort="8443" maxSpareThreads="75"
    maxThreads="150" minSpareThreads="25">
    </Connector>
    his is ok.Ignore my first post.
    Your problem has nothing to do with the containers thread management.
    Is there any way to excute following method
    Thread.currentThread().destroy(); or stop when i
    close browserPlease see malcolmmc's great post (i.e, the browser refresh is driving things - you shouldn't need a thread in the servlet).
    Servlets are blocking request / response based: When you've written a response, you're done. They are not connection based - and there isn't (and shouldn't be) any direct way to know when a connection has gone

  • Regarding servlets instance and client

    Hi
    Suppose 5 client programs are calling one servlets at a time.
    Then how many instance will create 1 or 5?
    if 1 then how 5 requests will be be processed

    Please read "SRV.2.2 Number of Instances" in the Servlet specification.

  • Problem regarding servlets

    what will be happen when we call destroy method in init method.

    Probably nothing smart, since both methods are supposed to be called by the
    servlet container. Why don't you try it and see?

  • Regarding Servlets

    I hope someone would give me an idea to point me in the right direction.
    Visualise a table. And each rows are dynamically populated (data as retrieved from a table in a database). The last two columns of the table is supposed to be an edit and delete link. They direct you to another page to do the respective actions. BUT how do we tell them which row of record it is?
    while (rs.next()){
    out.println("<tr>");
    for (int i=1; i<=numCols; i++) {
    out.print("<td>" + rs.getString(i) + "</td>" );
    } // end for
    out.print ("<td>[ <a href='controlpanel_edituser.html'>Edit</a> ]</td>");
    out.println("</tr>");
    } // end whileIs it possible to use a input field (such as button invisibly because i think buttons are not very pleasant looking) to indicate which row it is?
    Finally, when the page is redirected to the edit page, how can i populate the input fields quickly without having to query from the database again?
    Hope that this is clear enough. Thanks for reading. [how do you assign duke stars? i would if i could!]
    Edited by: alphabetical on Oct 4, 2007 4:13 PM

    Thanks for the advice. I've only had some (very little in fact) experience with servlets. I've tried using JSPs but they confuse me a great deal. -_- But i'm looking around at tutorials because increasingly i find what i'm doing extremely tedious. Thanks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Regarding Servlet Objects...

    Hello Everbody,
    Can anybody tell me how to keep alive Servlet object forever, i mean until Tomcat server is shutdown?
    Thanks in Advance
    Srinvas PV.

    The reason is: Servlet will do some tasks which
    are scheduled on some time and need to run after
    some specified time duration continuously forever
    until the server shuts down. The servlet will start
    some other class object to do the task. So to work
    properly of the class object, the servlet will also
    need to be alive.
    Then there is nothing to be worry about. A servlet is meant to be running continuously until server shutdown, or as long as the servlet container does not need to free memory.
    You may need to take some precautions though.

  • Regarding servlet(urgent)

    hello to all
    i recently installd the J2EE SDK to my system, and try to run a very small sevlet program. but as i start compilation i got so much error, these error is only because of "can not read servlet pakage", i have import it when i wrote code.
    i tried it to compile it everywhere (lib/bin/outside the folder). i chang the class path and path also. please give me reply to solve this problem
    varun seth
    09945051989

    You need to add the j2ee.jar in the classpath. Specify it explicitly while compiling
    javac -cp "<whatever>;<j2ee lib dir>\j2ee.jar" *.java

  • Doubts regarding a Servlet.

    few doubts regarding servlets :
    1. Can a servlet have a constructor ? - my answer is yes.
    2. is it mandatory that i should override the doGet() and doPost() methods ? Can I have a servlet(user defined servlet) without doGet() and doPost() methods ?
    3 Suppose I have a userdefined servlet that extends HttpServlet what are the methods that I mandatorily need to override in my user defined servlet ?
    4. In the below code :
    out.println(getServletContext().getInitParameter("adminEmail"); // assuming adminEmail is a context parameter name defined in web.xml.
    I read the explanation in HeadFirst as "Every Servlet inherits a getServletContext() method". I saw in the Servlet and ServletRequest api but didnt find this method there.
    I saw this method only in ServletConfig interface.
    out.println(getServletContext().getInitParameter("adminEmail"); is nothing but out.println(*this*.getServletContext().getInitParameter("adminEmail"); // whats this here, i mean on which object does the method get invoked ?

    1. Can a servlet have a constructor ? - my answer is yes.It must have a public default (no-args) constructor, provided either by you or the compiler. No other constructor will be used, so there's no point in writing any constructor as the compiler will do it for you.
    2. is it mandatory that i should override the doGet() and doPost() methods ?This question is answered in the [Servlet API|http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/index.html].
    Can I have a servlet(user defined servlet) without doGet() and doPost() methods ?This question is answered in the [Servlet API|http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/index.html].
    3 Suppose I have a userdefined servlet that extends HttpServlet what are the methods that I mandatorily need to override in my user defined servlet ?This question is answered in the [Servlet API|http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/index.html].
    I saw this method only in ServletConfig interface.Which is implemented by GenericServlet, which is the base class for all servlets.
    // whats this here, i mean on which object does the method get invoked ?'this' is what it always is. The current object.

  • When is it appropriate to use a servlet in a JSP/JSF environment?

    I have inherited a fairly old JSP-based application. I know that I need to update its technologies, in particular the use of AJAX so that I don't need to keep refreshing the page each time I want more data from the server. The problem is that I don't know a great deal about other technologies. There seem to be so many conflicting opinions about the way to go regarding servlets and JSP and JSF (and possibly JavaBeans). I am probably going to start using JSF and AJAX. I mention this to give you some background info. My real question is: when is best/appropriate to use a servlet? From what I have seen I do not want to use a servlet for generating HTML output - that seem just so last decade! But do they still have a good use over more modern technologies? Also, when is it appropriate to use JavaBeans? Are JavaBeans a thing of the past (or just plain inappropriate) for web applications?
    Regards,

    I suggest going to the bookstore and looking for a book on JSF and reading it cover to cover. It may tell you where servlets come into the picture (if at all). I suggest paying attention to MVC design that it discusses, and working through the examples before working on your project (assuming you have the time). Then creating a simple project and refactor it over and over to meet MVC.
    For your project, I suggest just doing ONE JSF page (and its underlying database access) and refactor it over and over again (MVC) before doing the other JSF pages. This way, you dont have to refactor 34 JSF pages to correct the same mistake appearing in all the pages (saves a LOT of time).
    I don't know enough about AJAX to really comment on it. However, I would ask myself if refreshing the JSF page is really enough of a concern for your end-users to make it worth while to use AJAX on this project.

  • Servlet intercommunication problem

    Hi,
    I have a problem regarding servlet intercommunication.
    What I m doing is : I have an HTML form in which user enters some data and submits it. Servlet_1 is called , it gets all the parameters and displays all data in the form of an html form again. Now, if the user clicks on "SAVE" button , only then Servlet_2 should get called and that data should be stored in database .
    I m having problem while saving data.I just lose track of data entered by the user somewhere between the servlets.
    How should I get the data enetered by the user previously, and in what form I should store it to access it later on through any servlet?
    Please help.
    Regards
    Shweta

    I suggest other than showing the data on the HTML returned by Servlet_1, you created hidden values of the data submitted into the displayed form. In this way, the data would be resent to Servlet_2 when Save is pressed.
    Alternatively, you can use a Session to store the contents of the submitted information. (this will enable you to access it later on any servlet)

  • Problem in Servlet Compilation & Deployment

    Hi Friends,
    I have problem regarding Servlet Compilation & Deployment.
    At the time of compilation gives error message "import javax.servlet.* is not a recognize package.
    My J2ee Server gives FATAL Error it says it should be work on JDK1.2 or later.
    My JDK is :-j2sdk1.4.2_04
    MY J2EE Server is:-j2sdkee1.2.1
    My Servlet Runner is:-JSDK2.0
    My Java Enviorment is:- Version 1.5.0 (build 1.5.0_04-b05)
    Path setting is:-
    Class Path=C:\j2sdk1.4.2_04\lib;C:\j2sdkee1.2.1\lib\j2ee.jar;C:\JSDK2.0\lib
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=DCL-04
    ComSpec=C:\WINNT\system32\cmd.exe
    Please help me and give the desired result as soon as you all can
    Your's Harish
    Thanks

    At the time of compilation gives error message "import javax.servlet.* is not a recognize package.You have to include servlet.jar or j2ee.jar in the classpath when compiling.
    My JDK is :-j2sdk1.4.2_04
    My Java Enviorment is:- Version 1.5.0 (build 1.5.0_04-b05)Why are the versions of your JDK and Java runtime environment different? Why are you not using Java 5 to compile and run everything?
    Class Path=C:\j2sdk1.4.2_04\lib;C:\j2sdkee1.2.1\lib\j2ee.jar;C:\JSDK2.0\libIf this is an environment variable, it should be "classpath", not "Class Path" with a space in between.

  • Servlet to JSP forward issue

    I'm currently developing an app where I use a servlet as the controller and it forwards everything to a jsp for viewing. When I run the jsp as a standalone everything works fine, all of my javascript and css code. When I forward to it, all of my javascript code and css gets lost. Has anyone seen anything like this or have an explanation? Any help would be appreciated.
    Thanks,
    Mike

    Have you tried a different brower or view its textual response with telnet? there are some restricitons regarding servlet outputstream when forward is used (see Servlet spec 2.4 Section SVR.8.4, JSP Spec 2.0 section JSP.5.5). Any server log and stack trace and testcase will be helpful.

  • How can i know the servlet is running or not?

    Hi all,
           I have a doubt regarding servlet. I created one servlet and deployed in server. Now i called (RUN) the servlet from the browser. And it is running. Now can i know that the servlet is running or not in the server without seeing in the browser. Can we know the status of the servlet with its URL in the server whether it is running or not?
             Let me explain my problem. In my servlet it will run continously read one table and  do some operation depending on the entries in that table. Now i called the servlet from the browser. After some time i closed the browser. If browser is there i can know whether servlet is running or not. But now how can i know that servlet is running or not. Becoz eventhough we closed the browser the servlet will run in the background. How can i achieve this?
    Thanks and Regards,
    VJR.

    Hi!
    With first call, the servlet will be loaded, and it remains so until server-shutdown, but you need a timer-mechanism execute method calls continuously.
    Regards,
    Thomas

  • Invoking servlets in tomcat 4.1

    Hi..
    Regarding servlets and jsp i have some basic questions
    1. how to compile servelts , either with j2ee.jar of j2sdkee or servlet.jar of tomcat.
    2. where do i need to set the classpath, means either in environmnet variable or autoexec.bat or both, HOW TO SET THE CLASSPATH
    3. after successful compilation where to place the soruce code and class file, the exact location
    4. do i need to write my own web.xml file or do i need to modify the existing one, which one.
    5. what is the url i need to type in my browser.
    help will be appricated
    thanks in advance

    3. after successful compilation where to place the
    soruce code and class file, the exact locationAfter compilation, you don't need your source code. Class files should be placed in WEB-INF/classes, in their package folder.
    4. do i need to write my own web.xml file or do i need
    to modify the existing one, which one.
    If you write support classes (beans), you do not need to modify web.xml. If you write servlets, you need to modify your WEB-INF/web.xml file to map your servlet to your class:
        <servlet>
            <servlet-name>SomeServlet</servlet-name>
            <servlet-class>something.or.other.SomeServlet</servlet-class>
        </servlet>
       <servlet-mapping>
         <servlet-name>SomeServlet</servlet-name>
         <url-pattern>/servlet/SomeServlet</url-pattern>
       </servlet-mapping>
    5. what is the url i need to type in my browser.
    From example above: http://localhost:8080/servlet/SomeServlet or http://localhost:8080/your.jsp, assuming Tomcat runs on port 8080 and that you put your file under the ROOT context.
    >
    help will be appricated
    I think you should take a look at ant (http://ant.jakarta.org). It can help you automate most steps, from compiling, to copying files and making .war files.
    Hope this helps!
    Patrick

Maybe you are looking for

  • Purchase order from ORDERS05

    Hi everyone, I would like to generate a purchase order any time I receive an ORDERS05 type IDOC. What I need to know is whether there is any BAPI or functions module that makes it straigth. I mean I receive and ORDERS05 IDOC and I want that it genera

  • SAP Fiori 1.0 in Netweaver 7.4

    Hi, Currently I have a server that running EHP7 for SAP ERP 6.0, would like to install SAP Fiori (25 apps only). I was trying to installing the Fiori Purchase Order 1.0, during installation it have problem when import the GBAPP001 as I think is due t

  • Parameter passing (CRM to R3) for BOR based transaction launcher

    Hi All, Our requirement is to create R3 sales order through IC webclient. The details of the business partner should be shown as the defaults in the R3 sales order creation screen. To achieve this we: 1. Created link in Navigation Profile 2. Created

  • CS Extension, Script UI and events not firing in Photoshop CS5

    Hi! I'm a bit confused with two technologies dealing with SWF panels. There was a technique in the previous versions of Photoshop when SWF content has been loaded into a ScriptUI Window. Is it changed? Or does it still work together with CS Extension

  • R1800 colors too dark

    follow up from my last post having had time to experiment ...old settings that matched were printer mgmt, Epson vivid gamma 2.2 paper premium glossy, PS set on relative allow printer mgmt ...now all the prints I make with same saved settings are too