You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Jeff Ling <je...@hotmail.com> on 2002/04/05 04:40:14 UTC

JSTL & Struts

Hi,

I am using struts with JSTL. In one place I write something like this:

<c:import value="mytestprogram.do"/>

It throws an JSP exception at runtime.

Is this because struts will forward to the actual page when it sees *.do? Is
there any workaround?

Thanks,
Jeff

----- Original Message -----
From: "John Baker" <jb...@teamenergy.com>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Sent: Friday, March 15, 2002 9:28 AM
Subject: <c:if


> Does <c:if support else?
>
> ie if (x) something(); else somethingElse(); or do I have to use c:choose?
>
>
> --
> John Baker, BSc CS.
> Java Developer, TEAM/Slb. http://www.teamenergy.com
> Views expressed in this mail are my own.
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL & Struts

Posted by Jeff Ling <je...@hotmail.com>.
Hi Dave,

Thanks for the response. Here is exception:

2002-04-05 16:57:09 StandardWrapperValve[jsp]: Servlet.service() for servlet
jsp threw exception
java.lang.IllegalStateException: Cannot forward after response has been
committed
 at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:367)
 at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:355)
 at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja
va:1759)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1596)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:683)
 at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:574)
 at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:497)
 at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
18)
 at org.apache.jsp.test$jsp._jspService(test$jsp.java:967)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:202)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
 at com.itan.webcommon.filter.I18nFilter.doFilter(Unknown Source)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:213)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
 at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1012)
 at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107
)
 at java.lang.Thread.run(Thread.java:536)



----- Original Message -----
From: "David M. Karr" <dm...@earthlink.net>
To: <ta...@jakarta.apache.org>
Sent: Thursday, April 04, 2002 10:26 PM
Subject: Re: JSTL & Struts


> >>>>> "Jeff" == Jeff Ling <je...@hotmail.com> writes:
>
>     Jeff> Hi,
>     Jeff> I am using struts with JSTL. In one place I write something like
this:
>
>     Jeff> <c:import value="mytestprogram.do"/>
>
>     Jeff> It throws an JSP exception at runtime.
>
>     Jeff> Is this because struts will forward to the actual page when it
sees *.do? Is
>     Jeff> there any workaround?
>
> In general, it's kind of hard to help someone if they say something
breaks, but
> they don't say clearly what happened.  In particular, if you get an
exception,
> listing the first few lines of the stack trace, including the initial
message,
> could be very important.  Although, if the exception has a "root cause"
(often
> further down in the printout), that's often more important than the top
> exception.
>
> Despite that, as a weak guess, you might try:
>
>   <c:import value="/mytestprogram.do"/>
>
> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> dmkarr@earthlink.net
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL & Struts

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Jeff" == Jeff Ling <je...@hotmail.com> writes:

    Jeff> Hi,
    Jeff> I am using struts with JSTL. In one place I write something like this:

    Jeff> <c:import value="mytestprogram.do"/>

    Jeff> It throws an JSP exception at runtime.

    Jeff> Is this because struts will forward to the actual page when it sees *.do? Is
    Jeff> there any workaround?

In general, it's kind of hard to help someone if they say something breaks, but
they don't say clearly what happened.  In particular, if you get an exception,
listing the first few lines of the stack trace, including the initial message,
could be very important.  Although, if the exception has a "root cause" (often
further down in the printout), that's often more important than the top
exception.

Despite that, as a weak guess, you might try:

  <c:import value="/mytestprogram.do"/>

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL & Struts

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Jeff" == Jeff Ling <je...@hotmail.com> writes:

    Jeff> Hi,
    Jeff> I am using struts with JSTL. In one place I write something like this:

    Jeff> <c:import value="mytestprogram.do"/>

    Jeff> It throws an JSP exception at runtime.

    Jeff> Is this because struts will forward to the actual page when it sees *.do? Is
    Jeff> there any workaround?

I'm not sure anymore whether this can work, but I have one question.  In the
action that processes the "/mytestprogram" action, when it finally selects an
ActionForward to forward to, is the "redirect" flag on that ActionForward set
to "true" (this is set in the "<forward>" element in your "struts-config.xml"
file)?  I would think this would only have a chance to work if "redirect" was
"false" on that element.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>