[ 
https://issues.apache.org/jira/browse/WICKET-1999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660060#action_12660060
 ] 

Juergen Donnerstag commented on WICKET-1999:
--------------------------------------------

You need to provide more context information. Please create a quickstart 
project or a test case. Thanks. 
Similar code can be found multiple times within wicket core and it is working. 

> Modifying the response content type does not take effect
> --------------------------------------------------------
>
>                 Key: WICKET-1999
>                 URL: https://issues.apache.org/jira/browse/WICKET-1999
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.5
>         Environment: Win XP, Tomcat 6
>            Reporter: Arie Fishler
>
> Trying to stream an image to the response and setting the proper mime type to 
> it prior to writing the stream to the output.
>  
> The file exists and is written but the mime type of the response is not set 
> according to what I expect it to be ("image/png"). Mime type stays text/html
>  
> WebResponse response = (WebResponse)getRequestCycle().getResponse();
> if (imagePath != null) { 
> try { 
> File imageFile = 
> new File(imagePath); 
> FileInputStream inputStream = 
> new FileInputStream(imageFile); 
> response.setContentType(
> DEFAULT_MIME_TYPE); 
> Streams.copy(inputStream, response.getOutputStream());
> return; 
> } 
> catch (FileNotFoundException e) { 
> }
> catch (IOException e) { 
> }
> }
> // 404 
> response.getHttpServletResponse().setStatus(
> NOT_FOUND);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to