<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jan 3, 2008, at 3:24 PM, Emily Heureux wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div lang="EN-US" link="blue" vlink="purple"><div class="Section1"><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">(I am starting a brand new email, not replying to an existing one, which I now realize I have been doing, but maybe not every time.&nbsp; Am I sending these to the wrong place?&nbsp; The address I have is<span class="Apple-converted-space">&nbsp;</span><a href="mailto:catalyst@lists.scsys.co.uk" style="color: blue; text-decoration: underline; ">catalyst@lists.scsys.co.uk</a>.&nbsp; Did I do it right this time?)<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p>&nbsp;</o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">My question:&nbsp; I have a directory under root:&nbsp; /static/images/pdbFiles where I have files without extensions for a java applet I am running on my webpage.&nbsp; Catalyst does not seem to recognize them unless I put an extension, like .txt.&nbsp; Do I need to configure Catalyst so that it sees those files as static files?<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p>&nbsp;</o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">On cpan, I found that I can force directories into static mode using this (for example):<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p>&nbsp;</o:p></span></font></div><pre style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Courier New"><span style="font-size: 10pt; ">MyApp-&gt;config-&gt;{static}-&gt;{dirs} = [<o:p></o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Courier New"><span style="font-size: 10pt; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;'static',<o:p></o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Courier New"><span style="font-size: 10pt; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qr/^(images/pdbFiles|)/,<o:p></o:p></span></font></pre><pre style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 10pt; font-family: 'Courier New'; "><font size="2" face="Courier New"><span style="font-size: 10pt; ">&nbsp;&nbsp;&nbsp; ];<o:p></o:p></span></font></pre><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p>&nbsp;</o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; ">but, where do I put this code, if that is, in fact, what I am supposed to do?&nbsp; And since I want it to work for files with no extensions, what do I put after the pipe?<o:p></o:p></span></font></div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; font-size: 12pt; font-family: 'Times New Roman'; "><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; "><o:p></o:p></span></font></div></div></div></span></blockquote><div><br class="webkit-block-placeholder"></div>If you already have your files in /static, then it will do what you want by default. &nbsp;The problem is that without an extension, Static::Simple can't determine the correct MIME type, so it uses text/html. &nbsp;One approach to handling this is to subclass Catalyst::Plugin::Static::Simple and override _ext_to_type so it returns the correct MIME type for those files...</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>package MyApp::Plugin::Static::Simple;</div><div>use strict;</div><div>use warnings;</div><div>use base qw( Catalyst::Plugin::Static::Simple );</div><div><br></div><div>sub _ext_to_type {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>my ( $self, $path ) = @_;<br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if ( $path =~ /pdbFiles/ ) {<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return 'application/x-java-applet';<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>} else {<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return $self-&gt;SUPER::_ext_to_type( $path );<br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}<br class="webkit-block-placeholder"></div><div>}</div><div><br class="webkit-block-placeholder"></div><div>1;</div><div><br class="webkit-block-placeholder"></div><div>Then in your application class...</div><div><br class="webkit-block-placeholder"></div><div>use Catalyst qw(</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>+MyApp::Plugin::Static::Simple</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Session Cache Whatever...<br class="webkit-block-placeholder"></div><div>);</div><div><br class="webkit-block-placeholder"></div><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--&nbsp;</div><div>Jason Kohles, RHCA RHCDS RHCE</div><div>email@jasonkohles.com -&nbsp;<a href="http://www.jasonkohles.com/">http://www.jasonkohles.com/</a></div><div>"A witty saying proves nothing."&nbsp; -- Voltaire</div></span></span></div><br class="Apple-interchange-newline"></span> </div><br></body></html>