How to use Servlet

I have installed JRun 4 Web Server and Java 2 SDK, SE v1.4.1_01. When i import servlet import javax.servlet.*;There is an error message.
Package javax.servlet does not exist.
Please help me, maybe i haven't had package javax.servlet. What do i need to install?

for servlet development, u can either use two kinds of servlet develpment. Tomcat or J2EE RI. If u r using tomcat, then the servlet.jar will be at common/lib, if J2EE Ri, u will find a j2ee.jar to execute servlet. U must set ur classpath in your system to the location of the servlet.jar or j2ee.jar. u can either set it in control panel --> system --> advanced--> environment variable --> system variables. or by dos promptcommand

Similar Messages

  • 9iAS server how to use servlet

    While using 9ias there are two types of running the application one through cgi and another through servlet.
    The default examples are in cgi. while i am running through cgi everything is fine whereas if i use servlet i am unable to run or proceed and error is raised as even though i follow all the steps given in ur documentation.
    how to proceed need a help very urgent.

    Go to the Forms page on OTN: http://www.oracle.com/technology/products/forms/index.html
    1. How do I know if I'm using the Forms listener or the Forms listener servlet?
    If you are using port 9000, then you are not using the Forms Listener Servlet architecture.
    2. How do I configure the 9iAS server to use the Forms listener servlet and listen for forms requests via HTTP?
    From Forms 9i and onwards, the Application Server installer does all of the hard work for you. In 6i, you have to do some yourself.
    Click on the All Papers link for Forms 6i. There you will find a document that describes the Forms Listener Servlet setup. (Do text search for "servlet" on that page to find it.)

  • How to use Servlets with O8i on RH Linux 6.2 ???

    I'm using apache Jserv 1.1.2 to run my servlets all my JDBC programs work fine and other servlets too but only JDBC servlets give this message
    "SQLException caught Io exception: The network adapter could not
    established the connection"
    Can someone tell me How to configure JSERV to make connection ?

    Hi there,
    If I understand correctly you are running Jserv and Apache to connect to an Oracle 8i db on a remote machine. If you are getting the "network adapter" error make sure the listener is running on the remote machine (lsntrctl start -- lsntrctl status, or something like that from bash shell). Also make sure SQLNet is configured properly. Try connecting from a machine with SQL Plus. If this works and the listener is running you should be in business.
    Best
    Scott ([email protected])
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by CSL ():
    I'm using apache Jserv 1.1.2 to run my servlets, a remote database on O8i on linux. all my JDBC programs work fine and other servlets too(with no JDBC) but only JDBC servlets give this message
    "SQLException caught Io exception: The network adapter could not established the connection"
    Can someone tell me How to configure JSERV to make connection ?<HR></BLOCKQUOTE>
    null

  • How to use servlets in portal web application in Weblogic Portal 4.0

    We are developing a Portal Web application using Weblogic Portal 4.0 where in we
    have the following scenario. one JSP in webflow of a portlet calls the PipeLine
    which does some processing and calls the servlet which is having the typical download
    functionality. The servlet is supposed to read the data from the pipeline session
    and create a CSV String that is dumped to the client browser. The problem is even
    we are doing response.setContentType("application/save") in the servlet it is
    still displaying the content as html in the portlet. I guess since all our request
    are send to the webflow contolling servlet and it is setting the content type
    and hence our servlet is not working. How do I solve this problem? Thanks Yogesh

    Hi Renu
    Please go through the SAP Content Management here you find the documents related to Wab page Compoer and knowledge mangement. Also search for article / blog for more details.
    [http://www.sdn.sap.com/irj/sdn/nw-ecm|http://www.sdn.sap.com/irj/sdn/nw-ecm]
    Hope it will helps
    Best Regards
    Arun Jaiswal

  • How to use Servlet Context

    Has any one used ServletContext 's setAttribute() method to store parameters in one JSP and access them in another JSP.
    I want to replace hy Hidden Parmeters with this method, so that I can hide all my parameter names and their values in the HTML page, when an end user uses View Source option on a browser.
    If any one has that code available,please post that so that I can avoid all this coding and testing phase
    Thanks
    Suresh

    It is actually very easy, and I use it often, for example to track the user's login.
    In one jsp page you use:
    <% session.setAttribute("someName", anObject); %>
    Where "someName" is a string with the name you want to give to the object (choose different names for different objects) and aObject can be any object that is a descendant of Object (that means everything but primitive types, to store those use wrappers from the java.lang package, like Integer, Float, etc).
    Now, to retrieve in other pages, you just use the getAttribute method and cast to object:
    <% AnObject otherObject = (AnObject) session.getAttribute("someName"); %>
    A note of caution: The object will remain until session is invalidated (manually or timed out) or the object is expressly removed. If no object with the given name is found, the jsp will throw a NullPointerException, which you are not obligated to catch, but I strongly suggest you do, because there will be a time when that exception is thrown no matter how well coded are your jsp's (for example when a session times out and the user clicks on refresh on some page that asks for an object, etc).
    Good Luck.
    Ylan

  • How to use servlets and JSP for my homepage?

    servlets and JSP are server-side program. If my homepage is on some web-hosting websites, can I upload the servlets and JSP to run it? if possible, where can I find such a web-hosting place?
    sraiper

    Not many hosts offer JSP or Servlet support (and some do but then stop and never give you a refund, grrrrrrr!!!!).
    Also, ones that do support it can often be more expensive. There are some free ones but all the one's I've come across have problems that made them unsuitable for my needs.
    Here is a list of hosts that support Java:
    http://www.thejspbook.com/resources/category.jsp?id=1005&name=JSP+web+hosting
    I can't comment on any from that list, however I use http://www.positive-internet.com they are a bit pricey but they have excellent support and are always happy to help with any Tomcat (the JSP/Servlet server they use)configuration issues or needs that you may have.

  • How ot use servlet as the element of portlet?

    I am newbie for weblogic portal. I have tried to created a testing
    portlet with content.jsp, works fine.
    Then I tried to create a servlet, compiled it, got the class file.
    I put that class file name in the content URL. To my supprise, the
    front end shows the binary code that class, instead of call it and
    return what it suppose to return.
    Any suggestion are highly welcome.
    Thanks in advance
    Jack

    Jack,
    The portal framework works based on server-side includes. When you specify the
    contentURL on the EBCC, this means that the content of that JSP will be embeded
    on the main source servlet. I think the result that you get was the normal behavior
    that should happen. The interpreter found a "text" code and simply put it in out.println("the
    binary text").
    Did you get?
    I gess I help you,
    Edoardo Boechat
    "Russell Teabeault" <reply to newsgroups> wrote:
    Jack,
    In the ContentURL field in the EBCC input the servlet path. For example
    I
    had this in my web.xml:
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>examples.sampleportal.HelloWorldServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/helloworld/*</url-pattern>
    </servlet-mapping>
    In the ContentURL field I put /helloworld.
    Hope this helps.
    russ
    "jack" <[email protected]> wrote in message
    news:[email protected]..
    I am newbie for weblogic portal. I have tried to created a testing
    portlet with content.jsp, works fine.
    Then I tried to create a servlet, compiled it, got the class file.
    I put that class file name in the content URL. To my supprise, the
    front end shows the binary code that class, instead of call it and
    return what it suppose to return.
    Any suggestion are highly welcome.
    Thanks in advance
    Jack

  • How to use Servlet 2.4 with Netweaver Developer Studio 7.0?

    Hello,
    When I define my web.xml as follows:
    <!DOCTYPE web-app version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    I get an error in french: "La DTD du type de lélément racine "" doit se terminer par '>'."
    Saying that the DTD of type of root element must end with '>'     
    How can I solve this error?
    Thanks for your help,
    Tanguy Mezzano

    Hi,
    Tanguy Mezzano wrote:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
    There is a  " (double quote missing in the xsi:schemaLocation attribute. This is the reason. I am guessing that you may have tried manually editing this web.xml file and may not have correctly edited it.
    To correct the <? xml ?> and <!DOCTYPE> tags - please openup a blank Web Module Project and copy these two tags only from the web.xml and overwrite the same tags in your web.xml.
    Hope that this helps.
    Thanks.
    p256960.

  • How to define target window when redirecting within frames using servlet?

    Howdy:
    Is there a way to define target window when redirecting within frames using servlets?
    How to do it in JSP as well?
    T.I.A.
    Oriental Spirit

    Your servlet (or JSP) can't decide where it is going to be displayed. The browser has already decided that when it makes the request to your servlet.

  • How to invoke a jsp page from java which does not use Servlets?

    Hello,
    I am working in Documentum. I am trying to invoke a jsp page from another java page which does not use Servlets.
    I tried doing this by just instantiating the java class related to the jsp page from my present java class.In my java class related to the jsp page, I have defined onInit() and onRender() methods.
    Now, I am trying to call the jsp page from my present java class by just instantiating the java class related to the jsp page. This throws a java.lang.NullPointerException.
    Any comments or suggestions on this.Any help would be appreciated.
    Thanks,
    Ranjith M.V

    RanjithM.V wrote:
    Hello,
    Thanks for the reply. One important thing I forgot to mention. I am also using xml component.And?
    As this is the standard way used for coding in Documentum, I do not want to use Beans.Well, JSP's should, in and of themselves, contain no functional code. It should all be only display.
    Without that is it not possible?What did I say? I said,
    masijade wrote:
    It is possible, but I very, very, very, much doubt, that it would be worth the effort.And, if you don't know how, a forum is not truely going to be able to help you implement it (at least not in less than a few years time, at which point it would be outdated).
    >
    Appreciate your understanding and help.
    Thanks,
    Ranjith M.V

  • How to use an IFrame with my servlet?

    Hello, my question is this (basically, I'm building a "social" application for one of the social networks out there,
    but I'm using a java servlet as my back-end server, though I don't know if it matters to my question) -
    I want to insert an iframe to my application, but I didn't find good material on how to use this, and what to add to my servlet
    for completing the communication with the iframe - can anyone give an example maybe, or a link to a good piece of code.
    Basically, what I want for my application is to simply allow a user to record a voice message, and save it somewhere,
    and for that I need to use a java library, and this is why I thought building it with an iframe that will directly communicate with my java servlet. - IS THIS A GOOD IDEA?
    thanks :)
    Kogan.

    IFrame is just a HTML element. You normally embed HTML elements in a JSP file. How to use an IFrame is covered by every average HTML tutorial.
    What's your actual problem?

  • How to use session variable in JSP function  & How to use both JSP  Servlet

    Hi,
    I am new to JSP and servlets
    Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
    I try to keep the hard coding part out of JSP.
    I dont how to use both JSP and Servlets in combination.
    Hence If needed I write some functions in JSP.
    but it gives me error
    +<%! public void abc()+
    +{+
    int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
    +}+
    +%>+
    Saying cannot find symbol session
    1) So can u please tell how can I access session variables within JSP function
    2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
    Thanks
    Venkat

    The application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...

  • How to create the servlet as acontroller  and how to use it

    how to create the servlet as acontroller and how to use it

    >
    John
    Please update your forum profile with a real handle instead of "914824".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    I am going to have over 50 buttons in a page, Why? This would be a most unusual UI paradigm. I've never seen such a page, which suggests that whatever you want to do is normally done another way. Please explain the requirement in more detail.
    just wanted to know if its possible to do something like this in java.
    Java is not used in programming APEX UI behaviour. Java and JavaScript may share initial syllables, but they are not closely related.
    It's possible to achieve a great deal in JavaScript, but a clear definition of the requirements is necessary. Do you mean the buttons should be dynamically generated? If so, yes, this is possible in JavaScript. What would drive the process?
    Also, i would like to have dynamic action on it, for example, when the button is pressed, fill a string of text into other items(text field) within the page. Without more detail its not possible to make any specific suggestions. For example, I certainly would not want to create 50+ individual dynamic actions relating to different buttons.

  • Servlet, how to use it?

    I compile a servlet class:
    public class HelloWorld extends HttpServlet
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("<HTML>");
              out.println("<HEAD>");
              out.println("<TITLE>Hello World!!</TITLE>");
              out.println("</HEAD>");
              out.println("<BODY>");
              out.println("</BODY>");
              out.println("</HTML>");
    =====================================================
    and generate a HelloWorld.class
    but how to use the class? must it be used in a jsp file?
    thx

    if you want to hit the ground running with servlets, im me webactivex on yahoo messager, or e-mail [email protected].. http://sourceforge.net/projects/ambient/ is a webapplication engine that will let you build webapplications and do less coding!
    im me I will tell u all you need to know.. matt

  • How to fetch data from DataBase using Servlet ?

    Hi all,
    Till now, i was just sending values from web page and receive the data in excel format using servlets.
    But, now, i want to fetch data from data base. I will be giving inputs in the web page(for the query)....ON click of submit button,
    Servlet should be called.
    Depending on the input, query has to be executed, and response should be sent to the user.
    How to do it?
    Code
    import java.text.*;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.OutputStream;
    /** Simple servlet that reads three parameters from the html
    form
    public class Fetchdata extends HttpServlet
              String query=new String();
              String uid="ashvini";
              String pwd="******";
              try
                   Connection con=null;
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");     
                   String url = "jdbc:odbc:Testing";     
                   con = DriverManager.getConnection(url, uid, pwd);
                   Statement s = con.createStatement();
                   query = "select * from gowri.msllst1";
                   ResultSet rs = s.executeQuery(query);
              public void doGet(HttpServletRequest request,HttpServletResponse response)
              throws ServletException, IOException
                        response.setContentType("application/vnd.ms-excel");
                        ServletOutputStream out=response.getOutputStream();
                        out.println("<HTML>" +"<BODY BGCOLOR=\"#FDF5E6\">\n" +
                        "<H1 ALIGN=CENTER>" + title + "</H1>\n" +
                        "<table>" +" <th>ITEM Code</th>");
                        while(rs.next())
                        out.println("<tr><td>" rs.getString(1).trim()"</tr></td>");
                        }//end of while
                        out.println("</table></BODY></HTML>");
                   }//end of doGet method
         }catch(Exception e)
                        System.out.println(e);
    It is giving error message as:
    C:\Program Files\Apache Tomcat 4.0\webapps\general\srvlt>javac Fetchdata.java
    Fetchdata.java:17: illegal start of type
    try
    ^
    Fetchdata.java:48: <identifier> expected
    ^
    2 errors
    Is this format is correct? am i placing this doGet method at the right place? is my program's logic is correct?
    Please help me?
    Regards
    AShvini

    There is some mistakes in ur code.....how can try catch exists outside a function???
    make use of try catch isde ur doGet method and put
    Connection con=null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = "jdbc:odbc:Testing";
    con = DriverManager.getConnection(url, uid, pwd);
    Statement s = con.createStatement();
    query = "select * from gowri.msllst1";
    ResultSet rs = s.executeQuery(query);
    isdie doGet method, for the time being,
    i think u get me..
    regards
    shanu

Maybe you are looking for

  • How can I get the remote directory from an FTPActivationSpec header?

    The header message generated for the oracle.tip.adapter.ftp.inbound.FTPActivationSpec contains the file name, FTP host and FTP port. Is there any way of getting the remote directory as well? <schema attributeFormDefault="qualified" elementFormDefault

  • No soap with my php

    I was disappointed to find that Leopard's Apache2 configuration (once you turn on PHP) does not include PHP Soap. I'm pretty sure Soap is included in PHP 5.2.5 builds and later... but, alas, Leopard comes with 5.2.4. I was able to find a workaround t

  • Media Issues in Interactive PDF

    I have inserted two video clips and two audio clips onto a page in a document I'm work on and they are giving me a lot of trouble.  For some reason when I export the project as an swf, when I click the video files to play them they move up about a 1/

  • Problem in debug ?

    Hi,    I write the logic for my requirement for moving the posting date. Logic is :            CASE I_ERKRS.                   WHEN 'M200'.                     MOVE-CORRESPONDING I_ITEM to CE0_M200.                     IF NOT CE0_M200-fkart is initia

  • Keynot does not work with Lion OSX 10.7.2

    First there was the problem with the hidden Library/application Support/iWeb/domaines, which is an important problem for me as I use my web site to show people what kind of work that I do (videos with still photography); now there's the problem with