You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Brian Burke <bb...@lssi.net> on 2002/01/30 19:11:30 UTC
mime type problem when doing redirects
I'm having a mime type problem and I wanted to see if
someone on the list could help. I think it relates to when
the http headers are being written.
Here is my setup: I have 2 embperl areas, embperl and
embperl2. I serve html documents from embperl and xml
documents from embperl2 (I want the Content-Type to
be text/xml if a doc. is requested in embperl2). I know
this sounds complicated, but there are other reasons why
I need 2 embperl areas.
When a request is issued for /embperl/something.html
I want to internally redirect to /embperl2/somethingelse.xml,
and have the Content-Type be text/xml.
something.html basically contains the following:
[- $req_rec->internal_redirect("/embperl2/somethingelse.xml"); -]
The redirect is working fine, however I am not getting the right
Content-Type in the http header. I've tried using the following in
something.html and somethingelse.xml with no success (I still get
text/html):
[- $req_rec -> header_out("Content-Type" => "text/xml"); -]
If I browse directly to /embperl2/somethingelse.xml, it works fine,
only the redirect is causing problems.
I have the following in my httpd.conf:
<Location /embperl/>
SetEnv EMBPERL_DEBUG 0
SetEnv EMBPERL_OPTIONS 9445136
SetHandler perl-script
PerlHandler HTML::Embperl
#PerlSendHeader On
Options ExecCGI
</Location>
<Location /embperl2/>
SetEnv EMBPERL_DEBUG 0
SetEnv EMBPERL_OPTIONS 9445136
SetHandler perl-script
PerlHandler HTML::Embperl
#PerlSendHeader On
Options ExecCGI
</Location>
Any ideas?
Brian Burke
--
______________________________________
Brian Burke
LSSi Corp.
email: bburke@lssi.net
url: http://www.lssi.net/~bburke
phone: (919) 466-6838
______________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: mime type problem when doing redirects
Posted by Gerald Richter <ri...@ecos.de>.
Hi,
adding the following to your httpd.conf
AddType text/xml .xml
should solve your Problem
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
----- Original Message -----
From: "Brian Burke" <bb...@lssi.net>
To: "embperl" <em...@perl.apache.org>
Sent: Wednesday, January 30, 2002 7:11 PM
Subject: mime type problem when doing redirects
> I'm having a mime type problem and I wanted to see if
> someone on the list could help. I think it relates to when
> the http headers are being written.
>
> Here is my setup: I have 2 embperl areas, embperl and
> embperl2. I serve html documents from embperl and xml
> documents from embperl2 (I want the Content-Type to
> be text/xml if a doc. is requested in embperl2). I know
> this sounds complicated, but there are other reasons why
> I need 2 embperl areas.
>
> When a request is issued for /embperl/something.html
> I want to internally redirect to /embperl2/somethingelse.xml,
> and have the Content-Type be text/xml.
>
> something.html basically contains the following:
> [- $req_rec->internal_redirect("/embperl2/somethingelse.xml"); -]
>
> The redirect is working fine, however I am not getting the right
> Content-Type in the http header. I've tried using the following in
> something.html and somethingelse.xml with no success (I still get
> text/html):
> [- $req_rec -> header_out("Content-Type" => "text/xml"); -]
>
> If I browse directly to /embperl2/somethingelse.xml, it works fine,
> only the redirect is causing problems.
>
> I have the following in my httpd.conf:
>
> <Location /embperl/>
> SetEnv EMBPERL_DEBUG 0
> SetEnv EMBPERL_OPTIONS 9445136
> SetHandler perl-script
> PerlHandler HTML::Embperl
> #PerlSendHeader On
> Options ExecCGI
> </Location>
>
> <Location /embperl2/>
> SetEnv EMBPERL_DEBUG 0
> SetEnv EMBPERL_OPTIONS 9445136
> SetHandler perl-script
> PerlHandler HTML::Embperl
> #PerlSendHeader On
> Options ExecCGI
> </Location>
>
> Any ideas?
>
> Brian Burke
> --
> ______________________________________
> Brian Burke
> LSSi Corp.
> email: bburke@lssi.net
> url: http://www.lssi.net/~bburke
> phone: (919) 466-6838
> ______________________________________
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Embperl and xemacs
Posted by Frank Sweetser <fs...@WPI.EDU>.
On Wed, Feb 06, 2002 at 01:22:02PM -0600, erik wrote:
> I /am/ using GNU Emacs 21 (not officially supported ;-). I'm also
> pretty much a novice at customizing Emacs. Plus, I use a dark
> background with light fonts - so the default grey background imposed
> by mmm-mode was completely unreadable.
Yeah, I found the same problem.
(setq mmm-submode-decoration-level 0)
fixed it for me.
--
Frank Sweetser fs at wpi.edu, fs at suave.net | $ x 16
Full-time WPI Network Tech, Part time Linux/Perl guy |
Norm: Gentlemen, start your taps.
-- Cheers, The Coach's Daughter
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Embperl and xemacs
Posted by erik <er...@mail.creditminders.com>.
On Wed, Feb 06, 2002 at 06:36:56PM +0100, Axel Beckert wrote:
> > I'm rather happy with it, but what I had to do to get it running is
> > a wee bit different from what you had to do...
>
> Maybe, mmm-mode is written for XEmacs and you're using GNU Emacs or
> vice versa? The both Emacses have different Emacs Lisp
> implementations, which often causes such problems.
I /am/ using GNU Emacs 21 (not officially supported ;-). I'm also
pretty much a novice at customizing Emacs. Plus, I use a dark
background with light fonts - so the default grey background imposed
by mmm-mode was completely unreadable.
I still haven't figured out how to get global-font-lock mode to allow
showing colors using mmm-mode in a text (not X) mode window. That's
my preferred method, and I've been having to actually start up the X
version (with all it's crappy extra window dressings) to get syntax
highlighting in mmm-mode.
That said, mmm-mode makes it worthwhile to actually put up with the X
version.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Embperl and xemacs
Posted by Axel Beckert <ab...@deuxchevaux.org>.
Hi!
On Wed, Feb 06, 2002 at 09:52:32AM -0600, erik wrote:
> Are there perhaps 2 different mmm-modes? I've never been able to
> download the one mentioned in the Embperl docs (bad link). I'm using
> the mmm-mode from mmm-mode.sourceforge.net, which comes with some
> code for an embperl mode.
No, I don't think, there are two versions. There once was a 'two mode
mode', but I guess, mmm is it's successor. The link on the Embperl
page just isn't up-to-date and the link will soon point to
http://mmm-mode.sourceforge.net/, Gerald told me. (I wrote him a few
days ago because of that broken link.)
> I'm rather happy with it, but what I had to do to get it running is
> a wee bit different from what you had to do...
Maybe, mmm-mode is written for XEmacs and you're using GNU Emacs or
vice versa? The both Emacses have different Emacs Lisp
implementations, which often causes such problems.
Regards, Axel
--
Axel Beckert - abe@deuxchevaux.org - http://abe.home.pages.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Embperl and xemacs
Posted by erik <er...@mail.creditminders.com>.
On Wed, Feb 06, 2002 at 08:58:45AM +0100, gerhard.egger wrote:
> Dear Gus,
>
> this really helped me!
>
> i added to my .xemacs-custom file:
Are there perhaps 2 different mmm-modes? I've never been able to
download the one mentioned in the Embperl docs (bad link). I'm using
the mmm-mode from mmm-mode.sourceforge.net, which comes with some code
for an embperl mode. I'm rather happy with it, but what I had to do
to get it running is a wee bit different from what you had to do... I
ended up adding the following to my .emacs to get version 0.4.7 to
work (this is a slightly hacked version of something they included in
"mmm-sample.el"):
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
(require 'mmm-auto)
(setq mmm-global-mode 'maybe)
(set-face-background 'mmm-default-submode-face nil)
(mmm-add-group
'embperl
'((embperl-perl
:submode perl-mode
:front "\\[\\([-\\+!\\*\\$]\\)"
:back "~1\\]"
:save-matches 1
:insert ((?p embperl "Region Type (Character): " @ "[" str
@ " " _ " " @ str "]" @)
(?+ embperl+ ?p . "+")
(?- embperl- ?p . "-")
(?! embperl! ?p . "!")
(?* embperl* ?p . "*")
(?$ embperl$ ?p . "$")
)
)
(embperl-comment
:submode text-mode
:front "\\[#"
:back "#\\]"
:insert ((?# embperl-comment nil @ "[#" @ " " _ " " @ "#]" @))
)
(embperl-html
:submode html-mode
:front "\\([-\\+!\\*\\$]\\)\\]"
:back "\\[\\([-\\+!\\*\\$]\\)"
:insert ((?# embperl-comment nil @ "[#" @ " " _ " " @ "#]" @))
)))
(add-to-list 'mmm-mode-ext-classes-alist '(nil "\\.epb\\'" embperl))
(add-to-list 'mmm-mode-ext-classes-alist '(nil "\\.epf\\'" embperl))
(add-to-list 'mmm-mode-ext-classes-alist '(nil "\\.epl\\'" embperl))
(add-to-list 'auto-mode-alist '("\\.epl\\'" . mmm-mode))
(add-to-list 'auto-mode-alist '("\\.epb\\'" . mmm-mode))
(add-to-list 'auto-mode-alist '("\\.epf\\'" . mmm-mode))
> ; mmm-mode (for embperl, etc)
> (require 'mmm-mode)
> ; .html is already associated with html-mode
> (add-to-list 'auto-mode-alist '("\\.epl\\'" . html-mode))
>
> ; to have syntaxhighlightning etc. for perl:
> (add-to-list 'auto-mode-alist '("\\.epl\\'" . perl-mode))
>
> (mmm-add-mode-ext-class 'html-mode "\\.epl\\'" 'embperl)
> (mmm-add-mode-ext-class 'html-mode "\\.html\\'" 'embperl)
> (setq mmm-global-mode 'maybe)
>
> thanks a lot!!!
>
> Gerhard
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Embperl and xemacs
Posted by "gerhard.egger" <ge...@lindeverlag.at>.
Dear Gus,
this really helped me!
i added to my .xemacs-custom file:
; mmm-mode (for embperl, etc)
(require 'mmm-mode)
; .html is already associated with html-mode
(add-to-list 'auto-mode-alist '("\\.epl\\'" . html-mode))
; to have syntaxhighlightning etc. for perl:
(add-to-list 'auto-mode-alist '("\\.epl\\'" . perl-mode))
(mmm-add-mode-ext-class 'html-mode "\\.epl\\'" 'embperl)
(mmm-add-mode-ext-class 'html-mode "\\.html\\'" 'embperl)
(setq mmm-global-mode 'maybe)
thanks a lot!!!
Gerhard
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Embperl and xemacs
Posted by Angus Lees <gu...@switchonline.com.au>.
On Tue, Feb 05, 2002 at 03:47:25PM +0100, gerhard.egger wrote:
> I've got the same problem installing mmm-mode with (x)emacs as Michael
> Blakeley had here: www.ecos.de/~mailarc/embperl/2000-06/msg00041.html
>
> (Autoloading failed to define function mmm-embperl)
>
> is there anyone who got this thing up and running and could tell us how?
i use mmm-mode all the time and it works (almost) fine.
there was a major version change at some point, and i'd be surprised
if a description from 2000 would work with the current mmm-mode.
the current mmm-mode doesn't need any explanation beyond the existing
info docs (at least, imo) - so you might want to check in there.
i use *.epl and *.html files with embperl, so i have this in my
~/.xemacs/init.el:
; mmm-mode (for embperl, etc)
(require 'mmm-mode)
; .html is already associated with html-mode
(add-to-list 'auto-mode-alist '("\\.epl\\'" . html-mode))
(mmm-add-mode-ext-class 'html-mode "\\.epl\\'" 'embperl)
(mmm-add-mode-ext-class 'html-mode "\\.html\\'" 'embperl)
(setq mmm-global-mode 'maybe)
--
- Gus
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Embperl and xemacs
Posted by "gerhard.egger" <ge...@lindeverlag.at>.
HI all,
I've got the same problem installing mmm-mode with (x)emacs as Michael
Blakeley had here: www.ecos.de/~mailarc/embperl/2000-06/msg00041.html
(Autoloading failed to define function mmm-embperl)
is there anyone who got this thing up and running and could tell us how?
thanks and greetings,
Gerhard
---
PS:
Big Thanks to Gerald for his great work on Embperl!
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org