|
 |
pro_java_server thread: Problem in Communication between servlets
Message #1 by Deepak Kapur <kapur_deepak@y...> on Wed, 4 Apr 2001 00:01:04 -0700 (PDT)
|
|
yes u r correct in both the things
1) Depricated Warning did not affect anything.
2) it is encodeRedirectURL(String s) (newer version)
I found out the error Later in the Evening. My code had the
bug and was cosing this encodeRedirectURL() to be called
twice for diffrent pages. Second one being the source page
itself. since responce object was alread sent, hence it
said "IllegalStateException
> in: R(
> > + /servlet/testchain1 + null) Response has already
> been committed"
because encodeRedirectUrl(s) just sends the request &
continues to work on the code following it.
I removed this error & even encodeRedirectUrl worked fine.
Thanks for u'r Help.
Regards
Deepak
--- Ljubisa Kovacevic <LubisaK@H...> wrote:
> I'm not sure if jsdk.jar means servlet.jar, but if that's
> the case, I don't
> think it's good idea to "update" new Tomcat with older
> version of Servlet
> API than origin one for that version.
> Don't forget that newer java versions will support
> older ones unless
> Platform has been changed, but older versions of Servlet
> API don't fit into
> Application built to use newer ones.
>
> I don't know what's causing that error but it's easy to
> fix it, just return
> the newer version of the servlet API and don't worry
> about Deprication
> warning, it doesn't affect the functionality of the
> program. If you want to
> get rid of that warning the answer is to check servlet
> API docs and find
> newer version of the deprecated method (at list Java API
> has excellant
> Docs).
> (in your case I think "response.encodeRedirectUrl"
> should be "response.encodeRedirectURL", but not have time
> to check it and I
> don't know exactly what packages you're using)
>
> best regards
>
> lubisak
>
> ----- Original Message -----
> From: Deepak Kapur <kapur_deepak@y...>
> To: Java Server <pro_java_server@p...>
> Sent: Wednesday, April 04, 2001 12:01 AM
> Subject: Problem in Communication between servlets
>
>
> > Hi
> > i have one class testchain1
> >
> > which has follwing code:
> > (i had been using this code earlier and it worked
> fine:)
> >
> > String s
> >
>
response.encodeRedirectUrl("http://127.0.0.1:8080/servlet/testchain2");
> > response.sendRedirect(s);
> >
> > on Tomcat, Jdk1.2.2, jsdk2
> >
> > Now i have copied my classes to new machine, with newer
> > Tomcat & newer jsdk. When i compile it gives warning
> about
> > some method being Depricated. (as Chanoch Wiggers had
> > pointed out earlier).
> >
> > Hence i brough jsdk.jar from old machine and put it in
> > Classpath.
> >
> > Now when i start my tomcat & request for pages..
> >
> > in 1 run this response.sendRedirect does not work. If i
> > stop it and start it again it works but tocat give
> > following error.
> >
> > 2001-04-04 12:10:47 - Ctx( ): Servlet API error:
> sendError
> > with commited buffer
> > 2001-04-04 12:10:47 - Ctx( ): IllegalStateException
> in: R(
> > + /servlet/testchain1 + null) Response has already
> been
> > committed
> >
> >
> > Can anyone help me with this.
> >
> > Thanks in Advance
> > Deepak.
|
|
 |