🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: create and call from a JSP from a servlet

#485
From: objectman
Date: Wed, 09 Jan 2002 05:37
61 lines
3562 bytes
You can create the file without a problem.
But, what you're missing is. You must then package up this
file into a J2EE compliant war file, then deploy it into your
respective appserver. In order to access it via an http.
A context needs to be created.

"Thomas Rademacher" <thomas.rademacher@unicum.de> wrote in message
news:5b2d9544.0201080814.381c8e08@posting.google.com...
> 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
Technical Details
Message-ID: <fGQ_7.678$gp.82049@typhoon.austin.rr.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!cyclone.tampabay.rr.com!cyclone.austin.rr.com!typhoon.austin.rr.com.POSTED!53ab2750!not-for-mail
References: <5b2d9544.0201080814.381c8e08@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10a146,59be8b2b676c1bd3
X-Google-Attributes: gid10a146,public
X-Google-Thread: 10026d,59be8b2b676c1bd3
X-Google-Attributes: gid10026d,public
X-Google-Thread: f4be4,59be8b2b676c1bd3
X-Google-Attributes: gidf4be4,public
X-Google-ArrivalTime: 2002-01-08 21:52:25 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!cyclone.tampabay.rr.com!cyclone.austin.rr.com!typhoon.austin.rr.com.POSTED!53ab2750!not-for-mail
From: "objectman" <kcintron@elp.rr.com>
Newsgroups: comp.lang.java.programmer,weblogic.developer.interest.jsp,borland.public.jbuilder.servlets-jsp
References: <5b2d9544.0201080814.381c8e08@posting.google.com>
Subject: Re: create and call from a  JSP from a servlet
Lines: 63
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <fGQ_7.678$gp.82049@typhoon.austin.rr.com>
Date: Wed, 09 Jan 2002 05:37:15 GMT
NNTP-Posting-Host: 24.162.201.18
X-Complaints-To: abuse@rr.com
X-Trace: typhoon.austin.rr.com 1010554635 24.162.201.18 (Tue, 08 Jan 2002 23:37:15 CST)
NNTP-Posting-Date: Tue, 08 Jan 2002 23:37:15 CST
Organization: Road Runner - Texas