hi, i have a simple two file webapp where i pass two strings to a jsp page for processing. however when i run the app, i get 'resource not found error'. cant figure out what's the problem... some help will be much appreciated.. i got two files. index.jsp which launches train.jsp

index.jsp

<%@page contentType="text/html" pageEncoding="UTF-8" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Kivox Test</h1>
        <p>&nbsp;</p>
        <form name="form1" method="post" action="train.jsp">
          <p>Select Audio File:
            <input type="text" name="audio" id="audio">
            <label>
              <input type="submit" name="Browsebutton" id="Browsebutton" value="...">
            </label>
          </p>
          <p>
            Enter name of model to generate:
            <input type="text" name="model" id="model">
          </p>
          <p>&nbsp;</p>
         </form>
        <p>
            <label>
              <input type="submit" name="Generate" id="Generate" value="Generate Model">
            </label>
          </p>
    </body>
</html>

train.jsp

<%@page import="java.util.*" %>
<%@page import="java.io.*" %>
<%@page import="es.agnitio.common.AgnitioWarning" %>
<%@page import="es.agnitio.engine.AudioProxy" %>
<%@page import="es.agnitio.kivoxVerifier.KivoxEngine" %>
<%@page import="es.agnitio.kivoxVerifier.KivoxException"%>
<%@page import="es.agnitio.kivoxVerifier.KivoxFactory" %>

   <%
       String aud = request.getParameter("audio");
       String mod = request.getParameter("model");
       try {
          KivoxEngine engine = KivoxFactory.getKivoxEngine();
	  AudioProxy audio = KivoxFactory.getProxyFactory().createAudioProxy(aud);
          List<AgnitioWarning> warnings = new LinkedList<AgnitioWarning>();
	  engine.train(audio, mod, warnings);
	    for (AgnitioWarning warning : warnings) {
      		System.out.println("Received warning: " + warning.getMessage());
	}
    %>
    <%=    System.out.print("Model:"+mod+" generated successfully!") %>
 	<%} catch (KivoxException e) {
			e.printStackTrace();
		}
	}
   %>

Can you list resources as their are organized on the server like
PROJECT_FOLDER

  • JSPs (files)
  • WEB-INF (folder)
    • lib (folder)
    • web.xml (file)

Hi,

I got it solved. Actually, I had to include the .jar resource packages (which enable all the Agnitio and Kivox sutff to work) that i was using in my project in the Glassfish server Sources in Netbeans as well to make it run.

It runs perfectly now.

Thanks anyways.

Cheers.

That is what I suspected, but did not want to feel you bad if I ask directly "did you included all libraries and put them in right place?" some people lately take it as rude

PS: You should also have look into servlets and JSTL to minimize use of scriplets in your JSPs

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.