Hi Jim,

At a guess it's probably because you named your String variable "page"; the
implicit object that represents the instance of your page.  Try another name ...

Regards,

Stephen

Jim Huffsmith wrote:
>
> Hi, all
>
> I'm getting an error with jsp:include if I set the page equal to an
> expression. Does anybody have a suggestion? It works fine if I hard-code the
> page name. My code:
>
> <%! String str = "test";
>         String page = "t1.jsp";
> %>
> <jsp:include page="<%= page %>" flush="true">
>         <jsp:param name="paramA" value="<%= str %>" />
> </jsp:include>
>
> Error message:
>
> java.lang.IllegalStateException: Response has already been committed
>         at
> org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletRespon
> seFacade.java:157)
>         at
> org.apache.tomcat.servlets.DefaultServlet.serveFile(DefaultServlet.java:325)
>         at
> org.apache.tomcat.servlets.DefaultServlet.doGet(DefaultServlet.java:218)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> Compiled Code)
>         at
> org.apache.tomcat.core.RequestDispatcherImpl.include(RequestDispatcherImpl.j
> ava:262)
>         at
> org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:350)
>         at
> jsppoc.jsp.cgi_0002dbin._0002fjsppoc_0002fjsp_0002fcgi_0002dbin_0002ft_0002e
> jspt_jsp_40._jspService(_0002fjsppoc_0002fjsp_0002fcgi_0002dbin_0002ft_0002e
> jspt_jsp_40.java:69)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:174)
>         at
> org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
>         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
> Compiled Code)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> Compiled Code)
>         at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
>         at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java, Compiled Code)
>         at
> org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
> Compiled Code)
>         at java.lang.Thread.run(Thread.java:479)
>
> Any ideas?
>
> Jim
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

--
._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
 Stephen Redmond                        Logica (Mobile Networks)
 Tel:   +353-1-8193673                  5 Custom House Plaza,
 Fax:   +353-1-8193401                  Harbourmaster Place,
 mailto:[EMAIL PROTECTED]             Dublin 1,
 http://www.logica.com/telecoms         Ireland.
._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to