🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.programmer
Article #482

REPOST: create and call from a JSP from a servlet

#482
From: Thomas Rademacher
Date: Tue, 08 Jan 2002 16:14
70 lines
4432 bytes
Hallo,
I have the following problem:

In a servlet (not generated from a jsp file) in the function doGet() I
will create in dependency of different input parameters different jsp
files and I will call the generated jsp file.
 
I can create the jsp-Code with...

public void doGet(
  javax.servlet.http.HttpServletRequest request,
  javax.servlet.http.HttpServletResponse response)
  throws javax.servlet.ServletException, java.io.IOException {

        String text = null;
        text =        "<%@ page import=\"java.util.*\"%>";
        text = text + "<%@ page
contentType=\"text/html;charset=iso-8859-1\"
%>";
        text = text + "<jsp:useBean id=\"edi\" scope=\"session\"
class=\"jsp.MyClass\" />";
        text = text + "<%";
        text = text + " here: call functions...";
        text = text + "%>";
        text = text + "<html><head>head>";
        text = text + "<body>xxxx</body></html>";
        response.setContentType("text/html");
        PrintWriter out = new PrintWriter(response.getOutputStream());
        out.println(text);
        out.close();
 }

...and I see this code im my browser. But it will not create java
code, no code is executes.



With...

public void doGet(
  javax.servlet.http.HttpServletRequest request,
  javax.servlet.http.HttpServletResponse response)
  throws javax.servlet.ServletException, java.io.IOException {

  response.sendRedirect("http://localhost:8080/myProject/file_xyz.jsp");
 }

...I can call a jsp file. But I have not this file ( I want to create
this file!) in the moment of call.
I can not create a temporar file and call this file with
sendRedirect()!!

Thank you for your hints, Thomas

========= WAS CANCELLED BY =======:
Path: news.uni-stuttgart.de!dns.phoenix-ag.de!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!diablo.theplanet.net!news.maxwell.syr.edu!newsfeed.cwix.com!feed.news.qwest.net!news.uswest.net.POSTED!u_n_a__c_ancel
From: thomas.rademacher@unicum.de (Thomas Rademacher)
Control: cancel <5b2d9544.0201080814.381c8e08@posting.google.com>
Subject: cmsg cancel <5b2d9544.0201080814.381c8e08@posting.google.com>
Newsgroups: comp.lang.c,comp.lang.java.programmer
Message-ID: <cancel.5b2d9544.0201080814.381c8e08@posting.google.com>
X-No-Archive: yes
Lines: 2
Date: Sat, 12 Jan 2002 01:30:55 GMT
NNTP-Posting-Host: 209.3.144.105
X-Trace: news.uswest.net 1010802700 209.3.144.105 (Fri, 11 Jan 2002 20:31:40 CST)
NNTP-Posting-Date: Fri, 11 Jan 2002 20:31:40 CST
Xref: news.uni-stuttgart.de control:40505121

autocancel
Technical Details
Message-ID: <0$--$$------$_-$-$@news.noc.cabal.int>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.noc.cabal.int!resurrector!guidorepost!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10a146,a78032c12c1eeaea,start
X-Google-Attributes: gid10a146,public
X-Google-Thread: f4be4,a78032c12c1eeaea,start
X-Google-Attributes: gidf4be4,public
X-Google-Thread: 10026d,a78032c12c1eeaea,start
X-Google-Attributes: gid10026d,public
X-Google-ArrivalTime: 2002-01-12 01:41:37 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.noc.cabal.int!resurrector!guidorepost!not-for-mail
From: thomas.rademacher@unicum.de (Thomas Rademacher)
Subject: REPOST: create and call from a  JSP from a servlet
Newsgroups: comp.lang.java.programmer,weblogic.developer.interest.jsp,borland.public.jbuilder.servlets-jsp
X-Repost-Date: 12 Jan 2002 09:06:59 GMT
Message-ID: <0$--$$------$_-$-$@news.noc.cabal.int>
X-Original-Path: sn-us!sn-xit-02!supernews.com!postnews1.google.com!not-for-mail
X-Original-Message-ID: <5b2d9544.0201080814.381c8e08@posting.google.com>
X-Original-NNTP-Posting-Host: 194.114.63.8
Date: 8 Jan 2002 08:14:18 -0800
Organization: http://groups.google.com/
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1010506459 16176 127.0.0.1 (8 Jan 2002 16:14:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 8 Jan 2002 16:14:19 GMT
Sender: resurrector@mindspring.com (Guido the Resurrector)
X-Comment: More debugging material for HipCrime... Enjoy!
X-Reposted-By: resurrector@mindspring.com (Guido the Resurrector)
X-Comments: GtR Repost: The following Usenet article was cancelled, more
X-Comments: than likely by someone other than the original poster.  Please
X-Comments: see the end of this posting for a copy of the cancel.
X-Comments: Guido the Resurrector can be contacted at
X-Comments: resurrector@mindspring.com.
Lines: 70