You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by deufrai <d3...@yahoo.fr> on 2007/04/19 16:49:28 UTC

[users@httpd] [CONFIG] make httpd serve .java files as text

hi there.

I'm serving a few java utilities with an apache 2.2.3 server.
I provide .jar files along with the sources.

Tried with lots of web browsers, but I cannot simply view the sources as
text inside web browsers. I'm always asked to download the file or pick an
app to open it. 

Server is hosted on a debian etch stable distro and /etc/mime.types shows a
line saying :
text/x-java                                     java

Mime module is also enabled.

What did I miss ?  

Thanx in advance

an example : 
http://wardsback.dyndns.org/WButils/WButils-1.2/src/org/wardsback/utils/
view sources 
-- 
View this message in context: http://www.nabble.com/-CONFIG--make-httpd-serve-.java-files-as-text-tf3607404.html#a10078651
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] [CONFIG] make httpd serve .java files as text

Posted by Dragon <dr...@crimson-dragon.com>.
deufrai wrote:

>hi there.
>
>I'm serving a few java utilities with an apache 2.2.3 server.
>I provide .jar files along with the sources.
>
>Tried with lots of web browsers, but I cannot simply view the sources as
>text inside web browsers. I'm always asked to download the file or pick an
>app to open it.
>
>Server is hosted on a debian etch stable distro and /etc/mime.types shows a
>line saying :
>text/x-java                                     java
>
>Mime module is also enabled.
>
>What did I miss ?
>
>Thanx in advance
---------------- End original message. ---------------------

The browser is using the mime type to determine what to do with the 
file. It sees text/x-java and does not know what to do with that type.

Set the mime type of the source files to text/plain, that will 
display the source files as text.

Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] RE: RE: [CONFIG] make httpd serve .java files as text

Posted by deufrai <d3...@yahoo.fr>.


Boyle Owen wrote:
> 
>> -----Original Message-----
>> From: deufrai [mailto:d3ufr4i@yahoo.fr] 
>> > 
>> > 
>> 
>> All right, many thanx, made a backup of mime.types file and 
>> modified said
>> line as "text/plain     java"
>> Works like a charm in fireFox 2, Opera 9 but .... "surprisingly not
>> surprisingly" fails in IE7. 
>> 
>> No clue about how to get it done in IE7, though
> 
> First off, congratulations for posting the actual real-world URL, rather
> than obfuscating it like so many posters do - it makes checking so much
> easier :-)
> 
> I tried your link
> http://wardsback.dyndns.org/WButils/latest_version/src/org/wardsback/uti
> ls/HashUtils.java and the headers look OK. The page renders as plain
> formatted text in FF2.0 and IE6. 
> 
> Double-check that IE7 really is ignoring the mime-type: clear the cache,
> kill the browser and restart - then reload.
> 
> IE used to be notorious for disregarding things like mime-types (which,
> according to the RFC are supposed to be "authoritative") and using it's
> own internal fuzzy-logic (based on extension and patterns in the
> content) to decide how to handle resources. However, I had the
> impression it was becoming more compliant recently so I'm surprised that
> IE7 "doesn't work". There's isn't really anything you can do about it
> since you alre already doing the "correct" thing (ie, setting the
> mime-type). 
> 
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored. 
>> 
>> Thanx again for your quick reply.
>> -- 
>> View this message in context: 
>> http://www.nabble.com/-CONFIG--make-httpd-serve-.java-files-as
> -text-tf3607404.html#a10080822
>> Sent from the Apache HTTP Server - Users mailing list archive 
>> at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP 
>> Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>  
>  
> This message is for the named person's use only. It may contain
> confidential, proprietary or legally privileged information. No
> confidentiality or privilege is waived or lost by any mistransmission. If
> you receive this message in error, please notify the sender urgently and
> then immediately delete the message and any copies of it from your system.
> Please also immediately destroy any hardcopies of the message. You must
> not, directly or indirectly, use, disclose, distribute, print, or copy any
> part of this message if you are not the intended recipient. The sender's
> company reserves the right to monitor all e-mail communications through
> their networks. Any views expressed in this message are those of the
> individual sender, except where the message states otherwise and the
> sender is authorised to state them to be the views of the sender's
> company.
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

Cleared cache and restarted IE7, still no go. Too bad then.
Sorry for broken link, I revamped site layout.

a working one for convenience :  http://wardsback.dyndns.org/WButils/ here 

Thanx again :)

-- 
deufrai
-- 
View this message in context: http://www.nabble.com/-CONFIG--make-httpd-serve-.java-files-as-text-tf3607404.html#a10092421
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] RE: [CONFIG] make httpd serve .java files as text

Posted by deufrai <d3...@yahoo.fr>.

Boyle Owen wrote:
> 
>> -----Original Message-----
>> From: deufrai [mailto:d3ufr4i@yahoo.fr] 
>> Sent: Thursday, April 19, 2007 4:49 PM
>> To: users@httpd.apache.org
>> Subject: [users@httpd] [CONFIG] make httpd serve .java files as text
>> 
>> 
>> hi there.
>> 
>> I'm serving a few java utilities with an apache 2.2.3 server.
>> I provide .jar files along with the sources.
>> 
>> Tried with lots of web browsers, but I cannot simply view the 
>> sources as
>> text inside web browsers. I'm always asked to download the 
>> file or pick an
>> app to open it. 
>> 
>> Server is hosted on a debian etch stable distro and 
>> /etc/mime.types shows a
>> line saying :
>> text/x-java                                     java
> 
> You're on the right track - you need to set the mime-type appropriately.
> Try text/plain for a start...
> 
> However, be aware that certain browsers will ignore the mime-type and
> under some circumstances the webserver may not use the value found in
> mime.types. To see what's really going on, try with FireFox and the
> LiveHTTPHeaders extension.
> 
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored.  
> 
>> 
>> Mime module is also enabled.
>> 
>> What did I miss ?  
>> 
>> Thanx in advance
>> 
>> an example : 
>> http://wardsback.dyndns.org/WButils/WButils-1.2/src/org/wardsb
>> ack/utils/
>> view sources 
>> -- 
>> View this message in context: 
>> http://www.nabble.com/-CONFIG--make-httpd-serve-.java-files-as
> -text-tf3607404.html#a10078651
>> Sent from the Apache HTTP Server - Users mailing list archive 
>> at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP 
>> Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>  
>  
> This message is for the named person's use only. It may contain
> confidential, proprietary or legally privileged information. No
> confidentiality or privilege is waived or lost by any mistransmission. If
> you receive this message in error, please notify the sender urgently and
> then immediately delete the message and any copies of it from your system.
> Please also immediately destroy any hardcopies of the message. You must
> not, directly or indirectly, use, disclose, distribute, print, or copy any
> part of this message if you are not the intended recipient. The sender's
> company reserves the right to monitor all e-mail communications through
> their networks. Any views expressed in this message are those of the
> individual sender, except where the message states otherwise and the
> sender is authorised to state them to be the views of the sender's
> company.
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

All right, many thanx, made a backup of mime.types file and modified said
line as "text/plain     java"
Works like a charm in fireFox 2, Opera 9 but .... "surprisingly not
surprisingly" fails in IE7. 

No clue about how to get it done in IE7, though

Thanx again for your quick reply.
-- 
View this message in context: http://www.nabble.com/-CONFIG--make-httpd-serve-.java-files-as-text-tf3607404.html#a10080822
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org