Good Afternoon Michael

I just ran thru the scenario you described on a 'healthy' jsp page and see
this debug output:
03-07 12:58:52,718 DEBUG
(org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor:1
34) - Validating /tags/non-ui/actionTag/form with method execute.
2000-03-07 12:58:52,734 DEBUG
(org.apache.struts2.dispatcher.ServletDispatcherResult:113) - Forwarding to
location /tags/non-ui/iteratorTag/done.jsp
[GC [DefNew: 3968K->0K(4032K), 0.0108816 secs] 49623K->47040K(68568K),
0.0109704 secs]
[GC [DefNew: 3968K->0K(4032K), 0.0168407 secs] 51008K->48964K(68568K),
0.0169301 secs]
2000-03-07 12:58:52,906 DEBUG (org.apache.struts2.components.UIBean:526) -
Rendering template /template/xhtml/a
2000-03-07 12:58:52,921 DEBUG
(org.apache.struts2.components.template.FreemarkerTemplateEngine:135) -
Rendering template /template/simple/a.ftl
[GC [DefNew: 3968K->0K(4032K), 0.0051196 secs] 52932K->49117K(68568K),
0.0052029 secs]
2000-03-07 12:58:52,937 DEBUG (org.apache.struts2.components.UIBean:526) -
Rendering template /template/xhtml/a-close
2000-03-07 12:58:52,953 DEBUG
(org.apache.struts2.components.template.FreemarkerTemplateEngine:135) -
Rendering template /template/simple/a-close.ftl
2000-03-07 12:58:52,953 DEBUG
(org.apache.struts2.dispatcher.ActionContextCleanUp:122) - skipping cleanup
counter=1
[GC [DefNew: 3966K->0K(4032K), 0.0038605 secs] 53083K->49280K(68568K),
0.0039430 secs]
[GC [DefNew: 3968K->0K(4032K), 0.0232088 secs] 53248K->52251K(68568K),
0.0232965 secs]
[GC [1 CMS-initial-mark: 52251K(64536K)] 52251K(68568K), 0.0012270 secs]
[CMS-concurrent-mark: 0.361/0.361 secs]

to repeat the scenario-
deploy struts2-showcase-2.0.11 to TC (its a monster so this will take a
while..)
vi /tags/non-ui/actionTag/showActionTagDemo.jsp
add these lines to showActionTagDemo.jsp

<!-- This is a quick test for Michael to see if flush="false" causes close
of socket -->
<div style="margin: 5px; margin: 5px; border: solid 1px; ">
<tiles:insertAttribute name="body" flush="false"/>
<s:action name="form" executeResult="true" flush="false"
ignoreContextParams="true"/>
</div>
<!-- end quick test for Michael-->

add these configuration lines to /WEB-INF/classes/struts-tags-non-ui.xml to
configure in a 'healthy' action class and a result
         <action name="form" class="tmjee.testing.ActionTagAction">
          <result name="done">/tags/non-ui/iteratorTag/done.jsp</result>
         </action>

insert the following jsp to /tags/non-ui/iteratorTag/date.jsp
<[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>This is done.jsp</title>
</head>
<body>
<p>This is done.jsp</p>
</body>
</html>

in a scratch folder create the necessary ActionTagDemo folder
use the following build.xml for building with
ant compile

<?xml version="1.0"?>
<project name="struts2-core" default="default">

  <!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
  <!--                   directories                     -->
  <!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
  <property name="src.dir" value="src/core/src/main/java"/>
  <property name="build.dir" value="build"/>
  <property name="build.classes.dir" value="${build.dir}/classes"/>
  <property name="dist.dir" value="dist"/>
  <property name="lib.dir" value="F:\struts\struts-2.0.11\lib"/>

  <!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
  <!--                    paths                          -->
  <!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
  <path id="compile.classpath">
    <pathelement
location="/struts/struts-2.0.11/lib/struts2-core-2.0.11.jar"/>
    <pathelement location="/struts/struts-2.0.11/lib/xwork-2.0.4.jar"/>
    <pathelement location="${build.classes.dir}"/>
    <pathelement location="/xwork/xwork-2.0.4/build/classes"/>
    <pathelement location="/struts/struts-2.0.11/src/core/src/main/java"/>
    <pathelement location="/APT"/>
    <pathelement location="/dwr"/>
    <pathelement
location=":/SPRING/spring-framework-2.0.6/target/mock-classes"/>
    <pathelement location="/commons-fileupload/commons-fileupload-1.1.1"/>
    <pathelement location="/Velocity/classes"/>
    <pathelement location="/JSF-Portlet/jsf-portlet/WEB-INF/classes" />
    <pathelement location="/testng/testng-5.7/build/jdk15"/>
    <pathelement location="/Junit/junit3.8.1/junit.jar"/>
    <!-- pathelement
location="/struts/struts2-showcase-2.0.11/apps/struts2-showcase-2.11/WEB-INF
/lib/struts-core-2.0.5.jar"/ -->
    <!-- pathelement
location="/struts/struts-2.0.11/lib/struts2-tiles-plugin-2.0.11.jar"/ -->
    <pathelement location="/J2EE142/lib/j2ee.jar"/>
    <pathelement location="/Log4J/LOGGIN~1.10/dist/lib/log4j-1.2.10.jar"/>
    <pathelement
location="/SPRING/SPRING~1.5/SPRING~1.5-W/SPRING~1.5/dist/spring.jar"/>
    <fileset dir="${lib.dir}">
      <!-- include name="**/*.jar" / -->
    </fileset>
  </path>

  <!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
  <!--                  targets                          -->
  <!-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -->
  <target name="default"
          depends="dist"
          description="default: build everything"
  />

  <target name="clean" description="remove all built files">
    <delete dir="${build.dir}" />
    <delete dir="${dist.dir}" />
  </target>

  <target name="dist"
          depends="compile"
          description="create distributables (jars etc)">
    <mkdir dir="${dist.dir}" />
    <jar jarfile="${dist.dir}/struts2-core.jar">
      <fileset dir="${build.classes.dir}"/>
    </jar>
  </target>
  <target name="compile" description="compile java">
    <mkdir dir="classes" />
    <javac srcdir="${build.dir}/struts/struts-2.0.11/ActionTagAction"
           destdir="classes"
           classpathref="compile.classpath"
           debug="on"
           deprecation="on"/>
  </target>
</project>

then edit in the following Action java file
/tmjee/testing/ActionTagAction.java

package tmjee.testing;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;
import java.lang.*;
public class ActionTagAction extends ActionSupport
{
 public String execute() throws Exception {
     return "done";
 }
 public String doDefault() throws Exception {
     ServletActionContext.getRequest().setAttribute("stringByAction", "This
is a String put in by the action's doDefault()");
     return "done";
 }
}

ant compile
copy the compiled classes to Tomcat struts2-showcase-2.0.11
copy /tmjee/testing*.class
$TOMCAT_HOME/webapps/struts2-showcase-2.0.11/WEB-INF/classes/tmjee/testing

go to TC Manager
reload the web application so TC container will re-read the configuration
for struts2-showcase-2.0.11
http://localhost:8080/manager/html/reload?path=/struts2-showcase-2.0.11

now reference the affected jsp
http://localhost:8080/struts2-showcase-2.0.11/tags/non-ui/actionTag/showActi
onTagDemo.action

please verify that you see

This is done.jsp

at the bottom of page

Caveat: This is a base test to see if
<tiles:insertAttribute name="body" flush="false"/>
<s:action name="form" executeResult="true" flush="false"
ignoreContextParams="true"/>
to determine if tiles:insertAttribute and s:action work without closing the
socket streams..

I did'nt test out different freemarker templates or combinations
If possible could you provide any or details for
The action class you are implementing
The full jsp you are using for view
*Any/all* freemarker templates (*.ftl) you are implementing
configuration files
(web.xml,struts.xml,struts-validation.xml,struts-tags-non-ui.xml...)

Thanks
Martin-
----- Original Message -----
From: "Griffith, Michael *" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Thursday, March 06, 2008 4:07 PM
Subject: RE: How can I combine a result (tiles + xslt)?


Hi all,

I've specified on both the struts tag, and the tiles include
flush="false"

.. template ...
<tiles:insertAttribute name="body" flush="false"/>

. tile ...
<s:action name="form" executeResult="true" flush="false"
ignoreContextParams="true"/>

Same result. Does anyone have any other ideas on what I can do to
prevent this? Any tile that is supposed to be rendered after the body
(ie the footer) is not rendered because the stream is closed.

Any help would be much appreciated...

MG

-----Original Message-----
From: Griffith, Michael * [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2008 1:52 PM
To: Struts Users Mailing List
Subject: RE: How can I combine a result (tiles + xslt)?

Could this be a defect?
https://issues.apache.org/struts/browse/WW-1385

-----Original Message-----
From: Griffith, Michael * [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2008 1:25 PM
To: Martin Gainty
Cc: Struts Users Mailing List
Subject: RE: How can I combine a result (tiles + xslt)?

Hmmm... while this approach displays the page OK, I get the error below
in my JBoss console when executing the action.  Is this something I need
to prevent with some sort of page directive?


2008-03-06 13:14:11,470 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/DataCa
ll].[jsp]] Servlet.service() for servlet jsp threw exception
java.io.IOException: Stream closed
        at
org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:20
4)
        at
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:1
15)
        at
org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:1
86)
        at
org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspF
actoryImpl.java:117)
        at
org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryIm
pl.java:76)
        at
org.apache.jsp.fragments.root_jsp._jspService(root_jsp.java:106)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:373)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
her.java:654)
        at
org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicatio
nDispatcher.java:445)
        at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp
atcher.java:379)
        at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat
cher.java:292)
        at
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(Serv
letTilesRequestContext.java:198)
        at
org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(Ser
vletTilesRequestContext.java:185)
        at
org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesReques
tContextWrapper.java:72)
        at
org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesR
equestContext.java:86)
        at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav
a:419)
        at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav
a:370)
        at
org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:10
4)
        at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSu
pport.java:178)
        at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct
ionInvocation.java:348)

-----Original Message-----
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2008 9:51 AM
To: Griffith, Michael *
Cc: Struts Users Mailing List
Subject: Re: How can I combine a result (tiles + xslt)?

Michael-

remembering our academic coursework teaches Not(Not condition) evaluates
positive
be sure to set ignoreContextParams="false" as in <s:action tag
ignoreContextParams="false"  ...>

I would encourage you to read Dave's article on using ResultTypes at
http://struts.apache.org/2.x/docs/result-types.html

MG
----- Original Message -----
From: "Griffith, Michael *" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Thursday, March 06, 2008 10:16 AM
Subject: RE: How can I combine a result (tiles + xslt)?


Hi Wes,

Thanks for the reply. The s:action tag seems to work.  I have a tiles
action that is the actual URL that the user would navigate to, and in
the JSP fragment that is the body tile, I am using the s:action to
invoke the XSLT action and return the HTML fragment for the body.

Thanks so much for pointing this out, I was not aware of this tag.

Cheers!
MG

-----Original Message-----
From: Wes Wannemacher [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2008 4:49 PM
To: Struts Users Mailing List
Subject: Re: How can I combine a result (tiles + xslt)?


On Wed, 2008-03-05 at 17:18 -0500, Griffith, Michael * wrote:
[snip]

>
>
> Is this a good application for writing my own interceptor for?


You would want to write your own "Result Type" for this. Writing your
own results is not as well documented as writing your own interceptors,
but since you are combining the functionality of two built-in result
types, it may be "pretty simple."

Another possible choice would be to use the s:action tag with
executeResult set to true...
http://struts.apache.org/2.x/docs/action.html
Then, have one action that uses a tiles result, but in that result, have
the s:action call the action which will render the xslt result.

-Wes

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to