-2

I just want to finish a simple HTML 5 example.

    <audio src="2.mp3" controls autoplay>
        Your browser does not support the audio element.
    </audio>

but it can't complete and this is the description from Tomcat:

"The requested resource (/DemoPlaying/2.mp3) is not available."

My folder structure:

folder structure

acdcjunior
  • 132,397
  • 37
  • 331
  • 304
giggles2710
  • 41
  • 1
  • 7

2 Answers2

2

It's obvious that your mp3 file is not available at the URL you're trying to request it. Correct your 'src' to point to the correct url.

NilsH
  • 13,705
  • 4
  • 41
  • 59
1

I think you must remember:

1) If your app is wellformed, then the typical structure is like:

http://myserver:8080/myapp

2) Then your file must be published under the contexto of your app

http://myserver:8080/myapp/mp3file

3) So, in development time your structure must be:

Webcontent
   |
   |--index.jsp
   |--mymp3.mp3
   |--WEB-INF

4) And war file must content the same of Webcontent (or root folder of your app)

Only in that way your file will be detectable by the server, and dont forget to registrer the extension on Tomcat Server