Re: Bizarre sporadic problem with streaming a stylesheet.

2010-09-21 Thread Dave Belfer-Shevett

On Tue, 21 Sep 2010, Rahul Mohan wrote:

Did you take a look at this request through Firebug? It might show some
useful info.


I haven't, but I'm not sure where this would pin it down.  For example, if 
I use curl to pull the stylesheet rapid fire:


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

it works every single time.  The funny bit is that I don't think it's the 
server.


The webpage is just the JSP plus the link rel line.

Oddly, the problem happens in Firefox and in Struts.  :-/


Also, is the content type proper (text/css) in the request
header? I can't see you setting it anywhere.


I didn't have it ther,e but adding it like this:
resp.setContentType(text/css);

didn't make any difference.

-d

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Tomcat 5.0.27 Issue

2010-09-21 Thread Roland T. Craddolph
The requested resource
/amagatto-solutions-1.0-SNAPSHOT/example/HelloWorld.action is not available.

My pom file includes the following dependencies:
junit - 3.8.1
spring-mock - 2.0.5
spring-core - 2.0.5
servlet-api - 2.4
jsp-api - 2.0
struts2-core - 2.0.11.2

Roland  T. Craddolph
Amagatto Solutions LLC
Principal Member and Lead Architect
Email: rcraddo...@amagatto.com
Website: http://www.amagatto.com

-Original Message-
From: Dave Newton [mailto:davelnew...@gmail.com] 
Sent: Tuesday, September 21, 2010 12:46 AM
To: Struts Users Mailing List
Subject: Re: Tomcat 5.0.27 Issue

What kind of error?

Dave

On Sep 20, 2010 6:25 PM, Roland T. Craddolph rcraddo...@amagatto.com
wrote:
 I'm just wondering if anyone as any problems with building a Struts2
 archetype using Maven2, creating a war file, and deploy it to a tomcat
 server running the version of 5.0.27 did it cause you any errors? I
created
 a blank struts2 example project using the maven archetype command, and was
 wondering if there is something I need to look for when running the war
file
 with Tomcat 5.0.27 versus Tomcat 6.0.26.



 Thanks,

 Roland



 Roland T. Craddolph

 Amagatto Solutions LLC

 Principal Member and Lead Architect

 Email: rcraddo...@amagatto.com

 Website: http://www.amagatto.com




No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.851 / Virus Database: 271.1.1/3148 - Release Date: 09/20/10
12:04:00


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Bizarre sporadic problem with streaming a stylesheet.

2010-09-21 Thread Dale Newfield

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 .css...you 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 
effect.


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

http://struts.apache.org/2.2.1/docs/stream-result.html

-Dale

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Bizarre sporadic problem with streaming a stylesheet.

2010-09-21 Thread Martin Gainty

to ask the unasked question..If Streaming is associated with media types such 
as audio or video
How does one stream a stylesheet?

Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.



 

 Date: Tue, 21 Sep 2010 11:29:02 -0400
 From: d...@newfield.org
 To: user@struts.apache.org
 CC: d...@homeport.org
 Subject: Re: Bizarre sporadic problem with streaming a stylesheet.
 
 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 .css...you 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 
 effect.
 
 If you want to return a stream, there is a stream result type that'll 
 help you out:
 http://struts.apache.org/2.2.1/docs/stream-result.html
 
 -Dale
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
  

Re: Tomcat 5.0.27 Issue

2010-09-21 Thread Dave Newton
Your webapp context is amagatto-solution-1.0-SNAPSHOT?!

And you have a package named example?

It's going to be impossible to help without some configuration/deployment
information.

Dave

On Tue, Sep 21, 2010 at 11:13 AM, Roland T. Craddolph 
rcraddo...@amagatto.com wrote:

 The requested resource
 /amagatto-solutions-1.0-SNAPSHOT/example/HelloWorld.action is not
 available.

 My pom file includes the following dependencies:
 junit - 3.8.1
 spring-mock - 2.0.5
 spring-core - 2.0.5
 servlet-api - 2.4
 jsp-api - 2.0
 struts2-core - 2.0.11.2

 Roland  T. Craddolph
 Amagatto Solutions LLC
 Principal Member and Lead Architect
 Email: rcraddo...@amagatto.com
 Website: http://www.amagatto.com

 -Original Message-
 From: Dave Newton [mailto:davelnew...@gmail.com]
 Sent: Tuesday, September 21, 2010 12:46 AM
 To: Struts Users Mailing List
 Subject: Re: Tomcat 5.0.27 Issue

 What kind of error?

 Dave

 On Sep 20, 2010 6:25 PM, Roland T. Craddolph rcraddo...@amagatto.com
 wrote:
  I'm just wondering if anyone as any problems with building a Struts2
  archetype using Maven2, creating a war file, and deploy it to a tomcat
  server running the version of 5.0.27 did it cause you any errors? I
 created
  a blank struts2 example project using the maven archetype command, and
 was
  wondering if there is something I need to look for when running the war
 file
  with Tomcat 5.0.27 versus Tomcat 6.0.26.
 
 
 
  Thanks,
 
  Roland
 
 
 
  Roland T. Craddolph
 
  Amagatto Solutions LLC
 
  Principal Member and Lead Architect
 
  Email: rcraddo...@amagatto.com
 
  Website: http://www.amagatto.com
 
 
 

 No virus found in this incoming message.
 Checked by AVG - www.avg.com
 Version: 9.0.851 / Virus Database: 271.1.1/3148 - Release Date: 09/20/10
 12:04:00


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Bizarre sporadic problem with streaming a stylesheet.

2010-09-21 Thread Dave Newton
On Tue, Sep 21, 2010 at 12:02 PM, Martin Gainty wrote:

 to ask the unasked question..If Streaming is associated with media types
 such as audio or video
 How does one stream a stylesheet?


By sending the bytes to the client.

Dave


Re: Bizarre sporadic problem with streaming a stylesheet.

2010-09-21 Thread Dale Newfield

On 9/21/10 12:02 PM, Martin Gainty wrote:

to ask the unasked question..If Streaming is associated with media types such 
as audio or video
How does one stream a stylesheet?


I was assuming he just meant that he wanted to feed the output out from 
a stream, although you're right -- unless the content is really large 
that does seem like extraneous overhead.  Probably that means he's got a 
bunch of data in a database that he just wants to dump...but there's no 
real reason that can't be done as a jsp (the tags would allow all the 
looping, conditionals, etc. he's probably looking for), and if there's 
just a block of content to be included directly from the DB, that can be 
output there, too...


-Dale

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Tomcat 5.0.27 Issue

2010-09-21 Thread Roland T. Craddolph
Webapp context -
Package - amagatto.solutions.example

This was built using the following command and placed out on a Tomcat
webserver with the version of 5.0.27.  For my testing instead of using
Tomcat 5 it's using 6 and it had no problems at all.  Other than downgrading
my Tomcat webserver I used the following command to create the struts
project to work from:

mvn archetype:create -DgroupId=amagatto.solutions
-DartifactId=amagatto-solutions -DarchetypeGroupId=org.apache.struts
-DarchetypeArtifactId=struts2-archetype-blank
-DarchetypeVersion=2.0.11.2-SNAPSHOT
-DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository


Roland  T. Craddolph
Amagatto Solutions LLC
Principal Member and Lead Architect
Email: rcraddo...@amagatto.com
Website: http://www.amagatto.com


-Original Message-
From: Dave Newton [mailto:davelnew...@gmail.com] 
Sent: Tuesday, September 21, 2010 11:04 AM
To: Struts Users Mailing List
Subject: Re: Tomcat 5.0.27 Issue

Your webapp context is amagatto-solution-1.0-SNAPSHOT?!

And you have a package named example?

It's going to be impossible to help without some configuration/deployment
information.

Dave

On Tue, Sep 21, 2010 at 11:13 AM, Roland T. Craddolph 
rcraddo...@amagatto.com wrote:

 The requested resource
 /amagatto-solutions-1.0-SNAPSHOT/example/HelloWorld.action is not
 available.

 My pom file includes the following dependencies:
 junit - 3.8.1
 spring-mock - 2.0.5
 spring-core - 2.0.5
 servlet-api - 2.4
 jsp-api - 2.0
 struts2-core - 2.0.11.2

 Roland  T. Craddolph
 Amagatto Solutions LLC
 Principal Member and Lead Architect
 Email: rcraddo...@amagatto.com
 Website: http://www.amagatto.com

 -Original Message-
 From: Dave Newton [mailto:davelnew...@gmail.com]
 Sent: Tuesday, September 21, 2010 12:46 AM
 To: Struts Users Mailing List
 Subject: Re: Tomcat 5.0.27 Issue

 What kind of error?

 Dave

 On Sep 20, 2010 6:25 PM, Roland T. Craddolph rcraddo...@amagatto.com
 wrote:
  I'm just wondering if anyone as any problems with building a Struts2
  archetype using Maven2, creating a war file, and deploy it to a tomcat
  server running the version of 5.0.27 did it cause you any errors? I
 created
  a blank struts2 example project using the maven archetype command, and
 was
  wondering if there is something I need to look for when running the war
 file
  with Tomcat 5.0.27 versus Tomcat 6.0.26.
 
 
 
  Thanks,
 
  Roland
 
 
 
  Roland T. Craddolph
 
  Amagatto Solutions LLC
 
  Principal Member and Lead Architect
 
  Email: rcraddo...@amagatto.com
 
  Website: http://www.amagatto.com
 
 
 

 No virus found in this incoming message.
 Checked by AVG - www.avg.com
 Version: 9.0.851 / Virus Database: 271.1.1/3148 - Release Date: 09/20/10
 12:04:00


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.851 / Virus Database: 271.1.1/3148 - Release Date: 09/20/10
12:04:00


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Bizarre sporadic problem with streaming a stylesheet.

2010-09-21 Thread Dave Belfer-Shevett

On Tue, 21 Sep 2010, Dale Newfield wrote:

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 .css...you could either add css as an 
action extension or maybe use urlrewrite to make a .css url actually result 
in your .action request.


Tried it both ways -one as an action class, one as a css.  The headers 
didnt' vary enormously (or relevantly).



public void getConfiguredStylesheet() throws IOException, Exception {


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


-should-, but all this class is doing is writing to the 
HttpServletResponse object.



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.


That's not the case actually - the http headers are there (curl -i shows 
them).



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 
effect.


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

http://struts.apache.org/2.2.1/docs/stream-result.html


It's not -really- a stream.  I perhaps used the wrong name there.  See 
other comments in this thread (or comments taht'll be there in a few 
minutes :)


-d

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Bizarre sporadic problem with streaming a stylesheet.

2010-09-21 Thread Dave Belfer-Shevett

On Tue, 21 Sep 2010, Martin Gainty wrote:

to ask the unasked question..If Streaming is associated with media types such 
as audio or video
How does one stream a stylesheet?


As someone else commented, I'm not actually 'streaming'.  What I'm using 
is a database to source the stylesheet (in the final version, hte 
stylesheet will be assembled).  The short version is the stylesheet is not 
static - it's being generated programmatically, and being fed back into 
the HttpServletResponse directly.


-d

--
---..---.
Dave Belfer-Shevett \ KB1FWR \ JID: d...@jabber.stonekeep.com \
blog:planet-geek.com '---.
d...@homeport.org/   Life is full of misery, loneliness, and   \
--- suffering - and it's all over much too |
   |  soon. (Woody Allen)  |
\__/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Bizarre sporadic problem with streaming a stylesheet. [Solved?]

2010-09-21 Thread Dave Belfer-Shevett

So this got weird.

I tried everything.  Rewrote the method, changed the responses, put 
debugging all over - nada.  I could reproduce the problem by rapid-firing 
^R at the browser, and the home would render with the stylesheet about 
half the time.  It was interesting seeing it flip back and forth.


My JSP's had two stylesheet lines in them, like this:

LINK REL=StyleSheet href=getStylesheet.action type=text/css
LINK REL=StyleSheet href=getConfiguredStylesheet.action 
type=text/css


The first one would have loaded the 'default' style, with the configured 
oversion overriding / updating the sheet as necessary.


I removed the first one.

And it all started working perfectly.

I don't know if it's a bug in the first action class (which HAD been 
working perfectly on it's own until I added the second line), or what - 
but I'm running now.


How. Weird.

-d

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Bizarre sporadic problem with streaming a stylesheet.

2010-09-21 Thread Dale Newfield

On 9/21/10 1:00 PM, Dave Belfer-Shevett wrote:

You're returning no header information.


That's not the case actually - the http headers are there (curl -i shows
them).


Is your request going directly to the app server on which this is 
running, or is some apache httpd/proxy/etc. in between that might be 
adding in extra info?  If not I wonder where those are being added, or 
what's actually happening between so that when you say 
write(sb.toString()) other info is getting written first?


Completely different theory:  In how many different browsers/machines 
are you seeing this behavior?  Is it possible that an empty answer 
(perhaps generated when a server was not coming up/going down/not 
running/etc.) has been cached by said browser and is sometimes using 
that instead?  Malformed link tags (I use xhtml, so I don't recall in 
regular html if there should be a slash before the close gt symbol)?


Anyway, glad you've solved your issue.  Too bad we didn't all learn 
something from it :-)


-Dale

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Bizarre sporadic problem with streaming a stylesheet.

2010-09-21 Thread Martin Gainty

a few years ago we use DWR to dynamically create html tags which were fed into 
the response
to modify colors and fonts mostly..

Martin 
__ 
While hiding in a cave from the government Miles and Luna happen upon a 200 
years old Volkswagen. To get enough strength to push the slug bug Miles and 
Luna eat a meal of giant celery and bananas the size of surfboards..excerpt 
from 'Sleeper'


 

 Date: Tue, 21 Sep 2010 13:01:57 -0400
 From: d...@homeport.org
 To: user@struts.apache.org
 Subject: RE: Bizarre sporadic problem with streaming a stylesheet.
 
 On Tue, 21 Sep 2010, Martin Gainty wrote:
  to ask the unasked question..If Streaming is associated with media types 
  such as audio or video
  How does one stream a stylesheet?
 
 As someone else commented, I'm not actually 'streaming'. What I'm using 
 is a database to source the stylesheet (in the final version, hte 
 stylesheet will be assembled). The short version is the stylesheet is not 
 static - it's being generated programmatically, and being fed back into 
 the HttpServletResponse directly.
 
 -d
 
 -- 
 ---..---.
 Dave Belfer-Shevett \ KB1FWR \ JID: d...@jabber.stonekeep.com \
 blog:planet-geek.com '---.
 d...@homeport.org / Life is full of misery, loneliness, and \
 --- suffering - and it's all over much too |
 | soon. (Woody Allen) |
 \__/
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org