Thread View: comp.lang.java.programmer
4 messages
4 total messages
Started by Thomas Rademacher
Tue, 08 Jan 2002 16:14
create and call from a JSP from a servlet
Author: Thomas Rademacher
Date: Tue, 08 Jan 2002 16:14
Date: Tue, 08 Jan 2002 16:14
53 lines
2846 bytes
2846 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
REPOST: Re: create and call from a JSP from a servlet
Author: Dan Hinojosa
Date: Tue, 08 Jan 2002 19:45
Date: Tue, 08 Jan 2002 19:45
81 lines
5001 bytes
5001 bytes
Hmmmmmm. Although there is an answer out there. The JSP and servlet
technologies weren't meant to be used like that. If you need some
runtime operations done on the JSP I highly recommend taglibs. What is
it you are trying to do anyway? Can you let us on it, and maybe we can
get you up and running faster, or email me direct at dhinojosa@qwest.net
Dan Hinojosa
Thomas Rademacher wrote:
> 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!nntp.cs.uni-magdeburg.de!fu-berlin.de!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!feed.news.qwest.net!news.uswest.net.POSTED!u_n_a__c_ancel
From: Dan Hinojosa <dhinojosa@qwest.net>
Control: cancel <3C3B4C62.80506@qwest.net>
Subject: cmsg cancel <3C3B4C62.80506@qwest.net>
Newsgroups: comp.lang.c,comp.lang.java.programmer
Message-ID: <cancel.3C3B4C62.80506@qwest.net>
X-No-Archive: yes
Lines: 2
Date: Sat, 12 Jan 2002 02:18:24 GMT
NNTP-Posting-Host: 209.3.144.105
X-Trace: news.uswest.net 1010802513 209.3.144.105 (Fri, 11 Jan 2002 20:28:33 CST)
NNTP-Posting-Date: Fri, 11 Jan 2002 20:28:33 CST
Xref: news.uni-stuttgart.de control:40504312
autocancel
Re: create and call from a JSP from a servlet
Author: Dan Hinojosa
Date: Tue, 08 Jan 2002 19:45
Date: Tue, 08 Jan 2002 19:45
64 lines
3563 bytes
3563 bytes
Hmmmmmm. Although there is an answer out there. The JSP and servlet
technologies weren't meant to be used like that. If you need some
runtime operations done on the JSP I highly recommend taglibs. What is
it you are trying to do anyway? Can you let us on it, and maybe we can
get you up and running faster, or email me direct at dhinojosa@qwest.net
Dan Hinojosa
Thomas Rademacher wrote:
> 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
>
Re: create and call from a JSP from a servlet
Author: objectman
Date: Wed, 09 Jan 2002 05:37
Date: Wed, 09 Jan 2002 05:37
61 lines
3562 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads