File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts2 Play audio file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 Play audio file" Watch "Struts2 Play audio file" New topic

Struts2 Play audio file

Dev Anand
Ranch Hand

Joined: Aug 30, 2009
Posts: 41
I have written following code to play audio file. It is neither showing any error message nor playing the mp3 song.

I'm calling the above class from jsp file as below :

can anybody help me why its not getting played?

Thank you.

Dev Anand. P
Joe Ess

Joined: Oct 29, 2001
Posts: 9048

Struts and JSP code run on the server, so I'm not sure your code even does what you want it to do (not to mention using Java code in JSP's is a Bad Idea).
If you want to play a file for the user through the browser, you should probably look at the java.applet.Applet play() method.

[How To Ask Questions On JavaRanch]
subject: Struts2 Play audio file