Cannot invoke default servlet through invoker????

Does someone can help me with this exception? what it mean? How to solve? I'm using TomCat 4.0.6
The code i'm using...
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException{
String url = "/lis3d/servlets/index.html";
RequestDispatcher dispatcher =
this.getServletContext().getRequestDispatcher(url);
if(dispatcher ==null)
     System.out.println("Dispatcher == null");
else{
try{
dispatcher.include(req, res);
}catch (ServletException e){e.printStackTrace();}
}

There�s a reason why cannot be any static content like html
The dispatching uses the POST method from the HTTP protocol and html files can only be retrieved with GET method. If you wanna avoid a overhelm that might occur in your server because of the use of a dynamic content(like a login page) you can use the sendRedirect() method that redirects throught a GET to another page. i�m not sure now but i think its a method of the HttpSerlvetResponse class.
i hope i�ve helped
Bill

Similar Messages

  • Invoking Tomcat 5 servlets through Apache

    Hello,
    I have Apache 2.0.45, Tomcat 5.0 and mod_jk1.2.2 running on Redhat 8.0.
    I am trying to get Tomcat's jsp-examples and servlets-examples to run through Apache (http://localhost). They work as expected through Tomcat (http://localhost:8080).
    I added the following to httpd.conf:
    Alias /jsp-examples /jakarta-tomcat-5/webapps/jsp-examples
    Alias /servlets-examples /jakarta-tomcat-5/webapps/servlets-examples
    JkMount /jsp-examples/servlet/* Worker1
    JkMount /jsp-examples/*.jsp Worker1
    JkMount /servlets-examples/servlet/* Worker1
    JkMount /servlets-examples/*.jsp Worker1
    With the above included in Apache's config I am able to invoke the index.html for each of the above apps. However, when I click on any of the example links I get "Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request"
    One of the links for the servlets-examples I am testing is:
    http://localhost/servlets-examples/servlet/HelloWorldExample
    And HelloWorldExample.class is in the /servlets-examples/WEB-INF/classes
    directory.
    With the above configuration shouldn't Apache route the request for the servlet through to Tomcat? What more do I need to add to either Apache's or Tomcat's conf files to get this to work? As I said, they work fine through Tomcat, so I don't think I need to tweak the web.xml(s)... or do I?
    TIA
    pwp

    Here's a snippet of my configuration:
    # mod_jk configuration file - Windows version
    <IfModule !mod_jk.c>
    LoadModule jk_module modules/mod_jk-1.3.27.dll
    </IfModule>
    JkWorkersFile "H:/tomcat-4/conf/workers.properties"
    JkLogFile "H:/tomcat-4/logs/mod_jk.log"
    JkLogLevel debug
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
    JkRequestLogFormat "%w %V %T"
    # begin: examples
    Alias /examples "H:/tomcat-4/webapps/examples"
    JkMount /examples/servlet/* ajp13wkr1
    JkMount /examples/*.jsp ajp13wkr1
    <Location "/examples/WEB-INF">
    AllowOverride None
    Order allow,deny
    Deny from all
    </Location>
    <Location "/examples/META-INF">
    AllowOverride None
    Order allow,deny
    Deny from all
    </Location>
    # end: examples
    In Apache's http.conf add:
    Include H:/tomcat-4/conf/jk/mod_jk.conf
    Don't forget to restart both Tomcat and Apache
    http://localhost/examples/jsp and http://localhost/examples/servlets should give you the std Tomcat JSP and Servlets examples

  • Invoking BPEL Process through pl/sql is failing

    Hi all,
    I am trying to invoke BPEL process through PL/SQL and its throwing following error.
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns="http://xmlns.oracle.com/pcbpel/adapter/file/ReadFile/"><faultcode xmlns="">null:Read_ptt</faultcode><faultstring xmlns="">Cannot figure out operation name. Bad SOAPAction or wsa:Action.</faultstring><faultactor xmlns="">initiate</faultactor></env:Fault></env:Body></env:Envelope>
    Following is code I am using to invoke BPEL PROCESS
    declare
    soap_request varchar2(30000);
    soap_respond varchar2(30000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    begin
    soap_request:='<?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header/>
    <soap:Body xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/ReadFile/">
    --<ns1:Read_plt><ns1:input>leeg</ns1:input></ns1:Read_plt>
    </soap:Body>
    </soap:Envelope>';
    http_req:= sys.utl_http.begin_request('http://localhost/orabpel/default/BPELProcess1/v2007_12_03__65618','POST','HTTP/1.1' );
    sys.utl_http.set_header(http_req, 'Content-Type', 'text/xml') ;
    sys.utl_http.set_header(http_req, 'Content-Length', length(soap_request)) ;
    sys.utl_http.set_header(http_req, 'SOAPAction', 'initiate');
    sys.utl_http.write_text(http_req, soap_request) ;
    http_resp:= sys.utl_http.get_response(http_req) ;
    sys.utl_http.read_text(http_resp, soap_respond) ;
    sys.utl_http.end_response(http_resp) ;
    dbms_output.put_line(soap_respond);
    end;
    Any help would be appriciated.
    Thanks,
    Vipul

    Hi,
    Switching on or off a bpel is an admin job.
    u can stop an application but not one bpel.
    I doubt if there is any way to do it programatically.
    Let us get other opinons
    Regards

  • ADF Bindings Servlet/Filter  not invoking  Faces Servlet

    I'm getting ADF Faces and Facelets working properly with pages written in jspx format, but the Faces Servlet being mapped to jsf format.
    The problem I'm getting is while displaying ADF Tables with data retrieved from the database using Toplink and bindings provided by ADF Databindings.
    The following is the Web.xml mappings for Faces Servlet and ADF bindings filter:
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <filter>
    <filter-name>adfBindings</filter-name>
    <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    I'm getting the ADF tables displayed using ADF Bindings, if the faces servlet is mapped for jspx format;but, at the cost of losing Facelets...Facelets is not working with Faces Servlet mapped to jspx format(though written in jspx format, the faces servlet mappping has to be made for jsf format.On the other hand, if I use faces servlet mapping for jsf pages I'm getting Facelets working but ADF Databindings are not working ,(I guess) and hence ADF Faces Tables are not being displayed(I'm getting Access Denied message).
    I even tried to change the ADF binding filter mappings
    ---- from ---- jsp &jspx---- to ----- jsp and jsf ----
    But I got the same Access denied message.
    I read a similar post on this forum by Mr.Ashish Kumar who said he is using java script and automatic form submission, to refresh the page and that gave him the table working.
    as quoted in the post:
    af:table displays Access Denied
    Why should the page be refreshed at all. I Guess , the Faces Servlet is not being invoked by the ADF Bindings Filter/Servlet, and for this , I suppose , Mr.Ashish is using java script to provide the action required.
    And one more thing which that Automatic Refreshing of page using JavaScript cannot do.
    Suppose,
    I need customised display, rather than just a Table or Form,like:
    public String getEmp() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("findAllEmp");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    List<Emp> res=(List<Emp>)result;
    for(int i=0;i<res.size();i++)
    Emp myrec=res.get(i);
    System.out.println("Employee ["+myrec.getEname()+"], Salary ["+myrec.getSal()+"]");
    return "";
    where I do some customisation in the backing bean.
    and I call that method binded to a button as below:
    <af:commandButton
    text="findAllEmp"
    disabled="#{!bindings.findAllEmp.enabled}"
    binding="#{backing_Success.commandButton1}"
    id="commandButton1"
    action="#{backing_Success.getEmp}"/>
    What I'm getting is a disabled button.
    Why doesn't ADF bindings servlet invoke the faces Servlet?
    Can't we make ADF Bindings Servlet invoke Faces Servlet by configuring in the web.xml?
    Can't we get ADF Bindings filter mapped to work with jsf pages?
    Won't ADF Bindings work with jsf pages, will they work only with jspx pages?
    ADF Team,
    Please Help me.
    Thanking you,
    Samba

    Hi! Frank,
    Thankyou for your Reply.
    Yes, Mr.Adam Winer has contributed that library, I guess.
    But I already have that adf-facelets.jar in my lib folder ; and with out that the Facelets won't work with ADF faces , in the first place.
    I'm getting Facelets working excellently with ADF Faces but I'm not getting ADF Bindings working with Faceletpages.
    The thing is even in another application which does not have facelets in it, if we use mapping for jsf pages, ADF Bindings are not working.
    I think the ADF bindings filter is configured some where to work with jspx pages only.Could you tell me where to change that entry to make ADF Bindings work with jsf extension?
    Thanking you,
    Samba.

  • Different ways to invoke a servlet from another servlets?

    Hello,
    I am a bit confused today. I was thinking about all the ways by which I can invoke a servlet from another servlets. I know it can be done by creating an instance of the 2nd servlet in the 1st one. Is there any other way? such as say.... RequestDispatcher perhaps?
    Here is an example to illustrate my point. I have a login.jsp which submits to login.do. login.do search through database and first authenticate email and then the corresponding password. Now its time for displayGame.do. So here how do i do? if it was a displayGame.jsp then i could have used Redirection or Forward but when it is servlets? Can I still go for Redirection or Forward??
    Thank you for reading this confused post. :-)

    if it was a displayGame.jsp then i could have used Redirection or Forward but when it is servlets?Question: do you know what a JSP becomes when you first run it?
    Answer: a servlet.
    So yes, you can use a RequestDispatcher to forward/redirect to a servlet OR a JSP, whatever you like.

  • Invoking LiveCycle ES through WSDL via a form desinged in Designer ES

    Now here is the situation exactly after tracing the process, let me describe first what does my simple process does.
    Variables:
    input1:int, Required, Input
    output1:int, Output
    it has 2 activities, the first activity is SetValue which is the start activity, it maps the value of the input into the output, simply it copies the input1 integer into the output1 integer
    The second activity is Variable Logger, and it logs the values of the variables into a log.log file in the file system.
    Now I tested this process using the invoke operation in the components view under the WorkflowDSC, after I invoke it, It shows me a number field to insert input1, I insert it and press ok, then it shows me output1, now I don't know why it shows me output1, but its ok, I leave it blank and press ok.
    I check the log.log file on my file system and it is created and logging the same values for input1 and output1.
    So apparently the process is working just fine.
    Now on the other hand at the LiveCycle Designer ES, I create a blank XDP file (Interactive) then I create a Data Connection, choosing WSDL and the URL of the web service "http://localhost:8080/soap/services/InvokingLiveCycle?wsdl", and then comes the choose operation window, by default I see 5 operations for any service I create in the WorkBench which is "invoke", "invoke_Async", "invoke_Result", "invoke_Status" and "invoke_Dispose"
    I choose "invoke" and there is invoke Request, invoke Response and invokeBtn, the invoke Request has the input1 Variable, and the invoke Response has the output1 Variable, and the invokeBtn is in the "execute" mode and pointing to my service and executing at the client, I insert all this in the form and test it in the Preview PDF tab.
    Now this doesn't work at all, and the log file isn't created and of course the service isn't invoked in the 1st place, and this is my main problem.
    It occurred to me to choose another operation and create a new Data Connection, I chose "invoke_Async", it has invoke_Async Request having the "input1" integer field same as "invoke" operation and it has also invoke_Async Response having the "invocationId" and invoke_AsyncBtn which is the same as the invokeBtn.
    I insert these into the form and test it in the Preview PDF tab and I put a value in the input1 field then I press the invoke_AsyncBtn I get a response in the "invocationId" field which is "bc6b3f0fc0a85081000a998ebf903666" and surprisingly I find that the service created a log.log file and checking the value of output1 I find out that it is the same as I entered as input1, meaning the process worked and was successfully invoked, but of course I can't get to see the output1 field on my form, I don't know where is the response other than the "invocationId"
    Now I really want to understand where is the problem.
    Notes:
    -By the way I am disabling all the services' security in the AdminUI --> Services -->Archive Administration --> Service Management.
    -I tested another web service using the same technique which resides at "http://www.webservicex.net/CurrencyConvertor.asmx?wsdl" on the LiveCycle Designer Preview PDF tab and also in the Adobe Acrobat Professional, and its working both ways just fine.
    P.S. I posted this to LiveCycle google group days ago, still didn't get an answer though.
    Best Regards
    Amr Marghany

    Thanks Jasmine, I got a reply by Dave Venance suggesting I should change it to short-lived process,
    it is working now after changing it to short-lived process and creating the Data Connection, I saw only 1 operation, which is "invoke" and I got to see the populated output1 in the form.
    Well I thought of it a little, "What if the process is really long lived, and it is routed to an end user?"
    then I was saying to myself "it makes sense, I can't get a response in the form except if the process is short-lived"
    Now this small process was just for testing the whole thing, lets talk long-lived process a bit, I can invoke a long-lived process as I told you before from the "invoke_Async" operation, I will get over the fact that I don't know what is the "invoke", "invoke_Result" operations are for.
    Lets just say I can invoke a long lived process from the operation "invoke_Async" and I can pass inputs to the service through the "invoke Async Request", This is going to be a bit long, I can deal with simple types in the "invoke_Async Request" like "int, string, float, etc..." but what if I want the user to submit the form as a whole to me in a variable like "document, xml with schema, xfaForm, etc..."?.
    I can make a work around this, and I can use the setValue operation in the Workbench to map the simple input variables one by one to the corresponding path in the xfaForm variable like for example
    Location: /process_data/exp_review/object/data/xdp/datasets/data/Expense/UserInfo/txtEmployeeName
    Expression: /process_data/@txtEmployeeName
    and on the other hand in the Designer I can bind each field on the form with its corresponding field from the Data Connection request.
    This is the work around, but I want the user to submit a variable of type "xfaForm", like for example I want it to look like this
    Location: /process_data/exp_review/object/data/xdp/datasets/data
    Expression: /process_data/exp_report/object/data/xdp/datasets/data/Expense
    Now when I tried to use this complex types as input variables in the Workbench, then I made a Data Connection to the exposed web service I saw many fields in the "request" that I don't understand, actually I didn't understand any of them.
    For example when the input type was "document" the "request" had this fields
    -"contentType", "attachementID", "binaryData", "remoteURL" and all of them are of type text fields.
    Another example that I thought it might be the solution is submitting the data on the form as XML, so I created an XML variable on the Workbench called "xml" and I marked it as input and I set the XSD reference to my schema, now when I created the data connection on the Designer I found only 2 fields on the request inside a subform named "xml" which was "document" & "element" of type text fields!!
    Another example, when the input type was "xfaForm" the "request" had this fields
    -"data", "description", "name" and "templateURL" of type text fields and "renderOnce" of type checkBox
    -it also has 3 subforms
    1st subform: "dataAsDocument" containing "contentType", "attachementID", "binaryData", "remoteURL"
    2nd subform: "renderServiceCall" containing 3 tables "inputParamterMappings", "outputParamateMappings" and "outputParamaterMappings"; each of the 3 tables has 1 row containing "key" and "value" of type text fields; the "renderServiceCall" table also has 2 text fields "operationName" and "serviceID"
    3rd: "submitServiceCall" having the same tables and fields as "renderServiceCall"
    How can I use such a variable of type xfaForm or xml, in the workbench I gave it the template url and the schema, but when I use the exposed web service in the Designer, I find out that the request has this fields I just mentioned.

  • How to -only- invoke a Servlet/JSP

    Hi,
    I would like to invoke a Servlet or JSP inside a standalone application WITHOUT opening a stream. When I use url.openConnection() or con.connect() the servlet/JSP is not executed, I must also do "ObjectInputStream o = new ObjectInputStream(con.getInputStream());" in order to get the servlet/jsp executed.
    I just want to invoke the servlet/JSP, because I use the returned data for nothing.
    Thanks

    If you openConnection, you might also have to get the output stream from the servlet to make it work properly. (Otherwise, the server, or proxies in-between, might consider that the client has decided it doesn't want the page after all, and may stop requesting it.)
    A cheap way to request a page but get less data back would be..
    conn.setRequestMethod("HEAD");HEAD is exactly like GET, except it doesn't return the body (just the headers, hence the name.) Not entirely sure if it works on Java.
    Failing that, you should be able to just open the input stream, and close it again straight away.

  • Problem in invoking a servlet from another PC

    hi
    i am trying to invoke a servlet running on apache tomcat 5.0.28 from another PC, my j2me wireless toolkit is on one PC and it runs a MIDlet that invokes a servlet on another PC, but am getting an exception connectionNotFound....
    both the computers are on LAN, what do i do?
    Need guidance

    No, i think tomcat server is enough.. have u checked your servlet from browser?
    I got the same error in black berry application and at that time i found that its due to servlet config in web.xml
    Have u configured your servlet in web.xml?
    One suggestion.. change your URL to www.google.com and then run your MIDlet.. it confermed that your midlet is OK
    Http request is fine to send data from your WTK.
    About apache http "NO IDEA"
    Thks

  • Method to get the file path that invoked a servlet

    i have a html file that invokes a servlet.Within the servlet i want a method that gives me the path of the html file.Is this possible without using cookies.or is there any method that serves my purpose?

    Hi,
    after reading the last posts I think you should try what KPSeal said (althought I haven't tried it) or use my last suggestion :
    on your HTML link (which will be handled by server) add an extra parameter (e.g. http://handle.xxx?page=mypage.HTML) and catch it inside the servlet code to know from what page it came.
    nevertheless, about the getRequestURL() (and getRequestURI()) it's a method from the interface HttpServletRequest, in the package javax.servlet.http that comes in the Servlet API. (you can find the servlet API at http://java.sun.com/products/servlet/download.html), but I believe if you have a servlet you already should have inside it the request object.

  • Process + Servlet to invoke process + form + database

    GetMortgageForm process
    The following illustration shows the GetMortgageForm process (see Figure 2).
    Figure 2. A LiveCycle ES process that returns an interactive form.
    Note: This document does not describe how to create a process by using Adobe LiveCycle Workbench ES. (For information, see Workbench ES Help.)
    The following table describes the steps in this diagram.
    Operation Description
    1 The user submits a custom identifier value and the operation to perform. In this situation, assume that the user is applying for a mortgage. The input parameters for this process are a string value that specifies the form name (named formName) and another string value that represents the custom identifier value (named custId).
    Note: In the Java application logic located in the Java servlet, the formName and custId process variables are referenced.
    2 The process uses the customer identifier value to perform a relational database look-up for additional customer information by using the JdbcService service's Execute SQL Statement operation. The custom identifier value acts as the primary key value.
    3 Merges customer data into an XML data source that is used to prepopulate the form. (See "Prepopulating Dynamic Forms" in Programming with LiveCycle ES.)
    4 The mortgage form is rendered with customer data located in some of the fields, such as the address field. This action is based on the Forms service's renderPDFForm operation.
    The Java servlet receives the form (return value for the process) and writes the form to a client web browser. The name of the output parameter is RenderedForm. This parameter is a process variable and its data type is FormsResult.
    Note: In the Java application logic located in the Java servlet that invokes this process, the RenderedForm process variable is referenced.
    This interactive loan form is rendered by the GetMortgageForm process (see Figure 3).
    Figure 3. An interactive form.
    Note: This document describes how to use the Invocation API to invoke a LiveCycle ES process. It is recommended that you are familiar with the Invocation API before you follow along with this document. (See "Invoking LiveCycle ES Processes" in Programming with LiveCycle ES.)
    Summary of steps
    To create a Java servlet that invokes a LiveCycle ES process, perform the following steps:
    1. Create a new web project.
    2. Create Java application logic that represents the Java servlet.
    3. Create the web page for the web application.
    4. Package the web application to a WAR file.
    5. Deploy the WAR file to the J2EE application server.
    6. Test your web application.
    Note: Some of these steps depend on the J2EE application on which LiveCycle ES is deployed. For example, the method you use to deploy a WAR file depends on the J2EE application server that you are using. This document assumes that LiveCycle ES is deployed on JBoss®.
    Creating a web project
    The first step to create a Java servlet that can invoke a LiveCycle ES process is to create a new web project. The Java IDE that this document is based on is Eclipse 3.3. Using the Eclipse IDE, create a web project and add the required JAR files to your project. Finally, add an HTML page named index.html and a Java servlet to your project.
    The following list specifies the JAR files that you must add to your web project:
    adobe-forms-client.jar
    adobe-livecycle-client.jar
    adobe-usermanager-client.jar
    adobe-utilities.jar
    For the location of these JAR files, see "Including LiveCycle ES Java library files" in Programming with LiveCycle ES.
    Note: The adobe-forms-client.jar file is required because the process returns a FormsResult object, which is defined in this JAR file.
    To create a web project:
    1. Start Eclipse and click File > New Project.
    2. In the New Project dialog box, select Web > Dynamic Web Project.
    3. Type InvokeMortgageProcess for the name of your project and then click Finish.
    To add required JAR files to your project:
    1. From the Project

    Peter - Set the Source Used attribute of P42_FK1 to "Only,..." .
    Scott

  • How to invoke a servlet in another servlet

    In my first servlet named TransferServlet ,I want to invoke another servlet named PublisherServlet.So I wrote the codes:
    URL objURL = new URL("http://localhost:8080/servlet/PublisherServlet") ;
    HttpURLConnection hucConnection = (HttpURLConnection)objURL.openConnection() ;
    hucConnection.setDoOutput(true) ;
    hucConnection.setRequestMethod("POST") ;
    hucConnection.connect() ;
    but i can't invoke PublisherServlet. pls help me.
    Thanks a log

    Try this:
    String strURL = "http://localhost:8080/servlet/PublisherServlet";
    URL url = new URL(strURL);
    URLConnection con = url.openConnection();
    con.setDoInput( true );
    con.setDoOutput( true );
    con.setUseCaches( false );
    //con.getOutputStream().write(bArr);
    BufferedReader inStream      =     new BufferedReader(new InputStreamReader(con.getInputStream()));
    String strResponse;
    while ((strResponse = inStream.readLine ()) != null)
         sbfResponse.append (strResponse+"\n");
    inStream.close ();

  • How to invoke a servlet using a tag?

    hi,
    I have written a programme where I need to invoke a servlet from a hyperlink rather than a submit button,which is usually used to invoke a servlet.I hope you can help me out.
    thanks in anticipation
    regards
    Deepa Datar

    Thanks.
    Earlier I didn't get it because I was using doPost() method instead of doget().
    Thanks once again.
    Deepa Datar

  • How to invoke a Servlet on onClick event of CheckBox ?

    Hi,
    Can anybody provide me with the code - how to invoke a Servlet & then pass all form variables to the Servlet on onClick Event of CheckBox in a JSP Page.
    I guess it is possible with Javascript but i need the code...
    Pls Help !
    Thanx.

    <html>
    <head>
    <script language="JavaScript">
    <!--
    function submitMyForm(){      
    document.myform.submit();
    //-->
    </script>
    </head>
    <body>
    <form name="myform" method="POST" action="http://mywebserver/servlet/myServlet" target=_top>
    <input type="checkbox" name="mycheckbox" OnClick = "javascript:submitMyForm()">
    </form>
    </body>
    </html>
    Hope this helps...

  • How to invoke a servlet from an application-URGENT

    Hi,
              My requirement is as follows :
              I have to invoke a servlet from a client application. I am using
              java.net.URL and java.netURLConnection classes to
              open a connection and invoke the servlet.
              I am using WebLogic5.1
              my code snippet is as follows :
              URL url = new URL("http://localhost:7001/urlservlet");
              URLConnection connection = url.openConnection();
              connection.setRequestMethod("GET");
              connection.setDoOutput(true);
              connection.setDoInput(true);
              PrintStream outStream = new PrintStream( connection.getOutputStream() );
              outStream.print("message=hai");
              outStream.flush();
              outStream.close();
              When I execute the application, Webloigc server console is displaying the
              following line.
              <Listen Thread> Adding Address : <machine name><ip address>
              But the service method of servlet is not getting invoked at all.
              Help me to find the answer.
              Jeelani
              

    jeelani <[email protected]> wrote:
              > Hi Dimitri,
              > Thanks a lot.That worked for me.
              > But if I want to send java objects (Vectors,beans),what is the best way to
              > do it.
              > This is exactly what our requirement is..
              If you want to send Java object you have to use POST:
              URLConnection conn = ...
              conn.setDoOutput(true); // makes this a POST
              OutputStream os = conn.getOutputStream();
              ...write your objects here...
              os.flush();
              os.close();
              InputStream in = conn.getInputStream(); // sends data to the server and
              // opens input stream
              ..read servlet response..
              .. ot just close the stream...
              in.close();
              > my client application need to send some java components to our main server
              > located in our head office.The servlet will read the objects and execute the
              > functionality..
              > I really appreciate for the fast response from you.
              > Dimitri Rakitine <[email protected]> wrote in message
              > news:[email protected]...
              >> Try it like this:
              >>
              >> URL url = new URL("http://localhost:7001/urlservlet?message=hai");
              >> URLConnection connection = url.openConnection();
              >> InputStream in = connection.getInputStream();
              >> in.close();
              >>
              >>
              >> jeelani <[email protected]> wrote:
              >> > Thanks for the quick response.
              >>
              >> > Actually right now it doesn't matter whether it is by GET or by POST.
              >> > Add my clinet application just needs to send data to Servlet and nothing
              > to
              >> > get in return.Thats why I am using connection.getOutputStream().
              >>
              >> > since application will not be reading anything from servlet, I don't
              >> > think it is required to use connection.getInputStream().
              >> > (I am sorry, if I am wrong).
              >>
              >> > Can you please help me out. weblogic server is able to get the address
              >> > from where the request is coming. Only problem is servlet is not getting
              >> > invoked.
              >>
              >> > regards,
              >> > Jeelani
              >>
              >>
              >> > Dimitri Rakitine <[email protected]> wrote in message
              >> > news:[email protected]...
              >> >> Are you trying to do get or post? First you set method to GET
              >> >> and then you do the POST.
              >> >>
              >> >> And add InputStream is = connection.getInputStream() - that will
              >> >> result in HttpURLConnection sending data to the server and getting
              >> >> back the response.
              >> >>
              >> >> jeelani <[email protected]> wrote:
              >> >> > Hi,
              >> >>
              >> >> > My requirement is as follows :
              >> >>
              >> >> > I have to invoke a servlet from a client application. I am using
              >> >> > java.net.URL and java.netURLConnection classes to
              >> >> > open a connection and invoke the servlet.
              >> >>
              >> >> > I am using WebLogic5.1
              >> >>
              >> >> > my code snippet is as follows :
              >> >>
              >> >> > URL url = new URL("http://localhost:7001/urlservlet");
              >> >>
              >> >> > URLConnection connection = url.openConnection();
              >> >>
              >> >> > connection.setRequestMethod("GET");
              >> >> > connection.setDoOutput(true);
              >>
              >> >> > PrintStream outStream = new
              >> > PrintStream( connection.getOutputStream() );
              >> >> > outStream.print("message=hai");
              >> >> > outStream.flush();
              >> >> > outStream.close();
              >> >>
              >> >> > When I execute the application, Webloigc server console is displaying
              >> > the
              >> >> > following line.
              >> >>
              >> >> > <Listen Thread> Adding Address : <machine name><ip address>
              >> >>
              >> >> > But the service method of servlet is not getting invoked at all.
              >> >>
              >> >> > Help me to find the answer.
              >> >>
              >> >> > Jeelani
              >> >>
              >> >> --
              >> >> Dimitri
              >> >> http://dima.dhs.org
              >>
              >>
              >>
              >> --
              >> Dimitri
              >> http://dima.dhs.org
              Dimitri
              http://dima.dhs.org
              

  • How to invoke a servlet from MDB

    Hi,
    Can someone please tell me how to invoke a servlet from MDB. Actually I want to have a MDB that will invoke a servlet that takes arround ~3 minutes to process and send the response back to MDB. Any small code snippet on invoking a servlet.
    Thanks

    nope. this is probably a bad design.
    but here's a hint: whenever you have a question like this, start browsing the javadocs. chances are there's a class that might help you.
    i'd recommend that you look at this:
    http://java.sun.com/javase/6/docs/api/java/net/HttpURLConnection.html
    %

Maybe you are looking for

  • I can't connect my iPhone to my home wi-fi network

    My new iPhone 3G sees my home network, but it doesn't accept my password, despite repeated tries. The password is correct. Any idea how I can make it work? Thanks.

  • Klaus1 got me up and running again (update on 10.4.11 update problems)

    I took the advice posted by klaus1 here: http://discussions.apple.com/thread.jspa?messageID=5915204&#5915204 and I'm now running smooth with the Tiger 10.4.11 update. I followed his advice to the letter. I went from not being able to work on a text d

  • Getting next calendar event on home screen

    I have just bought an iPhone 5, never had one before. On my old htc and before that, on my Nokia n95, I could get the next calendar event on my home screen - how do I do this on my iPhone?

  • Limiting the Reauthorization of credit card

    Hi, Is there a way to Restrict the re authorization of credit card  in the sales order when the difference between the Order amount and authorized amount are minimum. As an example  sales order was created for $55 got authorized for $55. because of t

  • Get pics from my PC to my Iphone 4s.

    I imported pictures to my PC but on accidently had it set on the 'delete after importing' and I want the pictures back on my iphone. How do I download them back on my phone without having to download a software onto my PC?