Trampoline code again

Discussion in 'Java' started by Covington Bradshaw, Sep 2, 2004.

  1. First please do not make trampoline jokes, because when I was 5, I fell
    from my brother's bed after happily jumping and since I am in a wheel
    chair.

    I am looking for a trampoline jsp or servlet. Explanation:
    something like ...
    http://blablabla/trampoline.jsp?jump="http://albalbalbalb/page.html"
    Then show the page.html of someone else albalbalbalb Web site in a frame
    of my blablabla Web site or something like that. Got it?

    JspWriter out = pageContext.getOut();

    URL url;
    int responseCode = 0;
    HttpURLConnection connection = null;
    InputStream input;
    BufferedReader dataInput;

    try {
    jumpTo = URLDecoder.decode(subcontext);
    url = new URL(jumpTo);
    connection = (HttpURLConnection) url.openConnection();
    responseCode = connection.getResponseCode();
    }
    catch (Exception ex) {}

    try {
    input = connection.getInputStream();
    dataInput = new BufferedReader(new InputStreamReader(input));
    while ((line = dataInput.readLine()) != null) {
    out.println(line);
    }
    ...

    How do I handle links to images etc...?
    Any code example?

    Thanks, I have to stop typing now and I must go to take a bath.
     
    Covington Bradshaw, Sep 2, 2004
    #1
    1. Advertising

  2. Covington Bradshaw

    Tony Morris Guest

    "Covington Bradshaw" <> wrote in message
    news:p...
    > First please do not make trampoline jokes, because when I was 5, I fell
    > from my brother's bed after happily jumping and since I am in a wheel
    > chair.


    You are assuming you have a sympathetic audience.
    This might work in reality (with exceptions - see the next paragraph), but
    not Usenet.

    Personally, I don't change my behaviour for anyone regardless of their
    previous misfortune.
    I wouldn't expect others to do it for me either.
    This personal trait has nothing to do with Usenet.

    > I am looking for a trampoline jsp or servlet. Explanation:
    > something like ...
    > http://blablabla/trampoline.jsp?jump="http://albalbalbalb/page.html"
    > Then show the page.html of someone else albalbalbalb Web site in a frame
    > of my blablabla Web site or something like that. Got it?


    No - and that's the funny bit.
    In fact, you have earnt yourself a place on an internal network website for
    a section title, "Funny Quotes".
    Now that we have all stopped giggling, let's put this into perspective.
    Let's assume a topic where you are informed and I am not ... lemme think ...
    "automotive differential reconditioning". So that's our topic.
    Let's then take someone who is requesting information from you (the informed
    person).
    They do it as follows, "Does anyone have a typewriter jellyfish for balloon
    folding in the iron bark cave speak with the handy polyp differential?" Now,
    it's quite clear I'm just inserting random nouns/adjectives here in the
    sentence, but suppose I was serious - this would be quite amusing for the
    person receiving the information, don't you agree?

    Here is a clear cut answer:
    There is no such thing as a "trampoline servlet". In fact, "trampoline" is
    one of the funniest adjectives that I've heard someone use for a servlet. So
    in order to answer your question, it would be in your best interest to read
    up on the topic so that you can formulate a question that is less funny, and
    more answerable. Unless, of course, you share my sense of humour and you
    wish to continue providing amusement. If your ego is bruised, then I do not
    apologise - others have laughed at my naivety in the past - take it lightly.
    Good luck.

    http://java.sun.com/docs/books/tutorial/servlets/

    --
    Tony Morris
    http://xdweb.net/~dibblego/
     
    Tony Morris, Sep 4, 2004
    #2
    1. Advertising

  3. Covington Bradshaw

    Chris Uppal Guest

    Tony Morris wrote:

    > Here is a clear cut answer:
    > There is no such thing as a "trampoline servlet". In fact, "trampoline" is
    > one of the funniest adjectives that I've heard someone use for a servlet.


    Actually, "trampoline" is a quite well-established term for code that just
    "bounces" the caller to a different implementation. I have been seeing it used
    for several years, and I like and use it myself.

    I don't know what the OP means by "trampoline servlet", but if /I/ used the
    term then I'd mean a simple servlet that exists only to channel requests to a
    different service, either by HTTP redirects, or by forwarding the request
    internally. What's more, if I used that term in that sense, then I'd expect to
    be understood by my auditors, or at least that they would require only a
    brief explanation after which they would find the expression completely
    natural.

    If that is what the OP is looking for then it seems quite simple; presumably
    the difficulty is in maintaining session state across the bounce -- especially
    if only part of the session /is/ bounced. I don't know enough about servlet
    programming to recommend specific implementation approaches, but it sounds a
    common enough requirement that there should be examples, or other guidance,
    out there on the Web somewhere.

    -- chris
     
    Chris Uppal, Sep 4, 2004
    #3
  4. Covington Bradshaw

    Sudsy Guest

    Chris Uppal wrote:
    <snip>
    > Actually, "trampoline" is a quite well-established term for code that just
    > "bounces" the caller to a different implementation. I have been seeing it used
    > for several years, and I like and use it myself.

    <snip>

    It was the first time I'd seen the term "trampoline" and was similarly
    confused. Now if the OP had called it a "proxy servlet" then I would
    have known precisely what he/she was talking about. Using the commonly
    accepted terminology facilitates effective communication.
     
    Sudsy, Sep 4, 2004
    #4
  5. Covington Bradshaw

    Tony Morris Guest

    > Actually, "trampoline" is a quite well-established term for code that just
    > "bounces" the caller to a different implementation. I have been seeing it

    used
    > for several years, and I like and use it myself.


    Can you provide a reference to some authoritative source?
    Google provides only ad hoc possibilities.

    --
    Tony Morris
    http://xdweb.net/~dibblego/
     
    Tony Morris, Sep 5, 2004
    #5
  6. Covington Bradshaw

    Chris Uppal Guest

    Tony Morris wrote:

    > > Actually, "trampoline" is a quite well-established term for code that
    > > just "bounces" the caller to a different implementation. I have been
    > > seeing it used for several years, and I like and use it myself.

    >
    > Can you provide a reference to some authoritative source?


    No, sorry. This one seems to be a bit of emerging grass-roots terminology, not
    something dreamed up by a Big Name. (One of the reasons, apart from its
    vividness, that I like it)

    FWIW, I first saw it used (in this sense) in one of the papers on
    proposed/prototype generics implementations for Java, where it was used to
    describe the bytecode that was generated on-the-fly for adapting generic code
    to primitive types.

    Looking for "trampoline code" (with the quotes) turns up quite a few examples.
    Kaffe is the most Java related. There also seems to be a fairly
    well-established usage (that I wasn't aware of) that applies it in a more
    restrictive sense. See, for instance, the entry for "trampoline" at
    jargon.watson-net.com


    > Google provides only ad hoc possibilities.


    There are some things Google can't do :-( Someone mentioned a program called
    "News Agent" to me yesterday, and I need to find out more about it; as you can
    imagine, Google isn't a lot of help...

    [OT: does anyone know of a program with that specific name ? All I know about
    it is that it runs under Windows and uses a GUI with some sort of tree widget;
    there's no suggestion that it's written in Java.]

    -- chris
     
    Chris Uppal, Sep 5, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Covington Bradshaw

    Trampoline code

    Covington Bradshaw, Aug 29, 2004, in forum: Java
    Replies:
    3
    Views:
    490
    Bryan E. Boone
    Aug 30, 2004
  2. Hans Kiehn
    Replies:
    0
    Views:
    565
    Hans Kiehn
    Nov 24, 2004
  3. glathoud
    Replies:
    28
    Views:
    406
    glathoud
    Feb 6, 2010
  4. Replies:
    20
    Views:
    659
    Rivka Miller
    Nov 6, 2012
  5. Replies:
    15
    Views:
    566
    Rivka Miller
    Nov 6, 2012
Loading...

Share This Page