struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Newfield <>
Subject Re: Bizarre sporadic problem with streaming a stylesheet.
Date Tue, 21 Sep 2010 15:29:02 GMT
On 9/21/10 12:36 AM, Dave Belfer-Shevett wrote:
> <LINK REL="StyleSheet" href="getConfiguredStylesheet.action"
> type="text/css">

It shouldn't matter, but the browser might be deciding something wonky 
based on the fact that that url doesn't end could either add 
css as an action extension or maybe use urlrewrite to make a .css url 
actually result in your .action request.

> public void getConfiguredStylesheet() throws IOException, Exception {

Shouldn't all action methods return String?  What's the action mapping 
associated with this?

> resp.getWriter().write(sb.toString());
> resp.getWriter().flush();
> resp.getWriter().close();

The appropriate return value for actions that generate their own output 
is null.  This is rarely the best solution, though, as there's more to 
the http protocol than the content of the response.  You're returning no 
header information.

> curl http://localhost:8080/congo/public/getConfiguredStylesheet.action

try curl -i to see the header info.  Compare that output to a curl -i 
request for a .css file delivered by your web app through more 
conventional methods.

> resp.setContentType("text/css");

I believe that since you're generating the response yourself this has no 

If you want to return a stream, there is a stream result type that'll 
help you out:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message