ABAP calling a servlet....

Hi everyone,
I read that ABAP program can call a standalone JAVA program.
Is it possible to call a servlet (and of course passing parameters)  instead of a standalone JAVA program ?
Thanks.

Hi Guru,
I want my servlet calls a web service.
In fact, if I could call the web service from a java standalone class it would be a nice solution also.
Thanks.
Regards.

Similar Messages

  • How to call a servlet in new window without toolbar from OA page

    How to call a servlet in new window without toolbar from a OA page?Please provide sample code

    I have tried with the way suggested in Mukul's blog using javascript in Destination URI property.
    I tried to open a OA Page and from which forwarded it to a servlet..
    It is showing the error:
    Error Page
    Exception Details.
    oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist.
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1223)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1969)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
         at oa_html._OA._jspService(_OA.java:86)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175)
         at oa_html._OA._jspService(_OA.java:96)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist.
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getAppId(OAWebBeanFactoryImpl.java:5391)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:969)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
         at oa_html._OA._jspService(_OA.java:86)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175)
         at oa_html._OA._jspService(_OA.java:96)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    oracle.apps.fnd.framework.OAException: The application id or shortname () you entered does not exist.
         at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getAppId(OAWebBeanFactoryImpl.java:5391)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:969)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:502)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:423)
         at oa_html._OA._jspService(_OA.java:86)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
         at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175)
         at oa_html._OA._jspService(_OA.java:96)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)

  • How to call a servlet from another servlet

    hi everybody,
    i have a problem, i have to call one servlet from another one.
    Everything works on my pc, but when i install the application on the customer's server i got an error about an Uknown URL followed by the name of the machine.
    Wjat i do is the folloqing :
    String urlString = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+servletName;
    URL url = new URL(urlString);
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    the variable servletName is the name of the servlet i have to call.
    Is there another way to call the servlet ?
    All the servlet are installed in the same server.
    Any suggestion ?
    Cheers.
    Stefano

    Sweep is correct about requestDispatcher being another approach for inter-servlet delegation; the only issue that i recall with this approach is that it defaults the method of the destination servlet to the one it was called from...for example, calling servlet2 from within servlet1.post() resulted in the dispatcher attempting to utilize servlet2.post() - i believe that i searched for a parameterize solution to no avail :( (ended up handling the request by placing a "fake" doPost() in servlet2 that simply called servlet2.doGet())
    however, if your application is functioning correctly on your pc/webserver then the problem may be external to servlet communication (e.g. client webserver's ports not configured or blocked, missing runtime classes, etc.)
    my suggestion would be to set aside the programmatic concerns for the moment - what is the response if you open a browser on a client's machine and access the URL in question (i.e. http://clientserver:port/stefanoServlet)? If it will not respond to access in this manner then it certainly won't when your application calls for it.
    It's possible that there is a coding error but, given the info supplied, i'd start examining the environment, first. Let us know if you have any luck with the test i recommended or not (please provide abundant detail). Or, if you've found the solution then you may want to post back with a quick blub so the next person knows how to escape the trap.
    D

  • How can i call a servlet from a servlet ?

    Hello,
    Can i call a Servlet from within a Servlet ?
    and is it "right thing" to Do ?
    Thanks

    JMO, but I wouldn't do it like this.
    Don't have a remote object like a servlet doing database queries for your app. That will mean TWO network hops for every query if the database resides on another machine. The network is the biggest bottleneck you've got.
    Write a JavaBean that does the database stuff for you and just have the first servlet instantiate it when it needs it. A Bean has a better chance of being reused, too. Write a TableGateway or DAO for your object.
    Or write an EJB to do it.
    The only time I've done a servlet-to-servlet connection like that was for one servlet running in a DMZ that would authenticate a user and then forward the request to another servlet running inside the second firewall.
    I wouldn't encapsulate database query logic in a servlet like that. JMO - MOD

  • I want to send a response from the servlet and then call another servlet.

    Hi,
    I want to send a response from the servlet and then call another servlet. can this happen. Here is my scenario.
    1. Capture all the information from a form including an Email address and submit it to a servlet.
    2. Now send a message to the browser that the request will be processed and mailed.
    3. Now execute the request and give a mail to the mentioned Email.
    Can this be done in any way even by calling another servlet from within a servlet or any other way.
    Can any one Please help me out.
    Thanks,
    Ramesh

    Maybe that will help you (This is registration sample):
    1.You have Registration.html;
    2.You have Registration servlet;
    3.You have CheckUser servlet;
    4.And last you have Dispatcher between all.
    See the code:
    Registration.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
      <HEAD>
        <TITLE>Hello registration</TITLE>
      </HEAD>
      <BODY>
      <H1>Entry</H1>
    <FORM ACTION="helloservlet" METHOD="POST">
    <LEFT>
    User: <INPUT TYPE="TEXT" NAME="login" SIZE=10><BR>
    Password: <INPUT TYPE="PASSWORD" NAME="password" SIZE=10><BR>
    <P>
    <TABLE CELLSPACING=1>
    <TR>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="logon" VALUE="Entry">
    </SMALL>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="registration" VALUE="Registration">
    </SMALL>
    </TABLE>
    </LEFT>
    </FORM>
    <BR>
      </BODY>
    </HTML>
    Dispatcher.java
    package mybeans;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Dispatcher extends HttpServlet {
        protected void forward(String address, HttpServletRequest request,
                               HttpServletResponse response)
                               throws ServletException, IOException {
                                   RequestDispatcher dispatcher = getServletContext().
                                   getRequestDispatcher(address);
                                   dispatcher.forward(request, response);
    Registration.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Registration extends Dispatcher {
        public String getServletInfo() {
            return "Registration servlet";
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            ServletContext ctx = getServletContext();
            if(request.getParameter("logon") != null) {          
                this.forward("/CheckUser", request, response);
            else if (request.getParameter("registration") != null)  {         
                this.forward("/registration.html", request, response);
    CheckUser.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class CheckUser extends Dispatcher {
        Connection conn;
        Statement stat;
        ResultSet rs;
          String cur_UserName;
        public static String cur_UserSurname;;
        String cur_UserOtchestvo;
        public String getServletInfo() {
            return "Registration servlet";
        public void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            try{
                ServletContext ctx = getServletContext();
                Class.forName("oracle.jdbc.driver.OracleDriver");
                conn = DriverManager.getConnection("jdbc:oracle:oci:@eugenz","SYSTEM", "manager");
                stat = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
               String queryDB = "SELECT ID, Login, Password FROM TLogon WHERE Login = ? AND Password = ?";
                PreparedStatement ps = conn.prepareStatement(queryDB); 
               User user = new User();
            user.setLogin(request.getParameter("login"));
            String cur_Login = user.getLogin();
            ps.setString(1, cur_Login);
            user.setPassword(request.getParameter("password"));
            String cur_Password = user.getPassword();
            ps.setString(2, cur_Password);
         Password = admin");
            rs = ps.executeQuery();
                 String sn = "Zatoka";
            String n = "Eugen";
            String queryPeople = "SELECT ID, Surname FROM People WHERE ID = ?";
           PreparedStatement psPeople = conn.prepareStatement(queryPeople);
                      if(rs.next()) {
                int logonID = rs.getInt("ID");
                psPeople.setInt(1, logonID);
                rs = psPeople.executeQuery();
                rs.next();
                       user.setSurname(rs.getString("Surname"));
              FROM TLogon, People WHERE TLogon.ID = People.ID";
                       ctx.setAttribute("user", user);
                this.forward("/successLogin.jsp", request, response);
            this.forward("/registration.html", request, response);
            catch(Exception exception) {
    }CheckUser.java maybe incorrect, but it's not serious, because see the principe (conception).
    Main is Dispatcher.java. This class is dispatcher between all servlets.

  • ABAP Calling JAVA Function or Method

    Hi Friend,
    I need help in how to proceed using  ABAP  and Call JAVA Function . I know that  we need to use RFC enabled Function modules. I was able to connect  using JAVA Connector which was provided by SAP For communicating with JAVA Apps. The approach for connecting the JAVA to SAP is working fine.  But I  have browsed through various website but failed to find any information.Now i am looking forward to help from you friends to solve my problems .
    The Requirement is mentioned below:-
      1. Prerequiste for SAP ABAP calling a third Party software which is working in JAVA Platform (like any middle ware which might be hardware or software).
      2. Sample Code  like calling a Text  ' Hello  to the world  calling JAVA from ABAP'.
      3. Steps and process so that it would be helpful.
    Timely help would be appreciated.
    Rajiv Christopher.

    1.Middleware is JCO RFC provider it comes with SAP so no need any third party Adapter.
    2.
    " The ECHOTXT parameter should contain the text of REQUTXT.Information on
    " calling the function module should be returned in RESPTXT, indicating, for
    " example, in which system and when the function module call was processed.
    data:ECHOTEXT type SY-LISEL,
         RESPTEXT type SY-LISEL.
    CALL FUNCTION 'STFC_CONNECTION' DESTINATION '<Your JCO destination name>' " which one you have developed in SM59 as TCP/IP
      EXPORTING
        requtext       = 'ABAP Calls JAVA'
    IMPORTING
       ECHOTEXT       = ECHOTEXT
       RESPTEXT       = RESPTEXT.
    if sy-subrc = 0.
      WRITE:/'---------------------------------------------------------------------'.
      WRITE: / 'establish a link to the ABAP application server with logon data'.
      WRITE:/'---------------------------------------------------------------------'.
      write:/ ECHOTEXT .
      else.
          WRITE:/'---------------------------------------------------------------------'.
      WRITE: / 'Not establish a link to the ABAP application server with logon data'.
      WRITE:/'---------------------------------------------------------------------'.
      endif.
    Check the sample code and Let me know will you get ECHOTEXT ?
    Kanagaraja L
    Edited by: Kanagaraja  Lokanathan on Jan 6, 2010 1:27 PM

  • The ABAP call stack was: SYSTEM-EXIT of program BBPGLOBAL

    Hi
    We are using SRM 5.0. We are facing a strange problem. We are able to see the initial screen of SRM EBP in the browser. But once the user name and password are provided the system goes for a dump with the following error:
    The following error text was processed in the system SS0 : System error
    The error occurred on the application server <Server Name> and in the work process 0 .
    The termination type was: ABORT_MESSAGE_STATE
    The ABAP call stack was: SYSTEM-EXIT of program BBPGLOBAL
    <b>SM21 Log:</b>
    Short Text
         Transaction Canceled &9&9&5 ( &a &b &c &d &e &f &g &h &i )
         The transaction has been terminated.  This may be caused by a
         termination message from the application (MESSAGE Axxx) or by an error
         detected by the SAP System due to which it makes no sense to proceed
         with the transaction.  The actual reason for the termination is
         indicated by the T100 message and the parameters.
    Transaction Canceled ITS_P 001 ( )
    Message Id: ITS_P
    Message No: 001
    I just checked these threads but did not help much,
    RABAX_STATE  error after loggin into BBPSTART service in SRM 4.
    ITS_TEMPLATE_NOT_FOUND error
    Besides I tried this note: 790727 as well, still I get the same error.
    Any help would be highly appreciated.
    Thanks in advance
    Kathirvel Balakrishnan

    Hi
    <u>Please do the following steps.</u>
    <b>When you are using the Internal ITS,you need not run the report W3_PUBLISH_SERVICES.(only SIAC_PUBLISH_ALL_INT )
    ALso pls check the foll:
    -->activate the services through SICF tcode.
    > Go to SICF transaction and activate the whole tree under the node Default host>sap>bc>gui>sap>its.
    >Also maintain the settings in SE80>utilities>settings>internet transaction server-->test service/Publish. (BBPSTART , BBPGLOBAL etc)
    Table TWPURLSVR should have entries for the / SRM server line as well as gui and web server.
    Could you please review again the following steps ?
    Did you check that ICM was working correctly (Transaction -  SMICM) ?
    1-Activate the necessary ICF services
    With transaction SICF and locate the
    services by path
    /sap/public/bc/its/mimes
    /sap/bc/gui/sap/its/webgui
    2- Publish the IAC Services
    With Transaction SE80 locate from
    the menu Utilities -> Settings ->
    Internet Transaction Server (Tab) ->
    Publish (Tab) and set “On Selected
    Site” = INTERNAL.
    3- Locate the Internet Services SYSTEM and WEBGUI.
    Publish these services with the Context
    Menu -> Publish -> Complete Service
    4- Browse to http://<server>:<icmport>/sap/bc/gui/
    sap/its/webgui/! and login to the
    webgui.</b>
    Hope this will help.
    Please reward suitable points.
    Regards
    - Atul

  • Calling a servlet in java class

    Hello,
    I try to call a servlet from java class
    but is dose not work
    what should be the problem
       public void callServlet()
              try
                            // xxservlet is the servlet name
                   URL url = new URL("http://www.mydomain.com/xxservlet");
                   URLConnection hpCon = url.openConnection();
                   hpCon.setDoOutput(true);
                   OutputStreamWriter out = new OutputStreamWriter(hpCon.getOutputStream());
                   out.write("This Is a Test");
                   out.flush();
                   out.close();
              }catch(Exception ex){ex.printStackTrace();}     
    // My Servlet  is in package servlets
    public class XXServlet extends HttpServlet
        public void service(HttpServletRequest req, HttpServletResponse resp) {
            try {
                 ServletInputStream sin = req.getInputStream();
                 int len = req.getContentLength();
                    byte[] input = new byte[len];
                    ServletInputStream sin = req.getInputStream();
                   int c, count = 0 ;
                   while ((c = sin.read(input, count, input.length-count)) != -1) {
                       count +=c;
                  sin.close();
                  String inString = new String(input);
                  System.out.println("Servlet is running ...."+inString);
            } catch (IOException e) {
                try{
                    resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
                    resp.getWriter().print(e.getMessage());
                    resp.getWriter().close();
                } catch (IOException ioe) {
    // web.xml
    <servlet>
           <servlet-name>xxservlet</servlet-name>
           <servlet-class>servlets.XXServlet</servlet-class>
        </servlet>
       <servlet-mapping>
        <servlet-name>xxservlet</servlet-name>
        <url-pattern>/xxservlet</url-pattern>
      </servlet-mapping>
    }regards
    Edited by: the_Orient on Mar 30, 2009 3:16 AM

    I have start servlet from brwoser only to test that servlet works fine
    A gain what I need
    I want to call a servlet from a javs class
    URL url = new URL("http://www.mydomain.com/myservlet");
      URLConnection hpCon = url.openConnection();
      hpCon.setDoOutput(true);
      OutputStreamWriter out = new OutputStreamWriter(hpCon.getOutputStream());
      out.write("Hello Woprld");
      out.flush();
      out.close();// Servlet
    public void doGet(HttpServletRequest req, HttpServletResponse resp) {
            try {
                  String xp =req.getSession().getServletContext().getRealPath("/");
                  File f = new File(xp+"/students/info.txt");
                  f.createNewFile();
            } catch (IOException e) {
                try{
                    resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
                    resp.getWriter().print(e.getMessage());
                    resp.getWriter().close();
                } catch (IOException ioe) {
    problem file can not be created
        public void doPost(HttpServletRequest req, HttpServletResponse resp)
    }I hope that is clear

  • Help needed to call a servlet from an applet

    Hi,
    can someone help me with the way to call a servlet from an applet.
    actually on click of a button i wanna call my servlet and save some data in DB.
    i am not able to call my servlet. see the sample code which i am trying..
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Upload")) {
    try {
    System.out.println("Upload button has been clicked -----------");
    URL url = new URL("http://localhost:8084/uploadApp/TestServlet");
    URLConnection urlConnection = url.openConnection();
    urlConnection.setDoInput(true);
    urlConnection.setDoOutput(true);
    urlConnection.setUseCaches(false);
    ObjectOutputStream objOut = new ObjectOutputStream (urlConnection.getOutputStream());
    objOut.writeBytes(userId); // pass parameter to servlet
    objOut.flush();
    objOut.close();
    } catch (MalformedURLException ex) {
    Logger.getLogger(ButtonListener.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
    Logger.getLogger(ButtonListener.class.getName()).log(Level.SEVERE, null, ex);
    is there any problem with the code? please suggest.

    hii,
    checkout my add from, HTH
    [http://forums.sun.com/thread.jspa?threadID=5419921&messageID=10885709#10885709]
    ... kopik

  • Calling a servlet from a servlet?

    Is it possible to call one servlet from another servlet?

    You should use servlets to process requests. If what you're asking for is to execute a piece of logic within a servlet before its finished processing the request, then you should consider using a regular java class instead of a servlet. If you just want to send the request information to another servlet you can use getRequestDipatcher().forward(..) method. Keep in mind that by doing so you'll interupt the current servlet.
    Regards,
    D.

  • Calling a servlet from another servlet?

    Hi
    I would like to know that how can I call one Servlet from another Servlet. I have tried getServlet() method of ServletContext but it has been deprecated. I want to call a specific method of the other Servlet, is there any other way?
    Thanks

    I should have seen it from your previous post :(
    Code of Servlet 1:
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws
    ServletException, IOException
    RequestDispatcher rDispatch = null ;
    rDispatch = getServletConfig
    ().getServletContext().getRequestDispatcher
    ("/Servlet2") ;
    rDispatch.forward(request, response) ;
    System.out.println("Back in 1");
    I assume Servlets 1and 2 are in same web app and you've mapped your servlet2 to /Servlet2 in your web.xml
    make it as
    rDispatch = request.getRequestDispatcher("/Servlet2");
    rDispatch.forward(request,response);
    Nothin's wrong with yer servlet2

  • Calling a servlet from XSQL

    Has anyone successfully called a servlet from xsql? If you have, have you called one from the href in the xsl:stylesheet?
    null

    Can you post a sample of what you're trying to do? Not sure what you mean by having the XSQL "call a servlet"? Call a servlet when? to serve/use what?
    Are you trying to using a servlet to return a dynamically-constructed stylesheet in the role of:
    <?xml-stylesheet type="text/xsl" href="http://foo/servlets/myservlet"?>
    If not, can you expound on what you're trying to achieve/accomplish?
    Thanks.

  • Servlets calls another servlet

    servlets calls another servlet ...how to do it ? whats the efficient way ?
    class myservlet extends HttpServlet
    // i want to call a servlet situated at another machine in the LAN whose, IP // 123.123.45.66 (say)
    the servlet which is situated in another machine
    remoteservlet extends HttpServlet
    doPost(...)
    how do i call ?
    few of the way i found by searching the forum.
    but i would like to know the good way in my situation.

    res.sendRedirect("LoginServlet?="+req.getRequestURI())
    i tested this. it does not work.
    my servlet wants to call another servlet which is
    active on IP xxx.ddd.ffff.zzz in the LAN .
    whats the way ?
    res.sendRedirect("http://xxx.ddd.ffff.zzz:<portnumber>/<context_name>/<servlet_regd_name">);The request and response objects are generated anew for that Servlet. There's no two ways about it, IMO.
    cheers,
    ram.

  • Calling One Servlet From Another

    Thanks in advance for any advice!
    I would like to call servletB from servletA then use the response returned from servletB within the processing of servletA.
    I have checked the forums and jGuru but nothing I've found really matches the problem. RequestDispatcher has "forward" and "include" but I do not want to include the reponse from the called servlet in the response of the original one.
    Here is the situation. I have a web application that uses an applet front-end using a mainframe datasource. The applet displays data in various JTables and prints various reports.
    The applet calls a servlet(B) with an SQL statement in the request that responds with a Vector of data to be displayed in the JTable. This is working fine.
    The applet also calls servlet(A) which uses iText from SourceForge to create a PDF report that is sent back to the browser for display in Adobe Reader. This also works fine.
    Because I cannot figure out how to call servletB from within servletA, my current workaround is to embed the code of servletB inside servletA. Not very good OOP and as the application grows maintaining this will become a problem.
    Any suggestions would be greatly appreciated.
    Max

    Why don't you just take the code that the applet uses to "call" servlet B and replicate that code into servlet "A"? (Or better still, create a class to do that, which could be called both from the applet and from servlet A.)

  • Manually call action servlet from JSP

    Hi All,
    I have a struts form that uploads a file (which works perfect with no problem). IN this form i have a <html:submit> button.
    My problem is, if I have a field say Employer field; and i would like to search the employer address as soon as the focus leaves the employer text field and display it in the same form. I wrote a javascript onchange="javascript:getEmpaddress(this)"my javascript is:
    function getEmpaddress(objForm) {
         document.objForm.action = "/searchForm";
         document.objForm.submit();
    return true;
    }this form is not submitting... anyone having a clue on this?
    PS: for the the upload part, i have written seperate action & form
    for the employer search i worte seperate action & form
    and registered them both in my struts config file
    Regards
    smallpost

    You can call the servlet via RequestDispatcher (include or forward method):
    RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("/servlet/ServletName");
    dispatcher.include(request,response);In the request you can store the data with setAttribute methode.
    And in the servlet you can get this data via request.getAttribute methode.
    Regards,
    Geri

Maybe you are looking for

  • I had a temperature warning come up on my iPhone 4 and now it won't turn on

    I had a temperature warning come up on my iPhone 4 saying I needed to cool it to use it or something and turned it off and attempted to turn it back on as a means of fixing it, but it didn't work and now my phone isn't turning back on and even when I

  • Problems with database access in Servlet Apllication (Duke's Bookstore)

    Hi! My name is Elena Veretilo! I am so newbie in JavaEE. So I really need you help and advice!!! I started to learn JavaEE with "The JavaEE5 tutorial for Sun Java Application Server 9.1" (http://java.sun.com/javaee/5/docs/tutorial/doc/) and this tuto

  • XI Installation: invalid XI SAP sid adm password

    During an initial XI installation on top of an ABAP + JAVA NW04 system. In the Java Deployment > Windows Domain installation step i am unable to enter the correct SAP <sid>adm password with below error message: "Invalid password. DIAGNOSIS: The passw

  • Just upgraded to iTunes 10.4 - Now I can't drag files from iTunes to Garageband

    Has anyone else experienced this problem? I do a podcast and keep my bed music, sfx and whatnot in iTunes. When I need something I just drag it from iTunes and into GarageBand (4.1.2). I upgraded iTunes last night (10.4) and now it no longer allows m

  • Using unlocked ATT iphone 3GS on Telenor?

    I was wondering if anyone has any experience using an unlocked AT&T Iphone in Europe. I have been provided with a Telenor SIM card for an ancient Samsung. I'm hoping to get the 3GS running in europe with minuets and data, has anyone used Telenor befo