RE: does anyone know this error??

2005-03-17 Thread Ramu, Vinod
I not sure whether you write a servlet code using STRUTS, at least I
have not see one because STRUTS frame work provides one. Once the
request is processed by STRUTS, it uses struts-config.xml file to
forward the response to next JSP page.  XML element in
struts-config.xml file is used to forward to the next view.

I would suggest you to built an action class. Transfer the code from the
below get method to the new Action class. Configure you action class in
struts-config.xml file to forward the requests to the Action class. 

Hope this helps you,
Vinod
-Original Message-
From: Bedrijven.nl [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 17, 2005 9:06 AM
To: 'Tomcat Users List'
Subject: RE: does anyone know this error??


The only thing where I can find a direct writing/accesing the response
is

public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
try {
if(request.getParameter("photoid")!=null){
String photoid = request.getParameter("photoid");
Photo myPhoto = (Photo) Photo.retrieve(photoid);
if(myPhoto!=null && myPhoto.getPhoto()!=null){

if(myPhoto.getPhototype()!=null){

response.setContentType(myPhoto.getPhototype());
OutputStream out
=
response.getOutputStream();

out.write(myPhoto.getPhoto());
}
}
}
}
catch (Exception e) {
 
Logger.getLogger("nl.onvelvet.customer.PhotoServlet").error(LogUtil.getS
tack
Trace(e));
}
}

The rest is "handled" by Struts.

-Oorspronkelijk bericht-
Van: Ramu, Vinod [mailto:[EMAIL PROTECTED]
Verzonden: Thursday, March 17, 2005 2:54 PM
Aan: Tomcat Users List; [EMAIL PROTECTED]
Onderwerp: RE: does anyone know this error??


This error is because you have a code that's trying to write response
after it's committed. If you can share the code that's causing this
error then may be we can be of some help.

Vinod

-Original Message-
From: Bedrijven.nl [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 17, 2005 8:45 AM
To: tomcat-user@jakarta.apache.org
Subject: does anyone know this error??


I saw an error in my log ive never seen before:

java.lang.IllegalStateException: Current state = FLUSHED, new state =
CODING_END
at
java.nio.charset.CharsetEncoder.throwIllegalStateException(CharsetEncode
r.ja
va:933)
at
java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:529)
at
sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar(StreamEncoder.java:
356)
at
sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:412)
at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:158)
at java.io.OutputStreamWriter.close(OutputStreamWriter.java:222)
at java.io.PrintWriter.close(PrintWriter.java:137)
at
org.apache.catalina.connector.ResponseBase.finishResponse(ResponseBase.j
ava:
483)
at
org.apache.catalina.connector.HttpResponseBase.finishResponse(HttpRespon
seBa
se.java:253)
at
org.apache.catalina.connector.http.HttpResponseImpl.finishResponse(HttpR
espo
nseImpl.java:288)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
ava:
1067)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
1151
)
at java.lang.Thread.run(Thread.java:536)

What could be the problem?

Maarten Janssen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: does anyone know this error??

2005-03-17 Thread Bedrijven.nl
The only thing where I can find a direct writing/accesing the response is

public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
try {
if(request.getParameter("photoid")!=null){
String photoid = request.getParameter("photoid");
Photo myPhoto = (Photo) Photo.retrieve(photoid);
if(myPhoto!=null && myPhoto.getPhoto()!=null){
if(myPhoto.getPhototype()!=null){

response.setContentType(myPhoto.getPhototype());
OutputStream out =
response.getOutputStream();

out.write(myPhoto.getPhoto());
}
}
}
}
catch (Exception e) {
 
Logger.getLogger("nl.onvelvet.customer.PhotoServlet").error(LogUtil.getStack
Trace(e));
}
}

The rest is "handled" by Struts.

-Oorspronkelijk bericht-
Van: Ramu, Vinod [mailto:[EMAIL PROTECTED]
Verzonden: Thursday, March 17, 2005 2:54 PM
Aan: Tomcat Users List; [EMAIL PROTECTED]
Onderwerp: RE: does anyone know this error??


This error is because you have a code that's trying to write response
after it's committed. If you can share the code that's causing this
error then may be we can be of some help.

Vinod

-Original Message-
From: Bedrijven.nl [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 17, 2005 8:45 AM
To: tomcat-user@jakarta.apache.org
Subject: does anyone know this error??


I saw an error in my log ive never seen before:

java.lang.IllegalStateException: Current state = FLUSHED, new state =
CODING_END
at
java.nio.charset.CharsetEncoder.throwIllegalStateException(CharsetEncode
r.ja
va:933)
at
java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:529)
at
sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar(StreamEncoder.java:
356)
at
sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:412)
at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:158)
at java.io.OutputStreamWriter.close(OutputStreamWriter.java:222)
at java.io.PrintWriter.close(PrintWriter.java:137)
at
org.apache.catalina.connector.ResponseBase.finishResponse(ResponseBase.j
ava:
483)
at
org.apache.catalina.connector.HttpResponseBase.finishResponse(HttpRespon
seBa
se.java:253)
at
org.apache.catalina.connector.http.HttpResponseImpl.finishResponse(HttpR
espo
nseImpl.java:288)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
ava:
1067)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
1151
)
at java.lang.Thread.run(Thread.java:536)

What could be the problem?

Maarten Janssen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: does anyone know this error??

2005-03-17 Thread Ramu, Vinod
This error is because you have a code that's trying to write response
after it's committed. If you can share the code that's causing this
error then may be we can be of some help.

Vinod

-Original Message-
From: Bedrijven.nl [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 17, 2005 8:45 AM
To: tomcat-user@jakarta.apache.org
Subject: does anyone know this error??


I saw an error in my log ive never seen before:

java.lang.IllegalStateException: Current state = FLUSHED, new state =
CODING_END
at
java.nio.charset.CharsetEncoder.throwIllegalStateException(CharsetEncode
r.ja
va:933)
at
java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:529)
at
sun.nio.cs.StreamEncoder$CharsetSE.flushLeftoverChar(StreamEncoder.java:
356)
at
sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:412)
at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:158)
at java.io.OutputStreamWriter.close(OutputStreamWriter.java:222)
at java.io.PrintWriter.close(PrintWriter.java:137)
at
org.apache.catalina.connector.ResponseBase.finishResponse(ResponseBase.j
ava:
483)
at
org.apache.catalina.connector.HttpResponseBase.finishResponse(HttpRespon
seBa
se.java:253)
at
org.apache.catalina.connector.http.HttpResponseImpl.finishResponse(HttpR
espo
nseImpl.java:288)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
ava:
1067)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
1151
)
at java.lang.Thread.run(Thread.java:536)

What could be the problem?

Maarten Janssen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]