Java code within jsp file

Hi,
I would like to append the Java source code to jsp file created by Tamino X-Application. I have all the necessary packages ( I think so) but when I try to run my application, I have the following error :
Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile C:\jakarta\work\DEFAULT\hasla\search1_1.java:6: Package com.softwareag.tamino.API.dom not found in import.
import com.softwareag.tamino.API.dom.;
^
1 error

at org.apache.tomcat.facade.JasperLiaison.javac(Unknown Source)
at org.apache.tomcat.facade.JasperLiaison.processJspFile(Unknown Source)
at org.apache.tomcat.facade.JspInterceptor.requestMap(Unknown Source)
at org.apache.tomcat.core.ContextManager.processRequest(Unknown Source)
at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)
at org.apache.tomcat.core.ContextManager.service(Unknown Source)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unknown Source)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:484)


My source code of search.jsp created by Tamino X-Application looks like :



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>


<%@ page language=“java” contentType=“text/html; charset=UTF-8” errorPage=“Error.jsp”%>

<%@ page import="java.util.
" %>
<%@ page import=“org.w3c.dom." %>
<%@ page import="com.softwareag.tamino.API.dom.
” %>

<%@ taglib uri=“404” prefix=“xapp” %>



Query BLA

.link {
COLOR: #000000; FONT-WEIGHT: bold; TEXT-DECORATION: none
}
A {
COLOR: #000000; FONT-WEIGHT: bold; TEXT-DECORATION: none
}
A:link {
FONT-WEIGHT: bold
}
A:hover {
COLOR: #000000; FONT-WEIGHT: bold; TEXT-DECORATION: underline
}






<%
String Protocol= “http”; String strComputer = “bla”;
String strDatabase = “baza”;
String strCollection = “Password”;
String strDoctype = “BSB”;

String strUserID = arg[0]; String strPassword = arg[1];
// zapytanie do bazy hase?
String strQuery = “[modulo='” + strUserID + “’ and haslo='” + strPassword + “']”;

// ?cie?ka do bazy hase?
String strURL = strProtocol + “://” +strComputer + “/tamino/” + strDatabase;

String strAllQuery = strDoctype + strQuery;
String strAllURL = strURL + “/” + strCollection;

int intPageSize = 1;

TaminoClient tamino = new TaminoClient(strAllURL);


try
{
tamino.setPageSize(intPageSize);
tamino.startSession();
TaminoResult tr = tamino.query(strAllQuery);
Enumeration e = tr;
int i = 0;
while (e.hasMoreElements())
{
i = i + 1;
System.out.println(“Record " + Integer.toString(i) +” found.");
Element el = (Element)e.nextElement();


int kodpowrotu = 1;
System.out.println(kodpowrotu);
//TaminoClient.printTree(el);
}
tamino.endSession();
if (i==0)
{
System.out.println(“No record.”);
int kodpowrotu = 0;
System.out.println(kodpowrotu);}

}
catch (com.softwareag.tamino.API.dom.TaminoError myError)
{
// database is not active System.err.println("Tamino Error Code: " + myError.responseCode + “\n” +
"Tamino Error Text: " + myError.errorText);
}

%>



xapp:module

xapp:form




Could anybody help me ?
Regards, vs

You need to ensure that the taminoclient.jar, sax.jar, xp.jar, domsdk.jar and w3cdom1.jar are in the WEB-INF\lib directory underneath where your JSP file resides. Tomcat does not look in the system CLASSPATH.

Hi,
I have attached all the jar files to WEB-INF/lib directory, run the application and I have got the following error :
!Error!
An error occurred in the application program. Please report the following problem to your webmaster.
Error message: internal error
Help message:
Exception id: 999
Exception Type: ApplicationException
Stacktrace:


XException: id = 999
java.lang.NoSuchMethodError
at com.softwareag.tamino.db.API.response.dom.TDOMInputStreamInterpreter.setMessageContentItem(TDOMInputStreamInterpreter.java:131)
at com.softwareag.tamino.db.API.response.dom.TDOMInputStreamInterpreter.setResponseInfoContent(TDOMInputStreamInterpreter.java:115)
at com.softwareag.tamino.db.API.response.dom.TDOMInputStreamInterpreter.doInterpret(TDOMInputStreamInterpreter.java:87)
at com.softwareag.tamino.db.API.response.TInputStreamInterpreter.interpret(TInputStreamInterpreter.java:61)
at com.softwareag.tamino.db.API.response.TResponseBuilderImpl.doBuild(TResponseBuilderImpl.java:90)
at com.softwareag.tamino.db.API.response.TResponseBuilderImpl.buildForXML(TResponseBuilderImpl.java:69)
at com.softwareag.tamino.db.API.accessor.TGenericAccessorImpl.execute(TGenericAccessorImpl.java:56)
at com.softwareag.tamino.db.API.accessor.TSystemAccessorImpl.diagnose(TSystemAccessorImpl.java:193)
at com.softwareag.tamino.db.API.accessor.TSystemAccessorImpl.getServerVersion(TSystemAccessorImpl.java:108)
at com.softwareag.xtools.xapplication.store.TaminoStore.getVersion(TaminoStore.java:320)
at com.softwareag.xtools.xapplication.store.TaminoStore.(TaminoStore.java:246)
at com.softwareag.xtools.xapplication.jsp.ApplicationContext.newStore(ApplicationContext.java:235)
at com.softwareag.xtools.xapplication.jsp.ApplicationContext.(ApplicationContext.java:107)
at com.softwareag.xtools.xapplication.jsp.ApplicationContext.forServlet(ApplicationContext.java:162)
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findApplicationContext(ServletSessionContext.java:170)
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findSessionContext(ServletSessionContext.java:96)
at com.softwareag.xtools.xapplication.jsp.ServletSessionContext.findSessionContext(ServletSessionContext.java:71)
at com.softwareag.xtools.xapplication.jsp.JspTag.checkContext(JspTag.java:252)
at com.softwareag.xtools.xapplication.jsp.JspTag.doStartTag(JspTag.java:133)
at search1_1._jspService(search1_1.java:140)
at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
at org.apache.tomcat.core.Handler.invoke(Unknown Source)
at org.apache.tomcat.core.Handler.service(Unknown Source)
at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)
at org.apache.tomcat.core.ContextManager.service(Unknown Source)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unknown Source)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:484)

My source code of search.jsp file looks like :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<%@ page language=“java” contentType=“text/html; charset=UTF-8” errorPage=“Error.jsp”%>

<%@ page import=“java.util." %>
<%@ page import="org.w3c.dom.
” %>
<%@ page import=“com.softwareag.tamino.API.dom.*” %>

<%@ taglib uri=“404” prefix=“xapp” %>



Query BSB

.link {
COLOR: #000000; FONT-WEIGHT: bold; TEXT-DECORATION: none
}
A {
COLOR: #000000; FONT-WEIGHT: bold; TEXT-DECORATION: none
}
A:link {
FONT-WEIGHT: bold
}
A:hover {
COLOR: #000000; FONT-WEIGHT: bold; TEXT-DECORATION: underline
}





(…)

xapp:module

xapp:form








Have you any idea what wrong is ?
Regards,
vs

Hi, I think the problem is the combination of XApplication and the old HTTP Client API for Java. This is not a good idea because there will be conflicts (e.g. dom1 classes vs. dom2 classes). Better would be to use the Tamino API for Java and even better still would be to use the XApplication classes especially within the XApplication context.