----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
I think the problem is that GNU-JSP needs some JSDK 2.1 classes to compile
the .jsp's
it creates, but that JServ doesn't implement the JSDK 2.1 stuff.
In Jserv, 2 ways I know if to do what you're trying:
1) Put all the data needed in the session, then redirect to a .jsp. The
.jsp then
gets its data from the session. Requires an extra client-server roundtrip,
and requires
that you use sessions.
2) Hack gnu-jsp to add a new public "callpage" method. Then in your
servlets that
need to do callpage-like stuff, create an instance of the gnu-jsp servlet
and call
the hacked method. I had this working at one time, but I can't recall the
details --
I'm sure if you look at the source, it won't be too hard to see what needs
doing.
Of course, you could always go to Tomcat ...
- Fernando
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Ajay
> Govindarajan
> Sent: Monday, September 25, 2000 7:15 PM
> To: 'Java Apache Users'
> Subject: calling JSP's from servlets??
>
>
> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files. Don't make us guess your problem!!!
> ----------------------------------------------------------------
>
> Hi,
>
> I am currently using Websphere and our architecture involves :
> a) creating Beans in our servlets
> b) calling JSP's from these servlets which use these beans.
>
> Since we were using JSDK2.0 and JSP 0.92, we did this using the following
> way:
>
> a) ((com.sun.server.http.HttpServiceRequest)
> req).setAttribute("results", result);
>
> b)((com.sun.server.http.HttpServiceResponse)
> resp).callPage("test.jsp", req);
>
> where result is an instance of a bean, and req is an instance of
> HttpServletRequest
>
> Now we use apache_1.3.12, ApacheJServ-1.1.2 and gnujsp-1.0.0. I
> am unable to
> do the same with this setup, as with JSP1.0 the callPage method has been
> removed. SO I tried the following (which is very similar to the way JSP's
> are called using JSDK2.2 and JSP1.1)
>
> a)((org.gjt.jsp.jsdk20.HttpServletRequestWrapper)
> req).setAttribute("result", result);
>
> b) RequestDispatcher dispatcher =
> ((org.gjt.jsp.jsdk20.ServletContextWrapper) getServletContext
> ()).getRequestDispatcher("test.jsp");
>
> dispatcher.forward(req, resp);
>
> where result is an instance of a bean, and req is an instance of
> HttpServletRequest.
>
> This compiles okay, however I find that when I access the URl
> which invokes
> this servlet, I get a classcast exception for both the lines.
>
> Is this method okay?? Or is there any obvious alternative that I
> am missing.
>
> Thanx,
>
> Ajay
>
>
>
>
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search Archives:
> <http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]