Re: How can I combine a result (tiles + xslt)?

2008-03-13 Thread Antonio Petrelli
2008/3/12, Griffith, Michael * [EMAIL PROTECTED]:

 if( getFlush() ){
 LOG.debug(Flushing output stream);
 out.close(); // ...and flush...
 }



Yup you're right! Please open a JIRA issue:
https://issues.apache.org/struts/browse/WW
In fact the code in the trunk does not verify if flush flag is on, and
this code is a bit obscure to me:
http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
Why does it take *twice* the response's writer, and closes and flushes it?
If you can, please post a patch to the issue that you will create.

Ciao
Antonio


Re: How can I combine a result (tiles + xslt)?

2008-03-13 Thread Antonio Petrelli
2008/3/13, Antonio Petrelli [EMAIL PROTECTED]:

 2008/3/12, Griffith, Michael * [EMAIL PROTECTED]:
 
  if( getFlush() ){
  LOG.debug(Flushing output stream);
  out.close(); // ...and flush...
  }



 Yup you're right! Please open a JIRA issue:
 https://issues.apache.org/struts/browse/WW



There's no need for it, Micheal. Martin Gainty already opened it:
https://issues.apache.org/struts/browse/WW-2551

Antonio


RE: How can I combine a result (tiles + xslt)?

2008-03-12 Thread Griffith, Michael *
Antonio, 

First of all, I'm not saying you are wrong about XSLT closing the result
stream -- I don't have enough knowledge to comment on that problem,
however...

Here's what I did to test this.  I copied the source for XSLTResult to a
new class, and added a boolean parameter to the result called flush.  In
my struts.xml file, I set the parameter to false (or let it default) and
put an if statement around the out.close() method in XSLTResult.execute,
line 357.
So the code looks like this:

if( getFlush() ){
LOG.debug(Flushing output stream);
out.close(); // ...and flush...
}

Sure enough, if the flag is true, the stream is closed and the exception
occurs. If the flag is false, and the close() gets stepped over, the
stream is left open and the remainder of the tiles render.

The XSLTResult class isn't really well structured to act as a
superclass, so unfortunately, in order to get this to work I have to
copy the class to a new class and add this implementation.  

I would argue this is a bug in XSLTResult.

Thanks for your comments and support.

MG

-Original Message-
From: Antonio Petrelli [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 11, 2008 8:31 AM
To: Struts Users Mailing List
Subject: Re: How can I combine a result (tiles + xslt)?

2008/3/11, Griffith, Michael * [EMAIL PROTECTED]:

 Would you then agree this is a bug or enhancement that could be made
to
 the XSLTResult? Maybe a flush parameter could be added to the
 configuration of the result?


I don't think it is a bug of XSLTResult, since it closes (not simply
flushes) the stream. The fact that the parser closes the stream is in
the
XML specification (yeah, this is *stupid* but they did it).
Anyway probably XSLTResult needs a workaround for this
sarcasmfeature/sarcasm since we cannot change the specifications.

Antonio

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



Re: How can I combine a result (tiles + xslt)?

2008-03-11 Thread Antonio Petrelli
2008/3/10, Griffith, Michael * [EMAIL PROTECTED]:

 I believe (maybe incorrectly so) that the problem is caused by the
 XSLTResult calling close/flush when processing the result.



Mmm... It reminds me a thing.
When processing an XML file via a XML parser, the parser closes the stream
at the end!
To work around this problem, I had to wrap the original InputStream into an
object that overrides the close method, not closing the stream.

Antonio


RE: How can I combine a result (tiles + xslt)?

2008-03-11 Thread Griffith, Michael *
Antonio, 

Would you then agree this is a bug or enhancement that could be made to
the XSLTResult? Maybe a flush parameter could be added to the
configuration of the result?

MG

-Original Message-
From: Antonio Petrelli [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 11, 2008 2:25 AM
To: Struts Users Mailing List
Subject: Re: How can I combine a result (tiles + xslt)?

2008/3/10, Griffith, Michael * [EMAIL PROTECTED]:

 I believe (maybe incorrectly so) that the problem is caused by the
 XSLTResult calling close/flush when processing the result.



Mmm... It reminds me a thing.
When processing an XML file via a XML parser, the parser closes the
stream
at the end!
To work around this problem, I had to wrap the original InputStream into
an
object that overrides the close method, not closing the stream.

Antonio

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



Re: How can I combine a result (tiles + xslt)?

2008-03-11 Thread Antonio Petrelli
2008/3/11, Griffith, Michael * [EMAIL PROTECTED]:

 Would you then agree this is a bug or enhancement that could be made to
 the XSLTResult? Maybe a flush parameter could be added to the
 configuration of the result?


I don't think it is a bug of XSLTResult, since it closes (not simply
flushes) the stream. The fact that the parser closes the stream is in the
XML specification (yeah, this is *stupid* but they did it).
Anyway probably XSLTResult needs a workaround for this
sarcasmfeature/sarcasm since we cannot change the specifications.

Antonio


RE: How can I combine a result (tiles + xslt)?

2008-03-10 Thread Griffith, Michael *
Hi all, 

I checked out the current branch from the Tiles SVN repository:
http://svn.apache.org/repos/asf/tiles/framework/trunk/ and built it.
Version is 2.1.0-SNAPSHOT.  This appears to be incompatible with the
Struts2Tiles plugin?  Has anyone run into this?  The error is:
Exception sending context initialized event to listener instance of
class org.apache.struts2.tiles.StrutsTilesListener
java.lang.IllegalStateException: RendererFactory not specified

I tried adding additional Tiles configuration information as specified
at: http://struts.apache.org/2.x/docs/tiles-plugin.html and
http://tiles.apache.org/tutorial/configuration.html using the
context-param and listener, but with the same error. This exception is
not thrown with Tiles 2.0.5.

I did not see a tag for tiles 2.0.6 in the SVN tree, where can I get the
tiles-2.0.6-snapshot?

Any help would be appreciated!

MG

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

Dave, 

I did. I will try both, easy path first. I'll let you know what I find
so that you can close the JIRA incident I opened. I did look at the JIRA
ticket Antonio posted, and it seems likely that is the problem.

Thanks to all that replied, especially all the extra effort that Martin
went to.

Cheers!
MG

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 07, 2008 12:45 PM
To: Struts Users Mailing List
Subject: Re: How can I combine a result (tiles + xslt)?

Did you see Antonio's post about how it's probably a bug in Tiles?!

Seems like it would be quite a bit easier to try his idea than all this.

--- Martin Gainty [EMAIL PROTECTED] wrote:

 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.AnnotationValidationIntercept
or: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
 titleThis is done.jsp/title
 /head
 body
 pThis 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

Re: How can I combine a result (tiles + xslt)?

2008-03-10 Thread Antonio Petrelli
2008/3/10, Griffith, Michael * [EMAIL PROTECTED]:
  I checked out the current branch from the Tiles SVN repository:
  http://svn.apache.org/repos/asf/tiles/framework/trunk/ and built it.
  Version is 2.1.0-SNAPSHOT.  This appears to be incompatible with the
  Struts2Tiles plugin?

It is incompatible at the moment. Use the TILES_2_0_X instead.

Antonio

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



RE: How can I combine a result (tiles + xslt)?

2008-03-10 Thread Griffith, Michael *
Antonio, 

Thanks for your help. For some reason, it didn't register to me that the
TILES_2_0_X branch would be the 2.0.6 branch... duh.

I downloaded the Tiles 2.0.X source and built the 2.0.6 snapshot. 
It did not fix the IO Stream error previously reported, so I am unsure
if the issue is related. 

I believe (maybe incorrectly so) that the problem is caused by the
XSLTResult calling close/flush when processing the result.  
https://issues.apache.org/struts/browse/WW-2538

MG


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

Dave, 

I did. I will try both, easy path first. I'll let you know what I find
so that you can close the JIRA incident I opened. I did look at the JIRA
ticket Antonio posted, and it seems likely that is the problem.

Thanks to all that replied, especially all the extra effort that Martin
went to.

Cheers!
MG

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 07, 2008 12:45 PM
To: Struts Users Mailing List
Subject: Re: How can I combine a result (tiles + xslt)?

Did you see Antonio's post about how it's probably a bug in Tiles?!

Seems like it would be quite a bit easier to try his idea than all this.

--- Martin Gainty [EMAIL PROTECTED] wrote:

 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.AnnotationValidationIntercept
or: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
 titleThis is done.jsp/title
 /head
 body
 pThis 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

Re: How can I combine a result (tiles + xslt)?

2008-03-07 Thread Antonio Petrelli
2008/3/6, Griffith, Michael * [EMAIL PROTECTED]:

 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.



Version of Struts 2 and Tiles?

Antonio


Re: How can I combine a result (tiles + xslt)?

2008-03-07 Thread Martin Gainty
Good Morning Michael

This is a bug.. do you want to update JIRA?

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

RE: How can I combine a result (tiles + xslt)?

2008-03-07 Thread Griffith, Michael *
Struts 2.0.11.1
Tiles 2.0.5

-Original Message-
From: Antonio Petrelli [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 07, 2008 2:20 AM
To: Struts Users Mailing List
Subject: Re: How can I combine a result (tiles + xslt)?

2008/3/6, Griffith, Michael * [EMAIL PROTECTED]:

 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.



Version of Struts 2 and Tiles?

Antonio

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



RE: How can I combine a result (tiles + xslt)?

2008-03-07 Thread Griffith, Michael *
I'd be happy to do more than that; I'll fix the bug if someone can give
me some design direction.

MG

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

Good Morning Michael

This is a bug.. do you want to update JIRA?

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

Re: How can I combine a result (tiles + xslt)?

2008-03-07 Thread Antonio Petrelli
2008/3/7, Griffith, Michael * [EMAIL PROTECTED]:

 Struts 2.0.11.1
 Tiles 2.0.5



I think that this is a bug with Tiles 2.0.5:
https://issues.apache.org/struts/browse/TILES-232
It is fixed, so if you build Tiles 2.0.6-SNAPSHOT by yourself it should go
away.
For further questions on Tiles please ask the Tiles Users mailing list:
http://tiles.apache.org/mail.html
(Notice that your particular question is OK to stay here in Struts, since it
was a problem with Struts+Tiles).

Antonio


Re: How can I combine a result (tiles + xslt)?

2008-03-07 Thread Martin Gainty
=${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

Re: How can I combine a result (tiles + xslt)?

2008-03-07 Thread Dave Newton
Did you see Antonio's post about how it's probably a bug in Tiles?!

Seems like it would be quite a bit easier to try his idea than all this.

--- Martin Gainty [EMAIL PROTECTED] wrote:

 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
 titleThis is done.jsp/title
 /head
 body
 pThis 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
 
   !-- 

RE: How can I combine a result (tiles + xslt)?

2008-03-07 Thread Griffith, Michael *
Dave, 

I did. I will try both, easy path first. I'll let you know what I find
so that you can close the JIRA incident I opened. I did look at the JIRA
ticket Antonio posted, and it seems likely that is the problem.

Thanks to all that replied, especially all the extra effort that Martin
went to.

Cheers!
MG

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 07, 2008 12:45 PM
To: Struts Users Mailing List
Subject: Re: How can I combine a result (tiles + xslt)?

Did you see Antonio's post about how it's probably a bug in Tiles?!

Seems like it would be quite a bit easier to try his idea than all this.

--- Martin Gainty [EMAIL PROTECTED] wrote:

 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.AnnotationValidationIntercept
or: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
 titleThis is done.jsp/title
 /head
 body
 pThis 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

RE: How can I combine a result (tiles + xslt)?

2008-03-06 Thread Griffith, Michael *
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]



Re: How can I combine a result (tiles + xslt)?

2008-03-06 Thread Martin Gainty
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]



Re: How can I combine a result (tiles + xslt)?

2008-03-06 Thread Othon Reyes Sanchez
Wow the ability of S2 to do this is awesome and looks simple!!.

On Thu, Mar 6, 2008 at 9:50 AM, Martin Gainty [EMAIL PROTECTED] wrote:

 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]




RE: How can I combine a result (tiles + xslt)?

2008-03-06 Thread Griffith, Michael *
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

RE: How can I combine a result (tiles + xslt)?

2008-03-06 Thread Griffith, Michael *
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

RE: How can I combine a result (tiles + xslt)?

2008-03-06 Thread Griffith, Michael *
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

How can I combine a result (tiles + xslt)?

2008-03-05 Thread Griffith, Michael *
Hi, 

 

Can anyone advise me on the best way to approach this problem?  I have a
Struts2 application using Tiles 2 for UI.  I have a page where the body
of my tiles composition needs to be generated dynamically from XSLT.  I
want to transform XML into HTML tags including a form and inputs, which
would be dynamically generated from my action class.

 

I checked out the XSLT result type, but if I go that route, it appears I
can't use a tiles definition. What I am looking for is something like 

-- tile ---

| x

| x

| tile

| xhtml generated   x

|  from XSLT  x

| x

| x

-- tile ---

 

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

 

Any help would be much appreciated.

MG



Re: How can I combine a result (tiles + xslt)?

2008-03-05 Thread Wes Wannemacher

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