You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by cpanon <cp...@yahoo.com> on 2011/05/02 01:31:27 UTC
Tomcat 6 Struts 1.3
Hello
I have an odd but systemic problem with an otherwise working implementation. I
am unable to get any technique to dynamically recalculate a page from an
action. I have tried the following
1. Defined a frameset with the "top" frame specified in realtime with jstl. It
works the first time, there after even though I am positive I ave set the
elements in my form bean for the new jsp, it fails to recalculate and show the
different jsp. The second time is, of course the exact same approach that works
the first time, nothing changes and neither does the inclusion of the new jsp
the second time.
2. Tiles. Defined a template, this time without a frameset, very standard
header, body, footer. Defined tiles-defs.xml to extend the template and just
change the put for the body. Again it does not recalculate, reprocess the
page. How can this be. I am successfully forwarding the first time to a
definition in the tiles-defs. The second time I am also doing the same,
forwarding to a definition in tiles-defs and it does not work;I see the old
previous result.
3. jsp:include. Define another template that simulates the Tiles approach but
rather than named areas more primitively makes three rows in a table and uses
jstl to pick off the correct jsp for that section. Again it fails after the
first time. Even thought I specify a different name for the body, set it in the
form bean, specify it as jsp:include page=${sessionScope.formBean.bodyName}, it
does not work, after the first time. Of course even when I first remove the
formbean and populate it and add it to the session.
How can I be having this systemic problem not alleviated by any of the different
designs? Any one of these should have worked. To have all of them fail has
cost me many days and worse. Any help appreciated.
Re: Tomcat 6 Struts 1.3
Posted by cpanon <cp...@yahoo.com>.
Hi Martin
What is so odd is it is all loading just fine as witnessed by the fact that the
default case works. Either the frameset way, the tiles way or the most
primitive jsp:include, all show the default client view, cache the applet and
work quite well. The problem is when I want to change the client view remove
the form bean, make the change for the jsp desired, add the form bean to the
session and forward, it fails.
________________________________
From: Martin Gainty <mg...@hotmail.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Wed, May 4, 2011 8:38:36 PM
Subject: RE: Tomcat 6 Struts 1.3
tiles-defs.xml is loaded by struts-config.xml
struts-config.xml is loaded by WEB-INF/web.xml
web.xml is loaded by the container at webapp initialisation
except when attribute reloadable=true for <Context
Set to true if you want Catalina to monitor classes in
/WEB-INF/classes/ and /WEB-INF/lib for
changes, and automatically reload the web application if a change
is detected. This feature is very useful during application
development, but it requires significant runtime overhead and is
not recommended for use on deployed production applications. That's
why the default setting for this attribute is false. You
can use the Manager web
application, however, to trigger reloads of deployed applications
on demand.
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung.
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est
interdite. Ce message sert à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> Date: Wed, 4 May 2011 11:47:57 -0700
> From: cpanon@yahoo.com
> Subject: Re: Tomcat 6 Struts 1.3
> To: users@tomcat.apache.org
>
> Hi Chris
> What I find so inscrutable is I know I am hitting the second state with the
> different jsp for the report tile. I know that b/c I have a breakpoint set on
> the return mapping.findForward("posSO"); What I expect is TC or Jasper to
> detect the tiles-defs is different than the one presenting to this session and
> process it with the current session attributes, render it and insert it into
>the
>
> page in the report tile. I have to do this b/c I need to keep my applet
>running
>
> and not shut down. It is something systemic for sure. I know tiles works for
> thousands of other developers. How can it work for me perfectly the first time
>
> and fail and successive time with a different state? Am I not correct in my
> expectation of Tiles processing and the fact that it works for others? Any
> further ideas?
>
>
>
>
>
> ________________________________
> From: Christopher Schultz <ch...@christopherschultz.net>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Tue, May 3, 2011 4:08:50 PM
> Subject: Re: Tomcat 6 Struts 1.3
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> cpanon,
>
> On 5/2/2011 4:04 PM, cpanon wrote:
> > Thank you for your attention.
>
> No problem.
>
> > What is odd and almost answers all the questions, leaving the BIG
> > one, is that all three techniques work the first time.
>
> Hah... that actually raises more questions than answers IMO.
>
> > That means that all the resolving, mapping and substitution work.
> > The proxy names are all resolved in the framset(not shown), tiles and
> > jsp:include. In the second state what I expected is the recompiling
> > of the ccAuth15_soDetail_fragment.jsp, caching the other areas and
> > presenting the different view to the client. By "nothing" I mean
> > that the original view is shown even thought I know, via setting a
> > breakpoint, I hit the second state but do now show the proper jsp.
>
> Why would the JSP be recompiled? You aren't changing the code, so it
> should just be re-running the already-compiled code. Maybe you're not
> explaining it well enough for me to understand.
>
> Are you sure you don't somehow hit the first state again somehow?
>
> > I have read this about the attribute "antiResourceLocking", however
> > that was in 5.5 and I assume it is fully fixed or know(no google cit
> > it), but 6.0.30. Does this help with any further ideas?
>
> anti resource locking has mostly do to with not performing file-locking
> on .jar files that your webapp uses. If you're having problems
> undeploying webapps where the files aren't being deleted, you may have
> to mess with this setting. It does not appear to be related to anything
> you are doing.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk3AYNIACgkQ9CaO5/Lv0PDeLQCdGpAQd4la81wZWYfqwDIG9qYB
> T5kAoLmk8CtM2sjdqwMhMBaymKUebjJu
> =Yqxy
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
RE: Tomcat 6 Struts 1.3
Posted by Martin Gainty <mg...@hotmail.com>.
tiles-defs.xml is loaded by struts-config.xml
struts-config.xml is loaded by WEB-INF/web.xml
web.xml is loaded by the container at webapp initialisation
except when attribute reloadable=true for <Context
Set to true if you want Catalina to monitor classes in
/WEB-INF/classes/ and /WEB-INF/lib for
changes, and automatically reload the web application if a change
is detected. This feature is very useful during application
development, but it requires significant runtime overhead and is
not recommended for use on deployed production applications. That's
why the default setting for this attribute is false. You
can use the Manager web
application, however, to trigger reloads of deployed applications
on demand.
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Wed, 4 May 2011 11:47:57 -0700
> From: cpanon@yahoo.com
> Subject: Re: Tomcat 6 Struts 1.3
> To: users@tomcat.apache.org
>
> Hi Chris
> What I find so inscrutable is I know I am hitting the second state with the
> different jsp for the report tile. I know that b/c I have a breakpoint set on
> the return mapping.findForward("posSO"); What I expect is TC or Jasper to
> detect the tiles-defs is different than the one presenting to this session and
> process it with the current session attributes, render it and insert it into the
> page in the report tile. I have to do this b/c I need to keep my applet running
> and not shut down. It is something systemic for sure. I know tiles works for
> thousands of other developers. How can it work for me perfectly the first time
> and fail and successive time with a different state? Am I not correct in my
> expectation of Tiles processing and the fact that it works for others? Any
> further ideas?
>
>
>
>
>
> ________________________________
> From: Christopher Schultz <ch...@christopherschultz.net>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Tue, May 3, 2011 4:08:50 PM
> Subject: Re: Tomcat 6 Struts 1.3
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> cpanon,
>
> On 5/2/2011 4:04 PM, cpanon wrote:
> > Thank you for your attention.
>
> No problem.
>
> > What is odd and almost answers all the questions, leaving the BIG
> > one, is that all three techniques work the first time.
>
> Hah... that actually raises more questions than answers IMO.
>
> > That means that all the resolving, mapping and substitution work.
> > The proxy names are all resolved in the framset(not shown), tiles and
> > jsp:include. In the second state what I expected is the recompiling
> > of the ccAuth15_soDetail_fragment.jsp, caching the other areas and
> > presenting the different view to the client. By "nothing" I mean
> > that the original view is shown even thought I know, via setting a
> > breakpoint, I hit the second state but do now show the proper jsp.
>
> Why would the JSP be recompiled? You aren't changing the code, so it
> should just be re-running the already-compiled code. Maybe you're not
> explaining it well enough for me to understand.
>
> Are you sure you don't somehow hit the first state again somehow?
>
> > I have read this about the attribute "antiResourceLocking", however
> > that was in 5.5 and I assume it is fully fixed or know(no google cit
> > it), but 6.0.30. Does this help with any further ideas?
>
> anti resource locking has mostly do to with not performing file-locking
> on .jar files that your webapp uses. If you're having problems
> undeploying webapps where the files aren't being deleted, you may have
> to mess with this setting. It does not appear to be related to anything
> you are doing.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk3AYNIACgkQ9CaO5/Lv0PDeLQCdGpAQd4la81wZWYfqwDIG9qYB
> T5kAoLmk8CtM2sjdqwMhMBaymKUebjJu
> =Yqxy
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6 Struts 1.3
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Cpanon,
On 5/4/2011 2:47 PM, cpanon wrote:
> What I find so inscrutable is I know I am hitting the second state with the
> different jsp for the report tile. I know that b/c I have a breakpoint set on
> the return mapping.findForward("posSO"); What I expect is TC or Jasper to
> detect the tiles-defs is different than the one presenting to this session and
> process it with the current session attributes, render it and insert it into the
> page in the report tile. I have to do this b/c I need to keep my applet running
> and not shut down. It is something systemic for sure. I know tiles works for
> thousands of other developers. How can it work for me perfectly the first time
> and fail and successive time with a different state? Am I not correct in my
> expectation of Tiles processing and the fact that it works for others? Any
> further ideas?
I think it might be time to switch-over to the Tiles mailing list. I
though you were having trouble with URLs not being resolved correctly
which Tomcat might have some control over. This seems to be squarely a
tiles issue.
Good luck,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk3CpV0ACgkQ9CaO5/Lv0PAMBQCgsGgM7NK5YUq0OGuSU+h/9eL2
jEUAn0dW9TkAgJ6ep6wSovyZB/g8mPKV
=fM/f
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6 Struts 1.3
Posted by cpanon <cp...@yahoo.com>.
Hi Chris
What I find so inscrutable is I know I am hitting the second state with the
different jsp for the report tile. I know that b/c I have a breakpoint set on
the return mapping.findForward("posSO"); What I expect is TC or Jasper to
detect the tiles-defs is different than the one presenting to this session and
process it with the current session attributes, render it and insert it into the
page in the report tile. I have to do this b/c I need to keep my applet running
and not shut down. It is something systemic for sure. I know tiles works for
thousands of other developers. How can it work for me perfectly the first time
and fail and successive time with a different state? Am I not correct in my
expectation of Tiles processing and the fact that it works for others? Any
further ideas?
________________________________
From: Christopher Schultz <ch...@christopherschultz.net>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Tue, May 3, 2011 4:08:50 PM
Subject: Re: Tomcat 6 Struts 1.3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
cpanon,
On 5/2/2011 4:04 PM, cpanon wrote:
> Thank you for your attention.
No problem.
> What is odd and almost answers all the questions, leaving the BIG
> one, is that all three techniques work the first time.
Hah... that actually raises more questions than answers IMO.
> That means that all the resolving, mapping and substitution work.
> The proxy names are all resolved in the framset(not shown), tiles and
> jsp:include. In the second state what I expected is the recompiling
> of the ccAuth15_soDetail_fragment.jsp, caching the other areas and
> presenting the different view to the client. By "nothing" I mean
> that the original view is shown even thought I know, via setting a
> breakpoint, I hit the second state but do now show the proper jsp.
Why would the JSP be recompiled? You aren't changing the code, so it
should just be re-running the already-compiled code. Maybe you're not
explaining it well enough for me to understand.
Are you sure you don't somehow hit the first state again somehow?
> I have read this about the attribute "antiResourceLocking", however
> that was in 5.5 and I assume it is fully fixed or know(no google cit
> it), but 6.0.30. Does this help with any further ideas?
anti resource locking has mostly do to with not performing file-locking
on .jar files that your webapp uses. If you're having problems
undeploying webapps where the files aren't being deleted, you may have
to mess with this setting. It does not appear to be related to anything
you are doing.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk3AYNIACgkQ9CaO5/Lv0PDeLQCdGpAQd4la81wZWYfqwDIG9qYB
T5kAoLmk8CtM2sjdqwMhMBaymKUebjJu
=Yqxy
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6 Struts 1.3
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
cpanon,
On 5/2/2011 4:04 PM, cpanon wrote:
> Thank you for your attention.
No problem.
> What is odd and almost answers all the questions, leaving the BIG
> one, is that all three techniques work the first time.
Hah... that actually raises more questions than answers IMO.
> That means that all the resolving, mapping and substitution work.
> The proxy names are all resolved in the framset(not shown), tiles and
> jsp:include. In the second state what I expected is the recompiling
> of the ccAuth15_soDetail_fragment.jsp, caching the other areas and
> presenting the different view to the client. By "nothing" I mean
> that the original view is shown even thought I know, via setting a
> breakpoint, I hit the second state but do now show the proper jsp.
Why would the JSP be recompiled? You aren't changing the code, so it
should just be re-running the already-compiled code. Maybe you're not
explaining it well enough for me to understand.
Are you sure you don't somehow hit the first state again somehow?
> I have read this about the attribute "antiResourceLocking", however
> that was in 5.5 and I assume it is fully fixed or know(no google cit
> it), but 6.0.30. Does this help with any further ideas?
anti resource locking has mostly do to with not performing file-locking
on .jar files that your webapp uses. If you're having problems
undeploying webapps where the files aren't being deleted, you may have
to mess with this setting. It does not appear to be related to anything
you are doing.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk3AYNIACgkQ9CaO5/Lv0PDeLQCdGpAQd4la81wZWYfqwDIG9qYB
T5kAoLmk8CtM2sjdqwMhMBaymKUebjJu
=Yqxy
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6 Struts 1.3
Posted by cpanon <cp...@yahoo.com>.
Hi Chris
Thank you for your attention. What is odd and almost answers all the questions,
leaving the BIG one, is that all three techniques work the first time. That
means that all the resolving, mapping and substitution work. The proxy names
are all resolved in the framset(not shown), tiles and jsp:include. In the
second state what I expected is the recompiling of the
ccAuth15_soDetail_fragment.jsp, caching the other areas and presenting the
different view to the client. By "nothing" I mean that the original view is
shown even thought I know, via setting a breakpoint, I hit the second state but
do now show the proper jsp.
I have read this about the attribute "antiResourceLocking", however that was in
5.5 and I assume it is fully fixed or know(no google cit it), but 6.0.30. Does
this help with any further ideas?
________________________________
From: Christopher Schultz <ch...@christopherschultz.net>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Mon, May 2, 2011 12:44:10 PM
Subject: Re: Tomcat 6 Struts 1.3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
cpanon,
On 5/2/2011 12:20 PM, cpanon wrote:
> It still seems there is something stopping the jsp
> processing on TC, after the first time. Yes, I know how foolish that sounds,
> sorry nonplused at this moment.
I'm not even sure I understand what you mean. That's okay, let's take a
look at the code.
> if (desiredReport.equals("a")) {
> fb00.setFramesetPage("/ccAuth15_PO_all_fragment.jsp");
Okay. What is the "/" intended to be relative to? The webapp? The whole
server? More on this, later.
What does the "setFramesetPage" method actually set? I don't see
anything called "frameSet" in the configuration or anything like that.
> http://jakarta.apache.org/struts/dtds/tiles-config_1_3.dtd">
> <tiles-definitions>
> <definition name="defaultReport" path="/ccAuth15_template00.jsp">
> <put name="title" value="defaultReport"></put>
> <put name="banner" value="/dynamicBanner.jsp"></put>
> <put name="report" value="/ccAuth15_PO_all_fragment.jsp"></put>
> <put name="applet" value="/ccAuth13_applet_fragment.jsp"></put>
> </definition>
I'm no tiles expert, but it seems obvious what's going on, here.
> template00
> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
> <html>
> <head>
> <title><tiles:getAsString name="title" ignore="true"/></title>
> </head>
> <body bgcolor="#ffffff">
> <table>
> <tr>
> <td><tiles:insert attribute="banner" flush="true"/></td>
Presumably, Tiles is smart enough to resolve the template paths, here,
to the right file on disk. Are these templates properly resolved when
using <tiles:insert>? Or is this the problem you're actually reporting:
that Tiles can't find your templates?
> <html>
> <head>
> <title>
> ${sessionScope.fb00.frameTitle}
> </title>
> </head>
> <body bgcolor="#ffffff">
> <c:url value="/imageservelet" var="dynaAd">
Good: you are using <c:url>. This will ensure that your URLs are
passed-through both of the following procedures:
1. Pre-pending the context path of the webapp (i.e.
request.getContextPath() + url)
2. Encoding the URL if necessary for url-rewriting (i.e.
response.encodeURL(url)).
> <td><img src="${dynaAd}" alt="Subscriber store specific image banner"
> /></td>
Use of a URL without the above steps /may/ be a problem, but also may
not: if you are sure this URL is exactly right, then feel free to ignore
this comment.
> <td><jsp:include flush="true"
> page="${sessionScope.fb00.framesetPage}"></jsp:include></td>
I checked the documentation for <jsp:include> and it wasn't clear
whether a URL starting with "/" will be treated as if it were relative
to the current webapp or relative to the current hostname. My guess is
the latter.
It also doesn't say whether the url will be "rewritten" if necessary.
> <td><jsp:include flush="true"
> page="/ccAuth13_applet_fragment.jsp"></jsp:include></td>
So, I suspect this and the previous includes are the things that are
failing, right?
What is the context path of your webapp?
What exactly happens when it "does not work"? Error message? Exception?
Both? Neither? Empty output within your <td> element? Page generation stops?
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk2+31kACgkQ9CaO5/Lv0PCdXACePCxfugTVbXWVot8JwQ/X5si6
bB0AniTofkx2+6hEocvYBZoxvGnZgQgq
=2gtV
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6 Struts 1.3
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
cpanon,
On 5/2/2011 12:20 PM, cpanon wrote:
> It still seems there is something stopping the jsp
> processing on TC, after the first time. Yes, I know how foolish that sounds,
> sorry nonplused at this moment.
I'm not even sure I understand what you mean. That's okay, let's take a
look at the code.
> if (desiredReport.equals("a")) {
> fb00.setFramesetPage("/ccAuth15_PO_all_fragment.jsp");
Okay. What is the "/" intended to be relative to? The webapp? The whole
server? More on this, later.
What does the "setFramesetPage" method actually set? I don't see
anything called "frameSet" in the configuration or anything like that.
> http://jakarta.apache.org/struts/dtds/tiles-config_1_3.dtd">
> <tiles-definitions>
> <definition name="defaultReport" path="/ccAuth15_template00.jsp">
> <put name="title" value="defaultReport"></put>
> <put name="banner" value="/dynamicBanner.jsp"></put>
> <put name="report" value="/ccAuth15_PO_all_fragment.jsp"></put>
> <put name="applet" value="/ccAuth13_applet_fragment.jsp"></put>
> </definition>
I'm no tiles expert, but it seems obvious what's going on, here.
> template00
> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
> <html>
> <head>
> <title><tiles:getAsString name="title" ignore="true"/></title>
> </head>
> <body bgcolor="#ffffff">
> <table>
> <tr>
> <td><tiles:insert attribute="banner" flush="true"/></td>
Presumably, Tiles is smart enough to resolve the template paths, here,
to the right file on disk. Are these templates properly resolved when
using <tiles:insert>? Or is this the problem you're actually reporting:
that Tiles can't find your templates?
> <html>
> <head>
> <title>
> ${sessionScope.fb00.frameTitle}
> </title>
> </head>
> <body bgcolor="#ffffff">
> <c:url value="/imageservelet" var="dynaAd">
Good: you are using <c:url>. This will ensure that your URLs are
passed-through both of the following procedures:
1. Pre-pending the context path of the webapp (i.e.
request.getContextPath() + url)
2. Encoding the URL if necessary for url-rewriting (i.e.
response.encodeURL(url)).
> <td><img src="${dynaAd}" alt="Subscriber store specific image banner"
> /></td>
Use of a URL without the above steps /may/ be a problem, but also may
not: if you are sure this URL is exactly right, then feel free to ignore
this comment.
> <td><jsp:include flush="true"
> page="${sessionScope.fb00.framesetPage}"></jsp:include></td>
I checked the documentation for <jsp:include> and it wasn't clear
whether a URL starting with "/" will be treated as if it were relative
to the current webapp or relative to the current hostname. My guess is
the latter.
It also doesn't say whether the url will be "rewritten" if necessary.
> <td><jsp:include flush="true"
> page="/ccAuth13_applet_fragment.jsp"></jsp:include></td>
So, I suspect this and the previous includes are the things that are
failing, right?
What is the context path of your webapp?
What exactly happens when it "does not work"? Error message? Exception?
Both? Neither? Empty output within your <td> element? Page generation stops?
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk2+31kACgkQ9CaO5/Lv0PCdXACePCxfugTVbXWVot8JwQ/X5si6
bB0AniTofkx2+6hEocvYBZoxvGnZgQgq
=2gtV
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 6 Struts 1.3
Posted by cpanon <cp...@yahoo.com>.
Hi Christ, et. al
Thanks here we go. It still seems there is something stopping the jsp
processing on TC, after the first time. Yes, I know how foolish that sounds,
sorry nonplused at this moment.
action
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
ccAuth13_genericForm_FBO_dwr fb00 = (
ccAuth13_genericForm_FBO_dwr) form;
HttpSession session = request.getSession();
String desiredReport = fb00.getType();
if (desiredReport.equals("a")) {
fb00.setFramesetPage("/ccAuth15_PO_all_fragment.jsp");
fb00.setFrameTitle("ccAuth15_PO_All");
session.removeAttribute("fb00");
session.setAttribute("fb00", fb00);
//return mapping.findForward("PO_01");
return mapping.findForward("defaultReport"); //tiles defs
}
if (desiredReport.equals("posSO")) {
fb00.setFramesetPage("/ccAuth15_soDetail_fragment.jsp");
fb00.setFrameTitle("posSO-generic");
session.removeAttribute("fb00");
session.setAttribute("fb00", fb00);
//return mapping.findForward("PO_01");
return mapping.findForward("posSO"); //tiles defs
tiles-defs
<?xml version="1.0" encoding="UTF-8"?>
http://jakarta.apache.org/struts/dtds/tiles-config_1_3.dtd">
<tiles-definitions>
<definition name="defaultReport" path="/ccAuth15_template00.jsp">
<put name="title" value="defaultReport"></put>
<put name="banner" value="/dynamicBanner.jsp"></put>
<put name="report" value="/ccAuth15_PO_all_fragment.jsp"></put>
<put name="applet" value="/ccAuth13_applet_fragment.jsp"></put>
</definition>
<definition extends="defaultReport" name="posSO">
<put name="title" value="soDetail"></put>
<put name="report" value="/ccAuth15_soDetail_fragment.jsp"
direct="true"></put>
</definition>
<definition extends="defaultReport" name="posPO">
<put name="title" value="poDetail" ></put>
<put name="report" value="/ccAuth15_poDetail_fragment.jsp"
direct="true"></put>
</definition>
</tiles-definitions>
template00
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<html>
<head>
<title><tiles:getAsString name="title" ignore="true"/></title>
</head>
<body bgcolor="#ffffff">
<table>
<tr>
<td><tiles:insert attribute="banner" flush="true"/></td>
</tr>
<tr>
<td><tiles:insert attribute="report" flush="true"/></td>
</tr>
<tr>
<td><tiles:insert attribute="applet" flush="true"/></td>
</tr>
</table>
</body>
</html>
template01
<%@ page errorPage="ccAuth15_template01_error.jsp" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
<%@ page import = "java.util.*, java.text.NumberFormat " %>
<html>
<head>
<title>
${sessionScope.fb00.frameTitle}
</title>
</head>
<body bgcolor="#ffffff">
<c:url value="/imageservelet" var="dynaAd">
<c:param name="proxyName" value="${sessionScope.forServelet}"/>
<c:param name="imageSource" value="${fb00.imageSource}"/>
<c:param name="subscriberID" value="${fb00.subscriberID}"/>
<c:param name="subscriberStoreNum" value="${fb00.subscriberStoreNum}"/>
</c:url>
<table>
<tr>
<td><img src="${dynaAd}" alt="Subscriber store specific image banner"
/></td>
</tr>
<tr>
<!--td><html:button property="btn00" value="Print"
onclick="postPrint()">Print2</html:button></td>
<td><html:button property="btn01" value="Display
All">DisplayAll2</html:button> </td-->
</tr>
</table>
<table>
<tr>
<td><jsp:include flush="true"
page="${sessionScope.fb00.framesetPage}"></jsp:include></td>
</tr>
<tr>
<td><jsp:include flush="true"
page="/ccAuth13_applet_fragment.jsp"></jsp:include></td>
</tr>
</table>
</body>
</html>
Re: Tomcat 6 Struts 1.3
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
cpanon,
On 5/1/2011 7:31 PM, cpanon wrote:
> I have an odd but systemic problem with an otherwise working implementation. I
> am unable to get any technique to dynamically recalculate a page from an
> action. I have tried the following
> 1. Defined a frameset with the "top" frame specified in realtime with jstl. It
> works the first time, there after even though I am positive I ave set the
> elements in my form bean for the new jsp, it fails to recalculate and show the
> different jsp. The second time is, of course the exact same approach that works
> the first time, nothing changes and neither does the inclusion of the new jsp
> the second time.
> 2. Tiles. Defined a template, this time without a frameset, very standard
> header, body, footer. Defined tiles-defs.xml to extend the template and just
> change the put for the body. Again it does not recalculate, reprocess the
> page. How can this be. I am successfully forwarding the first time to a
> definition in the tiles-defs. The second time I am also doing the same,
> forwarding to a definition in tiles-defs and it does not work;I see the old
> previous result.
>
> 3. jsp:include. Define another template that simulates the Tiles approach but
> rather than named areas more primitively makes three rows in a table and uses
> jstl to pick off the correct jsp for that section. Again it fails after the
> first time. Even thought I specify a different name for the body, set it in the
> form bean, specify it as jsp:include page=${sessionScope.formBean.bodyName}, it
> does not work, after the first time. Of course even when I first remove the
> formbean and populate it and add it to the session.
How about a larger portion of sample code, and an example of the HTML
output that /does/ work versus one that doesn't.
> How can I be having this systemic problem not alleviated by any of the different
> designs? Any one of these should have worked. To have all of them fail has
> cost me many days and worse. Any help appreciated.
My suspicion is that you are not using URLs that start with "/" and are
always rooted at the webapp's base. If you try to use relative URLs like
"../whatever" or "whatever/" then you will have weird problems because
the base path of the resource changes depending on what page the browser
is on.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk2+u8IACgkQ9CaO5/Lv0PDB9QCffZA91popTl/44CKGRuo5gcDY
21AAoKJZFtoq721UEm/M7zufZTiqkoRC
=eBP0
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org