Problem with Java servlet - data provider Created Jun 10, 2009
This thread is solved
Views: 1122 Replies: 3 Last reply Nov 30, 2009
You must login first before you can use this feature
Reply to:
Problem with Java servlet - data provider, from
Jamon
Hi!
I have the same problem when I use servlet for playing mp3. When I put to 'href' attribute path to mp3 file, music is played. But when I try to use byte stream from servlet, player gives me this message (200, Stream not found, [object ClipError], clip: '[Clip] '/.VideoPlayer/GetMovies'') and music isn't played. (VideoPlayer is a .war archive)
Here is my GetMovies servlet's code:
I have the same problem when I use servlet for playing mp3. When I put to 'href' attribute path to mp3 file, music is played. But when I try to use byte stream from servlet, player gives me this message (200, Stream not found, [object ClipError], clip: '[Clip] '/.VideoPlayer/GetMovies'') and music isn't played. (VideoPlayer is a .war archive)
Here is my GetMovies servlet's code:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
File file = new File("e:\1.mp3");
// File file = new File("e:\video.flv");
FileInputStream inputStream = new FileInputStream(file);
byte[] bs = new byte[(int) file.length()];
inputStream.read(bs);
inputStream.close();
response.setContentType("audio/x-mp3");
// response.setContentType("video/x-flv");
response.setContentLength(bs.length);
ServletOutputStream stream = response.getOutputStream();
stream.write(bs);
stream.flush();
stream.close();
}
Also if I use flowplayer for playing .flv files, everything works fine. If you solved this problem let me know, please.
Reply to:
» Problem with Java servlet - data provider, from
talgentus
Has anybody solved the problem?
Reply to:
Problem with Java servlet - data provider, from
Jamon
Link must end with ".mp3".
In your case it may look like:
In your case it may look like:
<a href = ${pageContext.request.contextPath}/servlets/fake.mp3?VARS=${msg.fileId}></a>