----------------------------------------------------------------
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!!!
----------------------------------------------------------------




Hello Nick,

 Thanks for your answer.
You should expect that a programmer has already did the casting.
Otherwise, I wouldn't have posted this message.
Shame on you if you cannot atleast assume that ;-)).

bye
Naga





Nick Bauman <[EMAIL PROTECTED]> on 01/11/2000 11:51:47 AM

Please respond to "Java Apache Users"
      <[EMAIL PROTECTED]>

To:   Java Apache Users <[EMAIL PROTECTED]>
cc:    (bcc: Naga Chakka/ec_company)
Subject:  Re: Unable to do Servlet chaining with my own Request class




----------------------------------------------------------------
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!!!
----------------------------------------------------------------
Looks like you need to cast it to the ancestor class
when you pass it. Inside your method, you can get the
functionality you're looking for by casting back down.
But as a rule, beware of extending a general utility
class: this is architectural heresy. You probably want
to do something else.
Also, shame on you for posting here. ;)
--- [EMAIL PROTECTED] wrote:
> Hi,
>
> I am using Apache 1.3.9 mod_ssl 2.4.7 and OpenSSL
> 0.9.4. JRun 2.3.3 is
> running for Servlet engine.
> Sorry for posting it in the wrong place.  But still
> somebody can help me on
>  this issue
>
> I want to modify HttpServletRequest so, I extended
> my own request object
> HttpProxyRequest from HttpServletRequest.
> I modified my HttpProxyRequest object and pass it in
> the
> RequestDispatcher.forward() function.
> The part of source is as follows
>
> SOURCE CODE START:
> RequestDispatcher dispatcher =
>
getServletContext().getRequestDispatcher("/servlet/cocoon");
> if (dispatcher == null) {
>      res.sendError(res.SC_NO_CONTENT);
> }
> HttpProxyRequest preq;
> preq = new HttpProxyRequest(req);
> preq.setRequestURI("/example/hello/hello.xml");
> dispatcher.forward(preq, res);
> SOURCE CODE END:
>
> The code gets compiled. When I try to access the
> servlet which runs the
> above code. I get the following errors in the
> error.log file
>
> ERROR MESSAGE START:
> Mon Jan 10 16:36:18 PST 2000: Running servlet
> { (Running servlet) java.lang.ClassCastException:
> HttpProxyRequest
>      at
>
com.livesoftware.jrun.JRunServletContext$JRunRequestDispatcher.forward(JRun
> ServletContext.java:346)
>      at
> HelloWorldServlet.doGet(HelloWorldServlet.java:71)
>      at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:715)
>      at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
>      at
> com.livesoftware.jrun.JRun.runServlet(JRun.java,
> Compiled Code)
>      at
>
com.livesoftware.jrun.JRunGeneric.handleConnection(JRunGeneric.java:116)
>      at
>
com.livesoftware.jrun.JRunGeneric.handleProxyConnection(JRunGeneric.java:78
> )
>      at
>
com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(J
> RunProxyServiceHandler.java:102)
>      at
>
com.livesoftware.jrun.service.ThreadConfigHandler.run(ThreadConfigHandler.j
> ava, Compiled Code)
>  }
> ERROR MESSAGE END:
>

=====
# Nick Bauman
# Technical Programmer
# http://webhelp.com
# real people, real answers, real time
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]









--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to