[Xitami] Newbie question

Francis Turner xitami@lists.xitami.org
Fri, 26 Jul 2002 11:57:03 +0200


This is a multi-part message in MIME format.
--------------030007090306010706080102
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

just fun wrote:

>Thanks Garry,
>
>Is that the only way? company doesn't encourage frame
>
>  
>
The only other way is to run the servlets direct from Xitami using the 
servlet runner at http://runner.conacom.de

If you do a web redirect then the browser will show the URI of the new 
location unless you use a frame.

If you want to do frames/redirects then you can do it server side 
insetad of client side using GSL / XML if you have xitami 2.5b5.

The enclosed script will do this and shoud be self explanatory

Francis

-- 
...if the US Government were ever to get really serious about Internet 
security, the top players in Microsoft's management hierarchy would find 
themselves handcuffed, blindfolded, led onto a tarmac within some obscure 
Air Force base, and shot.
-- Thomas C Greene (http://www.theregister.co.uk/content/55/23223.html)



--------------030007090306010706080102
Content-Type: text/plain;
 name="relo.gsl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="relo.gsl"

.-----------------------------------------------------------------------------
.-
.-  Relocator
.-
.-  Written:  2001/12/12  Francis Turner
.-  Modified: 2002/07/26  Francis Turner
.-
.-  Redirects you to another port on the same server. Either as a redirect or
.-  as an embedded frame. You can call it in 2 ways: either call direct 
.-    relo.gsl?p=PPP&m=C&t=TTT
.-    where PPP is the port for the redirect
.-    C is either an R for redirect or an F for frame
.-    TTT is a title used to give the frame mode a title. It is ignored in R mode
.-  or use as the script for a service.xml script
.-    e.g. a SWAT service redirector would look like
.-    <RELO SCRIPT='/relo.gsl'>
.-      <SERVICE NAME='Swat' PORT='901' MODE='FRAME'/>
.-    </RELO>
.-
.-  Modification allows you to do redrects to remote servers too using 
.-  either relo.gsl?u=URI&m=C&t=TTT or 
.-    <RELO SCRIPT='/relo.gsl'>
.-      <SERVICE NAME='Remote Server' MODE='FRAME'
.-        URI='http://remote.example.com/path/to/somewhere.html' />
.-    </RELO>
.-  Note that the direct call method will not cope well with URIs that have 
.-  their own query strings (i.e. URIs of the form http://some/where?query )
.-
.-----------------------------------------------------------------------------
<HTML><HEAD>
.- 
.- First deal with the case when called from XXX.xml
.- 
.if filename <> script
.  for service
.    mode ?= 'r'
.    port ?= 80
.    name ?= "Relo "+ port 
.    if (substr(mode,0,1,) = "f") | (substr(mode,0,,1) = "F")
<TITLE>$(name:)</TITLE></HEAD>
<FRAMESET cols="*">
.      if defined(uri)
  <FRAME name="In" src="$(uri:)">
.      else
  <FRAME name="In" src="http://$(HTTP_HOST:lower):$(port:)/">
.      endif
  <NOFRAMES>
  <H1>Sorry!</H1>
  <H3>This page must be viewed by a browser that is capable of viewing frames.</H3>
  </NOFRAMES>
</FRAMESET></HTML>
.    else
.      if defined(uri)
  <meta http-equiv="Refresh" content="0; URL=$(uri:)"></HEAD>
.      else
  <meta http-equiv="Refresh" content="0; URL=http://$(HTTP_HOST:lower):$(port:)/"></HEAD>
.      endif
  <BODY></BODY></HTML>
.-  <BODY>$(port?:)=$(name?:)=$(mode?:)-$(substr(mode,0,,1):)
.- </BODY></HTML>
.    endif
.  endfor
.- 
.- Now deal with the case when called direct as relo.gsl?p=PPP&m=C&t=TTT
.- 
.elsif defined(p)
.  m ?= 'r'
.  if substr(m,0,1,) = 'r'
<meta http-equiv="Refresh" content="0; URL=http://$(HTTP_HOST:lower):$(p:)/"></HEAD>
<BODY></BODY></HTML>
.  else
.    t ?= "Relo "+p
<TITLE>$(t:)</TITLE></HEAD>
<FRAMESET cols="*">
  <FRAME name="In" src="http://$(HTTP_HOST:lower):$(p:)/">
  <NOFRAMES>
  <H1>Sorry!</H1>
  <H3>This page must be viewed by a browser that is capable of viewing frames.</H3>
  </NOFRAMES>
</FRAMESET></HTML>
.  endif
.- 
.- Now deal with the case when called direct as relo.gsl?u=URI&m=C&t=TTT
.- 
.elsif defined(u)
.  m ?= 'r'
.  if substr(m,0,1,) = 'r'
<meta http-equiv="Refresh" content="0; URL=$(u:)"></HEAD>
<BODY></BODY></HTML>
.  else
.    t ?= "Relo "+u
<TITLE>$(t:)</TITLE></HEAD>
<FRAMESET cols="*">
  <FRAME name="In" src="$(u:)">
  <NOFRAMES>
  <H1>Sorry!</H1>
  <H3>This page must be viewed by a browser that is capable of viewing frames.</H3>
  </NOFRAMES>
</FRAMESET></HTML>
.  endif
.else
</HEAD><BODY>Bad Boy</BODY></HTML>
.endif

--------------030007090306010706080102--