this is the error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.IllegalStateException
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:62)
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:770)
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:335)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:306)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
Apache Tomcat/5.5.9
> important note:
> on tomcat for windows the webapp works
> on tomcat for linux I get that error
Start with the obvious, since you are managing files on the file system make sure that the file permisions and file paths are correct and the servlet can access the files.
I had some problems so I'll get logs only now...
### web message:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.IllegalStateException
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:62)
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:770)
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:335)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:306)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
Apache Tomcat/5.5.9
### and now the catalina.log:
ov 18, 2005 3:01:24 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Nov 18, 2005 3:01:24 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 752 ms
Nov 18, 2005 3:01:24 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 18, 2005 3:01:24 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
Nov 18, 2005 3:01:24 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Nov 18, 2005 3:01:25 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Nov 18, 2005 3:01:25 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 18, 2005 3:01:25 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/23 config=null
Nov 18, 2005 3:01:25 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Nov 18, 2005 3:01:25 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1795 ms
and this is localhost.log:
Nov 18, 2005 3:01:24 PM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
Nov 18, 2005 3:01:25 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Nov 18, 2005 3:01:25 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Nov 18, 2005 3:01:25 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Nov 18, 2005 3:01:25 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Nov 18, 2005 3:01:29 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet default threw exception
java.lang.IllegalStateException
at org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:62)
at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:770)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:335)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:306)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Nov 18, 2005 3:01:29 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException
at org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:62)
at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:770)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:335)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:306)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
### I'm connecting to the remote computer with tomcat and my webapp with Firefox 1.0.7 - the webapp seems to work.. but I get that error when the app tries to load a db present (the app uses normal XML files as db)
Thank you in advance!
> no one able to help me?
> do you need more informations?
>
> I hope to get help in this forum! :-(
Google is your friend. [url=http://www.opensubscriber.com/message/tomcat-user@jakarta.apache.org/1558057.html] this article[/url] seems to imply that you have already obtained the OutputStream, so it can't get it again.
I think that this is extactly my situation:
On Fri, June 17, 2005 2:02 pm, Frank W. Zammetti said:
> Hey all... I have a situation where I want to use a <jsp:include> whos
> target is actually a servlet... Problem is, in the servlet I do:
>
> ServletOutputStream out = response.getOutputStream();
> out.println(items.getItem());
>
> ...which yields:
>
> java.lang.IllegalStateException
>
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:62)
>
> Commenting out those two lines gets rid of the exception. If I call the
> servlet directly on its own I get my expected result, so I know the
> servlet itself works.
>
> I'm assuming this is some sort of limitation of the include mechanism,
> question is, can it be overcome? I added flush="true" to the include tag,
> which gets rid of the exception but makes the resultant page end where the
> include is, so that's not the answer.
>
> An ideas? Is this something that can be done in the first place? If so,
> how does one overcome this problem? TIA!
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
so... how can I solve this problem?
[nobr]this is the RecManServ servlet that I use as interface between index.jsp and recMan.class (a simple recordManager for a simple XML db).
I know... it's ugly... but I think that my problem is here
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.lang.*;
import java.lang.String.*;
import javax.xml.parsers.*;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.w3c.dom.*;
public class recManServ extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
String dbname = new String(request.getParameterValues("_dbname_")[0]);
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html><head><title>File XML</title></head>");
// out.println("<body bgcolor=\"#C7C7F1\">\n");
out.println("<body bgcolor=\"#C7C7F1\" onload=setTimeout(\"location.href='index.jsp@dbn="+dbname+"'\",3000)>");
out.println("<h2>SchemaForm: recordManager</h2>");
try {// ************************************************** CORPO PRINCIPALE ***
String containerhome = new String(System.getProperty("catalina.home")); // TOMCAT SPECIFIC !!!!!
//String dbname = new String(request.getParameterValues("_dbname_")[0]);
String basename = new String(containerhome+"/webapps/SchemaForm/database/");
/*String recIdStr = new String(request.getParameterValues("_id_")[0]);
int recId = Integer.parseInt(recIdStr);*/
String idnum = new String(request.getParameterValues("_id_")[0]);
String operation = new String(request.getParameterValues("_recMan_")[0]);
recordManager recMan = new recordManager();
if (operation.compareTo("new")==0 || operation.compareTo("ins")==0 || operation.compareTo("mod")==0)
{
File f = new File(basename+dbname+"/db_rec.xml");
FileWriter fout = new FileWriter(f);
fout.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
String[] paramValues = request.getParameterValues("_XMLrec_");//("_recordXML_");
if (paramValues != null)
{
if (paramValues.length == 1)
{
StringparamValue = paramValues[0];
/*
(vedi analoga in insertValue (obsoleta)
*/
fout.write(paramValue);
}
}
//out.println(paramValues[0]);
fout.write("\n");
fout.close();
out.println("<br /><br />");
SchemaTest testXml = new SchemaTest(basename+dbname+"/db_rec.xml", basename+dbname+"/"+dbname+".xsd", out);
int result = testXml.process(dbname); // passo il nome del database, che coincide col nome dello schema
if (result == 0)
{
out.println("<br /><hr />All seems ok... and the World go on");
boolean insert = false;
if (operation.compareTo("ins")==0)
insert = true;
//String idnum = new String(request.getParameterValues("_id_")[0]);
//recordManager recMan = new recordManager();
recMan.addRecord(basename+dbname+"/"+dbname+".xml", basename+dbname+"/db_rec.xml", idnum, insert);
//recMan.extRecord(basename+dbname+"/"+dbname+".xml", basename+dbname+"/dbRecExt.xml", idnum);
if (operation.compareTo("new")==0)
{
int numId = Integer.parseInt(idnum);
numId++;
idnum = Integer.toString(numId);
int recNum = 0;
File ltrn = new File(basename+dbname+"/"+dbname+".num");
if (ltrn.exists())
{
FileReader fr = new FileReader(ltrn);
char[] charr = new char[12];
fr.read(charr, 0, 10);
String buff = new String();
for (int k=0; k<charr.length; k++)
if (charr[k]>='0' && charr[k]<='9')
buff += charr[k];
recNum = Integer.parseInt(buff);
fr.close();
}
String recId = Integer.toString(recNum);
recMan.writeRecNum(basename+dbname+"/db_rec.xml", recId); // aggiorno indice record visualizzato
}
}
else
{
out.println("<br /><hr />Oh oh... Huston... Some problems here... ("+result+")");
}
}
else
if (operation.compareTo("del")==0)
{
recMan.delRecord(basename+dbname+"/"+dbname+".xml", idnum);
//recMan.extRecord(basename+dbname+"/"+dbname+".xml", basename+dbname+"/dbRecExt.xml", idnum);
recMan.writeRecNum(basename+dbname+"/"+dbname+".xml", idnum);
int numRecord = 0;
File ltn = new File(basename+dbname+"/"+dbname+".num");
if (ltn.exists())
{
FileReader fr = new FileReader(ltn);
char[] charr = new char[12];
fr.read(charr, 0, 10);
String buff = new String();
for (int k=0; k<charr.length; k++)
if (charr[k]>='0' && charr[k]<='9')
buff += charr[k];
numRecord = Integer.parseInt(buff);
fr.close();
}
if (numRecord == 0) {
File fdb = new File(basename+dbname+"/"+dbname+".xml");
fdb.delete();
File frecx = new File(basename+dbname+"/db_rec.xml");
frecx.delete();
File frecn = new File(basename+dbname+"/db_rec.num");
frecn.delete();
}
}
else
if (operation.compareTo("prev")==0 || operation.compareTo("next")==0)
{
//recMan.extRecord(basename+dbname+"/"+dbname+".xml", basename+dbname+"/dbRecExt.xml", idnum);
recMan.extRecord(basename+dbname+"/"+dbname+".xml", basename+dbname+"/db_rec.xml", idnum);
recMan.writeRecNum(basename+dbname+"/"+dbname+".xml", idnum);
}
}
catch (Exception e) {
ErrorMsg emsg = new ErrorMsg(out);
emsg.errorServletPrint("XML Validator [fillRecord Module]", e);
}
out.println("<br/><hr/><a href=\"../index.jsp?dbn="+dbname+"\">HOME</a> [you will be redirected within few seconds...]");
out.println("\n</body></html>");
}
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
doGet(request, response);
}
static void purgeTree(Node n) // lascia solo i TAG (per ora)
{
if (n != null) {
purgeTree(n.getFirstChild());
purgeTree(n.getNextSibling());
String name = n.getNodeName();
if (name=="#text")
{
String value = n.getNodeValue();
value = value.trim();
Node genitor = n.getParentNode();
genitor.removeChild(n);
}
}
}
static String elemAttrToString(Node n)
{
String attStr = "";
NamedNodeMap nnm = n.getAttributes();
if (nnm != null)
{
int len = nnm.getLength();
for (int i=0; i<len; i++)
{
Node attnode = nnm.item(i);
String nome = attnode.getNodeName();
String valore = attnode.getNodeValue();
attStr += " "+nome+"=\""+valore+"\"";
}
}
return (attStr);
}
static void visitTree(Node n, int depth, PrintWriter out, HttpServletRequest request, FileWriter fout)
throws IOException
{
if (n != null) {
fout.write("\n");
for (int i=0; i><depth; i++) {
fout.write("");
}
String elemattr = elemAttrToString(n);
fout.write("><"+n.getNodeName().toString()+elemattr+">");
boolean b = insertValue(n, request, out, fout); // INSERISCE IL RECORD
stampaNodo(n, depth, out, request);
visitTree(n.getFirstChild(), depth+1, out, request, fout);
if (!b)
{
fout.write("\n");
for (int i=0; i<depth; i++)
{
fout.write("");
}
}
fout.write("></"+n.getNodeName().toString()+">");
visitTree(n.getNextSibling(), depth, out, request, fout);
}
}
static void stampaNodo(Node n, int depth, PrintWriter out, HttpServletRequest request)
{
for (int i=0; i<depth; i++) {
out.print("");
}
String nome = n.getNodeName();
if (nome == "#text")
{
String valore = n.getNodeValue();
out.print("("+valore+") ");
}
else {
out.print("["+nome+"] ");
NamedNodeMap nnm = n.getAttributes(); // stampo anche gli attributi...
if (nnm != null)
{
out.print("[");
int len = nnm.getLength();
for (int i=0; i><len; i++)
{
Node attnode = nnm.item(i);
nome = attnode.getNodeName();
String valore = attnode.getNodeValue();
out.print("("+nome+": "+valore+")");
}
out.print("]");
}
}
out.println("><br />");
}
static String getParName(String nodename, HttpServletRequest request, PrintWriter out)
{
String retStr = "_NotFound_";
Enumeration paraNames = request.getParameterNames();
while (paraNames.hasMoreElements())
{
String elem = (String)paraNames.nextElement();
String myele = elem.replace("::",":");
int last = myele.lastIndexOf(':');
String name = myele.substring(0, last);
String type = myele.substring(last+1);
out.println("<br/>1name: "+name);
out.println("<br/>2type: "+type);
if (name.compareTo(nodename)==0)
{
retStr = name;
}
}
out.println("<br/>END");
return (retStr);
}
static boolean insertValue(Node n, HttpServletRequest request, PrintWriter out, FileWriter fout) // Inserisce nel nodo il valore corretto
throws IOException
{
boolean b = false;
String nome = n.getNodeName().toString();
String[] paramValues = request.getParameterValues(nome);
if (paramValues != null)
{
if (paramValues.length == 1)
{
StringparamValue = paramValues[0];
fout.write(paramValue);
b = true;
}
}
return (b);
}
}
[/nobr]
I'm a novice... do you need some other files?
this my web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>fileUpload</servlet-name>
<servlet-class>fileUpload</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>fileUpload</servlet-name>
<url-pattern>/servlet/fileUpload</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>recManServ</servlet-name>
<servlet-class>recManServ</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>recManServ</servlet-name>
<url-pattern>/servlet/recManServ</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ShowParameters</servlet-name>
<servlet-class>ShowParameters</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ShowParameters</servlet-name>
<url-pattern>/servlet/ShowParameters</url-pattern>
</servlet-mapping>
</web-app>
ah... I've just installed tomcat on my new pc and it gives the same error... so now I can't run it on WIndows :-/
note: the web app works.. it fails when i use recMan class (through recManServ called by my index.jsp)... so I can't load forms with a database with 1 or more elements... but some of them loads... but they didn't show any element at all (only the total records number)...
some news... I've found the source of the error,
this line in my index.jsp:
<jsp:include page='<%= "database/"+dbn+"/db_rec.xml" %>' />
if the file exists I get the error...
I've used another include just before this one:
<jsp:include page='<%= "database/"+dbn+"/htmlform.jsp" %>' />
this works, but the second one (mentioned before) give this error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.IllegalStateException
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:62)
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:783)
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:348)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:307)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.
Apache Tomcat/5.5.12