This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 8836

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.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
jQuery in Action, 2nd edition
subject: Struts2 Play audio file
Similar Threads
Audio format conversion problems
HTTP response code: 403 on
method construction trouble
problem with JMF on Linux
Play a .wav file