You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Hans Drexler <dr...@geotax.nl> on 2007/04/03 13:13:56 UTC
Create Shoutcast service in Tapestry.
We try to create a Tapestry-service that generates a Shoutcast stream. The
problem is that the shoutcast response must have a status line that reads:
ICY 200 OK
Instead, the status line we get is always:
HTTP/1.1 200 OK
Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP status
line, but some do not. The ICY header is incorrect according to RFC 2616 and I
have been unable to generate a response with this status line.
Does somebody have a clue on how we could spit out a response with the ICY
like status line in it? Any help is appreciated.
The code we use now is basically like this:
private WebResponse _response;
[...]
private OutputStream initOutputStream(boolean metadata) throws IOException {
OutputStream out = _response.getOutputStream(new ContentType("audio/mpeg"));
//Spit out Shoutcast-headers.
_response.setHeader("icy-notice1","<BR>This stream requires <a
href=\"http://www.winamp.com/\">Winamp</a><BR>");
_response.setHeader("icy-notice1","MusiController
SHOUTcast-implementation<BR>");
_response.setHeader("icy-name","MusiController");
_response.setHeader("icy-genre","All sorts");
_response.setHeader("icy-url","http://musicontroller.sourceforge.net");
_response.setHeader("icy-pub","1");
_response.setHeader("icy-br","192");
if (metadata) _response.setIntHeader("icy-metaint",BUFFER_SIZE);
log.debug("Outputstream initialized");
return out;
}
[...]
public void setResponse(WebResponse response) {
_response = response;
}
----
Hans Drexler
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Problem of loop in client script with tapestry
Posted by Jesse Kuhnert <jk...@gmail.com>.
< isn't well formed character data. You can replace it with < and it'll
probably work then.
On 5/1/07, Ajit Raj <aj...@hotmail.com> wrote:
>
> Hi,
>
> I try to use "for" or "while" in the scirpt of a tapestry page as shown
> below. But it keeps give the error of "Unable to parse
> jndi:/localhost/WebRpt/WEB-INF/secure/PageRender.script: The content of
> elements must consist of well-formed character data or markup." Could
> anyone
> let me know what the problem is?
>
> Thanks,
>
>
> Ajit
>
> <!DOCTYPE script PUBLIC
> "-//Apache Software Foundation//Tapestry Script Specification 4.0
> //EN"
> "http://jakarta.apache.org/tapestry/dtd/Script_4_0.dtd">
> ...
>
> 402 var i=0;
> 403 var msg = "";
> 404 var x = 1;
> 405 while (x <= 10) <=========== complaining error here
> 406 {
> 407 msg = msg + x + "\n";
> 408 x++;
> 409 }
> 410
>
> _________________________________________________________________
> Don't quit your job – Take Classes Online and Earn your Degree in 1 year.
> Start Today!
>
> http://www.classesusa.com/clickcount.cfm?id=866146&goto=http%3A%2F%2Fwww.classesusa.com%2Ffeaturedschools%2Fonlinedegreesmp%2Fform-dyn1.html%3Fsplovr%3D866144
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
Re: Create Shoutcast service in Tapestry.
Posted by Jesse Kuhnert <jk...@gmail.com>.
Garr oh well . If only we had a servlet spec person around who would
know for sure if this is possible.
On 4/4/07, Hans Drexler <dr...@geotax.nl> wrote:
> On Tue, 3 Apr 2007 20:49:02 -0400, Jesse Kuhnert wrote
> > You can still do HttpServletResponse.setStatus(int code, String
> > message);
> >
> > It's deprecated so there may be a better way but who knows..It
> > wouldn't make sense if they didn't let you do it.
> >
>
> I think the setStatus() will only affect the "200 OK" part, not the "HTTP/1.1"
> part of the status line. But thanks for the reaction anyway.
>
> Hans Drexler
>
>
>
>
> > On 4/3/07, Hans Drexler <dr...@geotax.nl> wrote:
> > > On Tue, 03 Apr 2007 14:11:03 +0100, Richard Kirby wrote
> > > > Hi Hans,
> > > >
> > > > The status line is output by the servlet engine - not Tapestry,
> > > > since it is a core part of the HTTP spec.
> > > >
> > > > What you may be able to do, is create a javax.servlet.Filter which
> > > > reads the response from Tapestry into a stream, hopefully including
> > > > the status line - and then just re-output but with your new status
> > > > line. Don't know if that will work though.
> > > >
> > > > Richard.
> > > >
> > >
> > > I already had a hunch that it would be something like this. Thanks for the
> > > response. I will try to construct a filter. Never did that before, so it will
> > > be a challenge :-)
> > >
> > > > Hans Drexler wrote:
> > > > > We try to create a Tapestry-service that generates a Shoutcast stream. The
> > > > > problem is that the shoutcast response must have a status line that reads:
> > > > >
> > > > > ICY 200 OK
> > > > >
> > > > > Instead, the status line we get is always:
> > > > >
> > > > > HTTP/1.1 200 OK
> > > > >
> > > > > Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP
> status
> > > > > line, but some do not. The ICY header is incorrect according to RFC
> 2616 and I
> > > > > have been unable to generate a response with this status line.
> > > > >
> > > > > Does somebody have a clue on how we could spit out a response with the ICY
> > > > > like status line in it? Any help is appreciated.
> > > > >
> > > > >
> > > > >
> > > > > The code we use now is basically like this:
> > > > >
> > > > > private WebResponse _response;
> > > > >
> > > > > [...]
> > > > >
> > > > > private OutputStream initOutputStream(boolean metadata) throws
> IOException {
> > > > > OutputStream out = _response.getOutputStream(new
> ContentType("audio/mpeg"));
> > > > >
> > > > > //Spit out Shoutcast-headers.
> > > > > _response.setHeader("icy-notice1","<BR>This stream requires <a
> > > > > href=\"http://www.winamp.com/\">Winamp</a><BR>");
> > > > > _response.setHeader("icy-notice1","MusiController
> > > > > SHOUTcast-implementation<BR>");
> > > > > _response.setHeader("icy-name","MusiController");
> > > > > _response.setHeader("icy-genre","All sorts");
> > > > >
> _response.setHeader("icy-url","http://musicontroller.sourceforge.net");
> > > > > _response.setHeader("icy-pub","1");
> > > > > _response.setHeader("icy-br","192");
> > > > > if (metadata)
> _response.setIntHeader("icy-metaint",BUFFER_SIZE);
> > > > >
> > > > > log.debug("Outputstream initialized");
> > > > >
> > > > > return out;
> > > > > }
> > > > > [...]
> > > > >
> > > > > public void setResponse(WebResponse response) {
> > > > > _response = response;
> > > > > }
> > > > >
> > > > >
> > > > > ----
> > > > > Hans Drexler
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> > > ----
> > > Hans Drexler
> > > GeoTax en WOZ-Support b.v.
> > > e: drexler@geotax.nl
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> > --
> > Jesse Kuhnert
> > Tapestry/Dojo team member/developer
> >
> > Open source based consulting work centered around
> > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Create Shoutcast service in Tapestry.
Posted by Hans Drexler <dr...@geotax.nl>.
On Tue, 3 Apr 2007 20:49:02 -0400, Jesse Kuhnert wrote
> You can still do HttpServletResponse.setStatus(int code, String
> message);
>
> It's deprecated so there may be a better way but who knows..It
> wouldn't make sense if they didn't let you do it.
>
I think the setStatus() will only affect the "200 OK" part, not the "HTTP/1.1"
part of the status line. But thanks for the reaction anyway.
Hans Drexler
> On 4/3/07, Hans Drexler <dr...@geotax.nl> wrote:
> > On Tue, 03 Apr 2007 14:11:03 +0100, Richard Kirby wrote
> > > Hi Hans,
> > >
> > > The status line is output by the servlet engine - not Tapestry,
> > > since it is a core part of the HTTP spec.
> > >
> > > What you may be able to do, is create a javax.servlet.Filter which
> > > reads the response from Tapestry into a stream, hopefully including
> > > the status line - and then just re-output but with your new status
> > > line. Don't know if that will work though.
> > >
> > > Richard.
> > >
> >
> > I already had a hunch that it would be something like this. Thanks for the
> > response. I will try to construct a filter. Never did that before, so it will
> > be a challenge :-)
> >
> > > Hans Drexler wrote:
> > > > We try to create a Tapestry-service that generates a Shoutcast stream. The
> > > > problem is that the shoutcast response must have a status line that reads:
> > > >
> > > > ICY 200 OK
> > > >
> > > > Instead, the status line we get is always:
> > > >
> > > > HTTP/1.1 200 OK
> > > >
> > > > Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP
status
> > > > line, but some do not. The ICY header is incorrect according to RFC
2616 and I
> > > > have been unable to generate a response with this status line.
> > > >
> > > > Does somebody have a clue on how we could spit out a response with the ICY
> > > > like status line in it? Any help is appreciated.
> > > >
> > > >
> > > >
> > > > The code we use now is basically like this:
> > > >
> > > > private WebResponse _response;
> > > >
> > > > [...]
> > > >
> > > > private OutputStream initOutputStream(boolean metadata) throws
IOException {
> > > > OutputStream out = _response.getOutputStream(new
ContentType("audio/mpeg"));
> > > >
> > > > //Spit out Shoutcast-headers.
> > > > _response.setHeader("icy-notice1","<BR>This stream requires <a
> > > > href=\"http://www.winamp.com/\">Winamp</a><BR>");
> > > > _response.setHeader("icy-notice1","MusiController
> > > > SHOUTcast-implementation<BR>");
> > > > _response.setHeader("icy-name","MusiController");
> > > > _response.setHeader("icy-genre","All sorts");
> > > >
_response.setHeader("icy-url","http://musicontroller.sourceforge.net");
> > > > _response.setHeader("icy-pub","1");
> > > > _response.setHeader("icy-br","192");
> > > > if (metadata)
_response.setIntHeader("icy-metaint",BUFFER_SIZE);
> > > >
> > > > log.debug("Outputstream initialized");
> > > >
> > > > return out;
> > > > }
> > > > [...]
> > > >
> > > > public void setResponse(WebResponse response) {
> > > > _response = response;
> > > > }
> > > >
> > > >
> > > > ----
> > > > Hans Drexler
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> > ----
> > Hans Drexler
> > GeoTax en WOZ-Support b.v.
> > e: drexler@geotax.nl
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Create Shoutcast service in Tapestry.
Posted by Jesse Kuhnert <jk...@gmail.com>.
You can still do HttpServletResponse.setStatus(int code, String message);
It's deprecated so there may be a better way but who knows..It
wouldn't make sense if they didn't let you do it.
On 4/3/07, Hans Drexler <dr...@geotax.nl> wrote:
> On Tue, 03 Apr 2007 14:11:03 +0100, Richard Kirby wrote
> > Hi Hans,
> >
> > The status line is output by the servlet engine - not Tapestry,
> > since it is a core part of the HTTP spec.
> >
> > What you may be able to do, is create a javax.servlet.Filter which
> > reads the response from Tapestry into a stream, hopefully including
> > the status line - and then just re-output but with your new status
> > line. Don't know if that will work though.
> >
> > Richard.
> >
>
> I already had a hunch that it would be something like this. Thanks for the
> response. I will try to construct a filter. Never did that before, so it will
> be a challenge :-)
>
> > Hans Drexler wrote:
> > > We try to create a Tapestry-service that generates a Shoutcast stream. The
> > > problem is that the shoutcast response must have a status line that reads:
> > >
> > > ICY 200 OK
> > >
> > > Instead, the status line we get is always:
> > >
> > > HTTP/1.1 200 OK
> > >
> > > Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP status
> > > line, but some do not. The ICY header is incorrect according to RFC 2616 and I
> > > have been unable to generate a response with this status line.
> > >
> > > Does somebody have a clue on how we could spit out a response with the ICY
> > > like status line in it? Any help is appreciated.
> > >
> > >
> > >
> > > The code we use now is basically like this:
> > >
> > > private WebResponse _response;
> > >
> > > [...]
> > >
> > > private OutputStream initOutputStream(boolean metadata) throws IOException {
> > > OutputStream out = _response.getOutputStream(new ContentType("audio/mpeg"));
> > >
> > > //Spit out Shoutcast-headers.
> > > _response.setHeader("icy-notice1","<BR>This stream requires <a
> > > href=\"http://www.winamp.com/\">Winamp</a><BR>");
> > > _response.setHeader("icy-notice1","MusiController
> > > SHOUTcast-implementation<BR>");
> > > _response.setHeader("icy-name","MusiController");
> > > _response.setHeader("icy-genre","All sorts");
> > > _response.setHeader("icy-url","http://musicontroller.sourceforge.net");
> > > _response.setHeader("icy-pub","1");
> > > _response.setHeader("icy-br","192");
> > > if (metadata) _response.setIntHeader("icy-metaint",BUFFER_SIZE);
> > >
> > > log.debug("Outputstream initialized");
> > >
> > > return out;
> > > }
> > > [...]
> > >
> > > public void setResponse(WebResponse response) {
> > > _response = response;
> > > }
> > >
> > >
> > > ----
> > > Hans Drexler
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ----
> Hans Drexler
> GeoTax en WOZ-Support b.v.
> e: drexler@geotax.nl
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Jesse Kuhnert
Tapestry/Dojo team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Create Shoutcast service in Tapestry.
Posted by Hans Drexler <dr...@geotax.nl>.
On Tue, 03 Apr 2007 14:11:03 +0100, Richard Kirby wrote
> Hi Hans,
>
> The status line is output by the servlet engine - not Tapestry,
> since it is a core part of the HTTP spec.
>
> What you may be able to do, is create a javax.servlet.Filter which
> reads the response from Tapestry into a stream, hopefully including
> the status line - and then just re-output but with your new status
> line. Don't know if that will work though.
>
> Richard.
>
I already had a hunch that it would be something like this. Thanks for the
response. I will try to construct a filter. Never did that before, so it will
be a challenge :-)
> Hans Drexler wrote:
> > We try to create a Tapestry-service that generates a Shoutcast stream. The
> > problem is that the shoutcast response must have a status line that reads:
> >
> > ICY 200 OK
> >
> > Instead, the status line we get is always:
> >
> > HTTP/1.1 200 OK
> >
> > Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP status
> > line, but some do not. The ICY header is incorrect according to RFC 2616 and I
> > have been unable to generate a response with this status line.
> >
> > Does somebody have a clue on how we could spit out a response with the ICY
> > like status line in it? Any help is appreciated.
> >
> >
> >
> > The code we use now is basically like this:
> >
> > private WebResponse _response;
> >
> > [...]
> >
> > private OutputStream initOutputStream(boolean metadata) throws IOException {
> > OutputStream out = _response.getOutputStream(new ContentType("audio/mpeg"));
> >
> > //Spit out Shoutcast-headers.
> > _response.setHeader("icy-notice1","<BR>This stream requires <a
> > href=\"http://www.winamp.com/\">Winamp</a><BR>");
> > _response.setHeader("icy-notice1","MusiController
> > SHOUTcast-implementation<BR>");
> > _response.setHeader("icy-name","MusiController");
> > _response.setHeader("icy-genre","All sorts");
> > _response.setHeader("icy-url","http://musicontroller.sourceforge.net");
> > _response.setHeader("icy-pub","1");
> > _response.setHeader("icy-br","192");
> > if (metadata) _response.setIntHeader("icy-metaint",BUFFER_SIZE);
> >
> > log.debug("Outputstream initialized");
> >
> > return out;
> > }
> > [...]
> >
> > public void setResponse(WebResponse response) {
> > _response = response;
> > }
> >
> >
> > ----
> > Hans Drexler
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
----
Hans Drexler
GeoTax en WOZ-Support b.v.
e: drexler@geotax.nl
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Problem of loop in client script with tapestry
Posted by Ajit Raj <aj...@hotmail.com>.
Hi,
I try to use "for" or "while" in the scirpt of a tapestry page as shown
below. But it keeps give the error of "Unable to parse
jndi:/localhost/WebRpt/WEB-INF/secure/PageRender.script: The content of
elements must consist of well-formed character data or markup." Could anyone
let me know what the problem is?
Thanks,
Ajit
<!DOCTYPE script PUBLIC
"-//Apache Software Foundation//Tapestry Script Specification 4.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Script_4_0.dtd">
...
402 var i=0;
403 var msg = "";
404 var x = 1;
405 while (x <= 10) <=========== complaining error here
406 {
407 msg = msg + x + "\n";
408 x++;
409 }
410
_________________________________________________________________
Dont quit your job Take Classes Online and Earn your Degree in 1 year.
Start Today!
http://www.classesusa.com/clickcount.cfm?id=866146&goto=http%3A%2F%2Fwww.classesusa.com%2Ffeaturedschools%2Fonlinedegreesmp%2Fform-dyn1.html%3Fsplovr%3D866144
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Create Shoutcast service in Tapestry.
Posted by Richard Kirby <rb...@capdm.com>.
Hi Hans,
The status line is output by the servlet engine - not Tapestry, since it
is a core part of the HTTP spec.
What you may be able to do, is create a javax.servlet.Filter which reads
the response from Tapestry into a stream, hopefully including the status
line - and then just re-output but with your new status line. Don't know
if that will work though.
Richard.
Hans Drexler wrote:
> We try to create a Tapestry-service that generates a Shoutcast stream. The
> problem is that the shoutcast response must have a status line that reads:
>
> ICY 200 OK
>
> Instead, the status line we get is always:
>
> HTTP/1.1 200 OK
>
> Many mediaplayers (WinAmp, Xmms, iTunes) accept the header with HTTP status
> line, but some do not. The ICY header is incorrect according to RFC 2616 and I
> have been unable to generate a response with this status line.
>
> Does somebody have a clue on how we could spit out a response with the ICY
> like status line in it? Any help is appreciated.
>
>
>
> The code we use now is basically like this:
>
> private WebResponse _response;
>
> [...]
>
> private OutputStream initOutputStream(boolean metadata) throws IOException {
> OutputStream out = _response.getOutputStream(new ContentType("audio/mpeg"));
>
> //Spit out Shoutcast-headers.
> _response.setHeader("icy-notice1","<BR>This stream requires <a
> href=\"http://www.winamp.com/\">Winamp</a><BR>");
> _response.setHeader("icy-notice1","MusiController
> SHOUTcast-implementation<BR>");
> _response.setHeader("icy-name","MusiController");
> _response.setHeader("icy-genre","All sorts");
> _response.setHeader("icy-url","http://musicontroller.sourceforge.net");
> _response.setHeader("icy-pub","1");
> _response.setHeader("icy-br","192");
> if (metadata) _response.setIntHeader("icy-metaint",BUFFER_SIZE);
>
> log.debug("Outputstream initialized");
>
> return out;
> }
> [...]
>
> public void setResponse(WebResponse response) {
> _response = response;
> }
>
>
> ----
> Hans Drexler
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org