Beginner's question: how to call JSP

Hi,
Is the following a right way to call a JSP?
GET /app/im/iClient.jsp?user=[email protected]&pass=welcome HTTP/1.1
Host: st5.abc.com
I am trying to manually send a HTTP request. I am sure the directory is right, but no response. Should I use "POST" instead of "GET"?
Thank you!

I dont believe that... If you're trying to get a response InputStream, or the response formatted as some object, for a request to an HTTP server, and you are just now writing Socket connection stuff, then you can just replace that with URLConnection and let it do the work given a URL.
Otherwise, you should already have a class which uses Sockets internally to get what you want, and you shouldn't be asking us this question because it should take a URL and make the connection and give you what you want...
I don't see any other possible "stage" at which you could be at that you need to a) use Sockets over URLConnections, b) need to know the details of HTTP, and c) can't change one or the other.

Similar Messages

  • How to call JSP that outputs XML without HTTP request

    It should be a simple solution but I can't seem to find a concise recommendation anywhere. We are building a B2B subsytem for our app and we need to send XML to our vendor. I'm evaluating the possibility of using JSPs for that and everything looks good until the time you actually want to invoke it. It's obvious how to code the JSP itself, but I'm looking for an efficient way to call it to generate XML. We do not have an HTTP request or a servlet, the communication is on the EJB level. So I can't get a RequestDispatcher for example, and we don�t have HttpServletRequest/HttpServletResponse either. It is NOT a servlet or JSP calling another JSP, it's a regular Java class or EJB.
    Ideally, I would rather bypass the whole HTTP infrastructure and just use JSP as a formatter. So it boils to a question of how to invoke it and how to pass the parameters without HTTP session or request. One of the alternatives we are reviewing is using XSP but we would prefer JSPs if we can figure out how to call it efficiently. HttpUrlConnection is not a good option, we'd like a direct call.
    Any suggestions will be greatly appreciated.

    Thanks for the response. Let me clarify the requirements for the question. The way we are supposed to send XML to the vendor is via CORBA (don't ask me why:-) where the only parameter essentially is a string containing the XML document. So the quesiton is not how to send it to the vendor, but how to format our JavaBeans into XML.
    We can't use JAXB because it doesn't support schema. We tried a few libraries out there but they stumble on our schema and we can't change it because it comes from the vendor. So it sounds like our only choice for today is to generate XML ourselves.
    The data is stored in JavaBean packet objects and that's our input. Our output should be a string with XML document conforming to the schema. Posting a request to ourselves will of course work, but that's too much unnecessary overhead. Another option is implementing HttpServletRequest and HttpServletResponse and calling service method directly. Better suggestions?

  • How to call jsp from another jsp

    Hi, All,
    I have several jsp files in my pagelet. I need to put a link in one jsp file. When client click the link, it will show another jsp file. Could anybody tell me how to do that?  i have tried to use following code in page1.jsp,
    IPortalComponentURI componentURI= componentRequest.createPortalComponentURI();
    componentURI.setContextName("pagelet/page2.jsp");
    String docuri = componentURI.toString();
    <body>
    click  '<a href="<%=docuri %> ">here</a>' to link to pages.
    But it does not work. Any help will be great appreciated.
    Marea
    Message was edited by:
            Marea Yang
    Message was edited by:
            Marea Yang

    HI Yang,
    You can achieve it through eventhandliling in jspdynpage.
    Go through this link ,
    i.<a href="http://help.sap.com/saphelp_nw70/helpdata/en/2e/d2a441cd47a209e10000000a155106/content.htm">eventhandling</a>.
    ii.<a href="https://forums.sdn.sap.com/thread.jspa?threadID=103335">method to call jsp</a>.
    iii.<a href="https://forums.sdn.sap.com/thread.jspa?threadID=393522">calling  resource JSP in Portal Compoent</a>
    Hope It'll help you.
    Regards ,
    Malini.V

  • How to call jsp from web dynpro app.

    Hi Frndz,
    How can I call a JSP from my web dynpro(and here i don't want to redirect to JSP ),I want to call a JSP which can show a message window as alert on top  of WDP view.
    Here am using CE 7.2 SP1, and my requirement is to call the model(back end) for every minute interval and need to give alert that how many new records r added.With WDP java i haven't find any option to give alert r notifications about new records added, so am thinking to call JSP where I will pass the parameter which can show a alert r notification(like FACEBOOK n outlook notifications).
    Please share any ideas ti achieve this,
    Thanks in advance.
    Regrads
    Rajesh

    Hi,
    If your application should open in a new url, then you can use link to url action to open jsp.
    You can also use EPCF navigation api to call any pcd page as well external links
    i.e
      WDPortalNavigation
          .navigateAbsolute("link",[parameters]);
    Since your passing parameters, you build url in both the cases.
    Ram

  • How to call JSP page from applet?

    I have some page1.jsp from which I call applet.
    User works with this applet but some information does not in date inside applet.
    So user click on some component at applet (some button etc.) and now I would like to do this:
    1) open new window;
    2) call page2.jsp at this new window.
    The reason is that page2.jsp will read some data from database and then displays it in HTML inside page2.jsp itself. It is not necessary to pass these date back to applet for displaying them inside of applet.
    So user then can have 2 windows: page1.jsp with applet and page2.jsp with some details information.
    But I DO NOT know how to call page2.jsp from applet, and do ti in a new window. Is it possible and how?
    Thanks
    Mirek

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MainMenu extends JApplet implements ActionListener
         private JMenuBar mbar;
         private JMenu Master,Leave,Report,Logout;
         private JMenuItem UserMaster,DeptMaster,DesignationMaster,LeaveAvailable,LeaveApply,Generate;
         private JPanel jp;
         public void init()
              mbar=new JMenuBar();
              Master=new JMenu("Master");
              Leave=new JMenu("Leave");
         Report=new JMenu("Report");
              Logout=new JMenu("Logout");
              UserMaster=new JMenuItem("UserMaster");
              UserMaster.setMnemonic('U');
              DeptMaster=new JMenuItem("DeptMaster");
              DeptMaster.setMnemonic('D');
              DesignationMaster=new JMenuItem("DesignationMaster");
              DesignationMaster.setMnemonic('D');
              LeaveAvailable=new JMenuItem("LeaveAvailable");
              LeaveAvailable.setMnemonic('L');
              LeaveApply=new JMenuItem("LeaveApply");
              LeaveApply.setMnemonic('L');
              Generate=new JMenuItem("Generate");
              Generate.setMnemonic('G');
              Master.add(UserMaster);
              Master.add(DeptMaster);
              Master.add(DesignationMaster);
              mbar.add(Master);
              Leave.add(LeaveAvailable);
              Leave.add(LeaveApply);
              mbar.add(Leave);
              Report.add(Generate);
              mbar.add(Report);
              mbar.add(Logout);
              UserMaster.addActionListener(this);
              DeptMaster.addActionListener(this);
              DesignationMaster.addActionListener(this);
              LeaveAvailable.addActionListener(this);
              LeaveApply.addActionListener(this);
              Generate.addActionListener(this);
              Logout.addActionListener(this);
              mbar.setVisible(true);
              Container con=getContentPane();
              con.add(mbar,BorderLayout.NORTH);
         public void actionPerformed(ActionEvent ae){
              if(ae.getSource()==UserMaster)
              }

  • How to call jsp /servlets running in different web application in tomcat

    hello all,
    i have 2 web applications(Charts and Reports) in the same tomcat,i want to call jsp/servlets running in the Reports webapp from Charts webapp.how do i achieve this.
    thanx
    ravi

    You can also use getContext(String context) in the ServletContext class to get a request dispatcher.
    Using the above example it would be :
    // in a servlet in the charts webapp
    ServletContext context = getServletContext();
    ServletContext reportsContext = context.getContext("/reports");
    RequestDispatcher dispatcher = reportsContext.getRequestDispatcher("/path")
    dispatcher.forward(request, response);Just note, that depending on your server's configuration getContext(...) might return null.

  • How to call jsp after reading from ServletInputStream?

              if the client submit a form including FILE type, I usually use ServletInputStream
              to read it and return next page by calling JSP file. but In weblogic6.0Sp1, the
              server will report a exception: One of the getParameter family of methods called
              after reading from the ServletInputStream(), can't mix these two!
              can anyone help me? thanx a lot.
              

    I've seen these messages in the WLS 5.1.0 logs when POSTing to servlets.
              All the reading is done in the servlet and then a JSP handles the view
              rendering. However, I don't actually call getParameter() or it's kin
              anywhere. I thought maybe something inside the JSP generated servlet is
              calling getParameter(), but I've looked at the generated code and can't find
              any calls. If I had a stack trace it would be easier to sort out.
              Is this a warning or an error? Is there a bad side effect. I imagine the
              getParameter() call would fail.
              Dave
              "dancy" <[email protected]> wrote in message
              news:3ac85201$[email protected]..
              >
              > if the client submit a form including FILE type, I usually use
              ServletInputStream
              > to read it and return next page by calling JSP file. but In
              weblogic6.0Sp1, the
              > server will report a exception: One of the getParameter family of methods
              called
              > after reading from the ServletInputStream(), can't mix these two!
              > can anyone help me? thanx a lot.
              

  • How to call jsp/ejb in webdynpro applications

    Hi
    Is It Possible to call jsp and EJB in webdynpro applications.If it is please let me know..
    Regards
    Chandra

    Hi,
    You can call JSp and serlvets using suspend and resume plugs
    /people/bertram.ganz/blog/2006/07/03/web-dynpro-java-foundation--whats-new-in-sap-netweaver-2004s
    http://help.sap.com/saphelp_nw04s/helpdata/en/42/bb8c6cc7131d67e10000000a1553f6/frameset.htm
    For EJbs you can create a DTO and try to make use of the model import available in Webdynpro.
    Regards
    Ayyapparaj

  • Designer beginner's question: How to populate form with XML web service output?

    sorry, here is yet another Adobe Designer beginners question: <br /><br />My form uses a webservice data connection which returns <br />an xml-string like this: <br /><br /><?xml version="1.0" encoding="utf-16"?> <br /><CurrentWeather> <br />  <Location>Sion, Switzerland (LSGS) 46-13N 007-20E 481M</Location> <br />  <Time>Apr 26, 2007 - 09:50 AM EDT / 2007.04.26 1350 UTC</Time> <br />  <Wind> from the WSW (240 degrees) at 15 MPH (13 KT):0</Wind> <br />  <Visibility> greater than 7 mile(s):0</Visibility> <br />  <SkyConditions> partly cloudy</SkyConditions> <br />  <Temperature> 80 F (27 C)</Temperature> <br />  <DewPoint> 46 F (8 C) </DewPoint> <br />  <RelativeHumidity> 30%</RelativeHumidity> <br />  <Pressure> 29.88 in. Hg (1012 hPa)</Pressure> <br />  <Status>Success</Status> <br /></CurrentWeather> <br /><br />What is the simplest and recommended way to extract the <br />element fields to my form? <br /><br />Thank you very much an kind regards, <br />Hans Grund

    The question is still unanswered!
    Let me give some details and break up the problem
    in more specific questions:
    - In Designer 8.1 I click new data binding --> wsdl -->
    http://www.webservicex.net/globalweather.asmx?wsdl
    A message box comes up and says "cannot load wsdl file"
    ==> 1. Question:
    Why maybe refuses Designer to load the http-wsdl,
    although this option is explicitly allowed?
    - When I save the wsdl to a file, Designer loads it
    without any problems. The web service uses two input parameters
    (CountryName and CityName) and returns an xml-string GetWeatherResult)
    like the one in my first posting. I drag these fields from the binding view to my form, and it runs ok!
    - THE PROBLEM IS, THAT I NEET TO EXTRACT THE ELEMENT FIELDS
    FROM THE RESULT XML-STRING!
    ==> 2. Question:
    How to extract xml element fields from wsdl output into a form?
    - I tried with eclipse and XmlSpy to build a modified wsdl file
    with structured output definition, so that the specific element fields
    show up in the data binding view and are usable to my form,
    and the modified wsdl maps consistently to the web service result string.
    So far without success: In the PDF -preview or Reader-
    when the wsdl-binding is executed and the web service output
    should show up in the result fields, just nothing happens.
    ==> 3. Question:
    Can this strategy to provide a "modified wsdl" possibly succeed,
    and how?
    ==> 4. Question:
    Is is possible -and how?- to check whether an xml string
    is valid as web service output against the wsdl-definition?
    ==> 5. Question:
    How to debug a web service connection with Designer?
    - Finally I tried to find a way to load the result xml-string
    into a local var in the script editor and parse it, much like:
    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.load(DataSet.MyForm.GetWeatherResult.rawValue);
    ==> 6. Question:
    Is it possible -and how?- to use a framework like dotnet?
    How to utilize SAX or DOM in Designer?
    Many thanks and appreciations for your help!!

  • How to call JSp from Servlet??

    Hello,
    I want to call JSP page from servlet.I am using Visual Age For java 3.4. What is wrong in my code??
    if (userExists) {
    f.setErrors("userName","Duplicate User: Try a different username");
    getServletConfig().getServletContext().
    getRequestDispatcher("/jsp/forms/retry.jsp").
    forward(request, response);
    I am not able to get the o/p. Pls help.

    I can't see anything obvious, but did you take any steps towards doing output before this code (like openning an output stream)?
    Not clear what f.setErrors does - presumably stuffs the error message in an attribute of the request.

  • How to call jsp from bpel

    Hi,
    My application is to call jsp from bpel and connect to database is it possible?
    Thanks,
    A

    Your requirement really has very little to do with BPEL.
    Every BPEL process is also a web service. So what you want to do is call a web service from a jsp.
    The steps would be:
    1. Use Jdeveloper to build a web service proxy class around the BPEL process wsdl. (the WSDL tab for the BPEL process exposes the WSDL to you)
    2. Call the methods in the web service proxy class from your jsp.
    HTH,
    Neil.

  • Newbie question : How to call a servlet from JSP?

    my web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <display-name>Test</display-name>
      <description>
         Test
      </description>
    <servlet>
            <servlet-name>Test1</servlet-name>
            <servlet-class>Test1</servlet-class>
        </servlet>
        <servlet-mapping>
           <servlet-name>Test1</servlet-name>
           <url-pattern>/test1</url-pattern>
        </servlet-mapping>
         <security-constraint>
          <web-resource-collection>
             <web-resource-name>Protected Group</web-resource-name>
          <!-- Define the context-relative URL(s) to be protected -->
             <url-pattern>/jsp/security/protected/*</url-pattern>
          <!-- If you list http methods, only those methods are protected -->
          <http-method>DELETE</http-method>
             <http-method>GET</http-method>
             <http-method>POST</http-method>
          <http-method>PUT</http-method>
          </web-resource-collection>
          <auth-constraint>
             <!-- Anyone with one of the listed roles may access this group -->
             <role-name>tomcat</role-name>
          <role-name>role1</role-name>
          </auth-constraint>
        </security-constraint>
        <!-- Default login configuration uses BASIC authentication -->
        <login-config>
          <auth-method>BASIC</auth-method>
          <realm-name>Example Basic Authentication Group</realm-name>
        </login-config>
    </web-app>my index.html
    <html>
    <body>
    <a href="/test1">test</a>
    </body>
    </html>I put my Test1.class in ../WEB-INF/classes.
    When I click the link for test1, I got the following message
    HTTP Status 404 - /test1
    type Status report
    message /test1
    description The requested resource (/test1) is not available.
    Apache Tomcat/4.1.18-LE-jdk14please help. thanks

    Hi,
    You have not said if your servlet is in a package in which case which one.
    you need to add the '/servlet/' to the href so it becomes
    '/servlet/test1'.
    Phil

  • Question: How to call a BPEL process from a PL/SQL procedure

    Hi All,
    Greetings to all BPEL people. I have a question on how can we call a BPEL process from a PLSQL procedure. It might be a stupid question but i wanted to know whether this fetaure is available in BPEL as our scenario requires us to explore if this functionality is available in BPEL.
    Please let me know and also if possible please send me the links for the tutorials if it is available.
    Thanks In Advance,
    Dibya

    Yes u can do it. there are two ways.
    1) First one is using utl_http package of PL/SQL
    In this case u can create SOAP request message & send it as Http request to your deployed BPEL process.
    This package provides some methods like
    set_header,write_text,get_response,read_text etc..
    Following is part of code which may be helpful to you.
    create or replace package body test_book_order_sub_pkg
    is
    FUNCTION test_book_order_sub(p_subscription_guid IN RAW,
    p_event IN OUT WF_EVENT_T
                                            Return VARCHAR2 IS
    soap_request varchar2(30000);
    soap_respond varchar2(30000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    launch_url varchar2(240) ;
         begin
         DBMS_OUTPUT.Put_Line('Subscription : Order has been booked');
         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/BES_BookOrder">
    <ns1:BES_BookOrderProcessRequest>
    <ns1:input>725</ns1:input>
    </ns1:BES_BookOrderProcessRequest>
    </soap:Body>
    </soap:Envelope>';
    http_req:= utl_http.begin_request
    ('http://172.28.5.191:8888/orabpel/default/BES_BookOrder/1.0',
    'POST',
    'HTTP/1.1'
    utl_http.set_header(http_req, 'Content-Type', 'text/xml') ;
    utl_http.set_header(http_req, 'Content-Length', length(soap_request)) ;
    utl_http.set_header(http_req, 'SOAPAction', 'initiate');
         utl_http.write_text(http_req, soap_request) ;
    http_resp:= utl_http.get_response(http_req) ;
    utl_http.read_text(http_resp, soap_respond) ;
    utl_http.end_response(http_resp) ;
    DBMS_OUTPUT.Put_Line(soap_respond);
    return('SUCCESS');
    end test_book_order_sub;
    end test_book_order_sub_pkg;
    2) Second way is make your BPEL process listening to some database Queue(use AQ Adapter). & then put some message in tht queue from ur Pl/SQL code . This will also initiate BPEL instance. Check out AQAdapter tutorials.
    /mishit

  • How to call jsp web report from forms 9i

    Dear fellows,
    How can i call a jsp report from forms 9i.
    Thanx
    Mochoo

    Use web.show_document instead of Run_Report_Object. If the jsp contains a paper layout you can still use Run_Report_Object, but you have to specify the filename extension .jsp along with the filename.

  • How to call jsp?

    Hi all,
    I have two jsp file in my project test1.jsp and test2.jsp.
    I listed some link in test1.jsp using htmlB link control. If I click that link it will go to the java file there some action will taken then that will set second jsp file as result.
    Like this,
    if(state==0)
    this.setJspName("test1.jsp");
    else
    this.setJspName("test2.jsp");
    I need to open the test2.jsp in new window.
    I tried the
    target=”_blank”
    in link control also it not opening a new window.
    Is this possible? Help me.
    Helpful answers will appreciate.
    Thanks in advance.
    Regards,
    Kathiresan R

    Hi,
       I get your question. Can think of one solution. You can create JSP2 with new portal component. Create a dumy JSP. Now When else statement is called, call dummy JSP with javascript to open JSP2 in new window like this.
    window.open(Project.portalcomponentname,title);
    Let me know if it works.
    Regards,
    Harini S

Maybe you are looking for

  • Data from a table

    i am populating data to a table. when i click ant row in the table that row data should be displayed in the panel below that of the table panel in correspondin text fields..... how do i do this ............. can anybody please help

  • How to define an aggregation rule for a dimension based on bridge table?

    Hello, I need a solution for aggregating data correctly when using a dimension based on a set of dimensione tables containing a bridge table. Please find below a description of my business case and the OBIEE model which I’ve created thus far. Busines

  • Script to Change swatch CMYK values

    Are there any scripts available to change CMYK values of swatches for files in CS3? I have hundreds, probably thousands of Illustrator EPS files that use swatches all drawn from a total palette of maybe 50 colours. Each colour is named and has a corr

  • Jaxp fails to unmarshall xml document if it contaions the "&" character

    Hi,      We are using JAXB in our applications and have recently experienced a problem with parsing of xml document ( when calling unmarshall method of jaxb ). The problem occurs when the xml element contains the character & in it f.eks. "Hennes & Ma

  • Generic classes with parameterized super class and interface

    Hello. I'm trying to write a generic class that looks like the following pseudo-code. public interface Interface {     public Interface getSibling(...); public class Klass {...} public class MyKlass<T extends Klass, T2 extends Interface>         exte