I am in the midst of trying to get an RI example running. Will let you
know.
On Mar 22, 2005, at 12:02 AM, Matthias Wessendorf wrote:
no idea, strange. You said you'll test that with RI.
Can you please submit the results here?
-Matthias
Rob Williams wrote:
Hi Matthias:
I saw this post. This was how I was navigating and how I ended up in
the ditch. When I do exactly as he says, I get the crazy loop I
reported. It is resolving the bean properly, which is a JSF managed
bean. I am sure of that.
The reason I'm sure of it is when you suggested Tiles I figured I
would plug that in since I was planning on using it anyway. Well,
Tiles was not the answer for this. I got it setup, and I was going
to follow the example from the Core book that shows the ability to
dynamically select a book from a menu and the tile will update
itself. Lo and behold, look what the core of that example has in it:
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<c:import url="${labApplicationWizard.currentPanel}"/>
(this is adapted to my problem but you can see David's version on
page 347 of the Core book.) So once I got this all plugged in and
working, now I get the following error:
java.lang.IllegalStateException: Cannot forward after response has
been committed
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDi
sp atcher.java:324)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDisp
at cher.java:312)
at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch
(S ervletExternalContextImpl.java:405)
at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspVi
ew HandlerImpl.java:280)
at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:
300)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)
Of course, the difference between my example and David's is that his
is only including html. I am trying to dynamically include pages
that have JSF components in them. Again, somehow people on the sun
newsgroups seem to think they got that working. I am pretty
convinced this is not going to work in MyFaces. I think as a final
exercise in futility I am going to try and get it running against
the RI. The people on that thread I quoted earlier today seemed to
claim they got it to work.
On Mar 21, 2005, at 11:12 PM, Matthias Wessendorf wrote:
Sergey.Smirnov from Exadel says:
<snip>
#{} is a propritory notation working only with the jsf tags.
jsp:include is not a jsf tag, so you cannot use it in such manner.
If your run-time environment supports Servlet 2.4 specification, you
can use ${} notation to have an access to the same bean.
Try the following code:
<f:subview id="includeExample" rendered="#{SomeBean != null}">
<jsp:include page="${SomeBean.jsfFileName}" />
</f:subview>
Note, rendered="#{SomeBean != null}" is an important part here. It
guarantees that the SomeBean is loaded before you use it in the
jsp:include
</snip>
So, are you in Servlet2.4 environment? (e.g. Tomcat5.xx)
I haven't tried it, but it looks like, that the backing bean, that
contains your page names must be created *first* via a JSF tag.
in this <snip/> the rendered="#{SomeBean != null}"> checks if it is
be created *before* that "include".
What kind of bean is behind
${sessionScope.labApplicationWizard.currentPanel}?
Is it a *normal* (<jsp:useBean/>) or a backing / managed bean?
-Matthias
Rob Williams wrote:
Matthias:
I went back and looked this over again. Turns out that the people
on this thread:
http://forum.java.sun.com/thread.jspa?threadID=584037&tstart=360
got it to work using the RI and dynamically including jsf files. ??
Thanks.
On Mar 21, 2005, at 6:45 AM, Rob Williams wrote:
First off, guilty as charged: I am trying to dynamically include a
file that contains JSF code.
I reviewed the Core book again today to look at the Tiles section.
Looks like I am going to have
to make the WizardController in my scenario (which is deciding
which panel to include in the
wizard layout, which stays the same) into a TilesController and
then it should be ok.
My question is why on Earth do we have to do this? What is the
point of having an EL if you
can't use it for something like this? Tiles looks like a good
solution to other problems, but
for this I would prefer that dynamic content inclusion through a
simple include tag and EL
would just work!
Thanks.
On Mar 20, 2005, at 11:41 PM, Matthias Wessendorf wrote:
Amit Modi wrote:
Try putting the <f:subview> tag inside the jsp you want to
import.
No, that should not be the reason.
In tiles example we also have <f:subview/> only in *template* JSP
file.
One hint could be, that inside of JSTL you can't access
faces-config.xml
So why not using Tiles with Apache MyFaces?
-Matthias
-----Original Message-----
From: Rob Williams [mailto:[EMAIL PROTECTED] Sent:
Monday, March 21, 2005 4:42 AM
To: MyFaces User List
Subject: EL w/<c:import/>
Here's the part of the page I am trying to get working:
<f:subview id="labApplicationPanelInfo">
<c:import
url="${sessionScope.labApplicationWizard.currentPanel}"/>
</f:subview>
I did some reading about using EL and found the pieces that
would allow me
to stipulate the URL dynamically. When I first got the pieces in
place and
tried it with MyFaces, it blew up with an error saying it
couldn't find the
servlet path for the URL (but w/jsp on the end). I did some
searches and
there was some talk of a fix for it (I even found a diff of the
source
checked in on 3/10 to fix this problem). So I synced with CVS
and built
everything and tried it again. The results this time are much
more
spectacular failure, including some of the craziest stack traces
I've ever
seen (looks like an endless loop). Here's an excerpt:
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
Ap pl ication
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicat
io nF ilterCh
ain.java:157)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(Application
Di sp atcher.
java:704)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(Applicat
io nD ispatch
er.java:590)
at
org.apache.catalina.core.ApplicationDispatcher.include(Applicatio
nD is patcher
.java:510)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquire
St ri ng(Impo
rtSupport.java:314)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTa
g( Im portSup
port.java:179)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_c_import_0(lab
Ap pl ication
_jsp.java:295)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_subview_0(la
bA pp licatio
n_jsp.java:271)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_h_form_0(labAp
pl ic ation_j
sp.java:225)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_view_0(labAp
pl ic ation_j
sp.java:141)
at
org.apache.jsp.pages.labApplication_jsp._jspService(labApplicatio
n_ js p.java:
90)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:
94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWra
pp er .java:3
24)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.ja
va : 292)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:
236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
Ap pl ication
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicat
io nF ilterCh
ain.java:157)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(Application
Di sp atcher.
java:704)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(App
li ca tionDis
patcher.java:474)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(Applicat
io nD ispatch
er.java:409)
at
org.apache.catalina.core.ApplicationDispatcher.forward(Applicatio
nD is patcher
.java:312)
at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dis
pa tc h(Servl
etExternalContextImpl.java:405)
at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(
Js pV iewHand
lerImpl.java:280)
at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.j
av a: 300)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
Ap pl ication
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicat
io nF ilterCh
ain.java:157)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(Application
Di sp atcher.
java:704)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(Applicat
io nD ispatch
er.java:590)
at
org.apache.catalina.core.ApplicationDispatcher.include(Applicatio
nD is patcher
.java:510)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquire
St ri ng(Impo
rtSupport.java:314)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTa
g( Im portSup
port.java:179)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_c_import_0(lab
Ap pl ication
_jsp.java:295)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_subview_0(la
bA pp licatio
n_jsp.java:271)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_h_form_0(labAp
pl ic ation_j
sp.java:225)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_view_0(labAp
pl ic ation_j
sp.java:141)
at
org.apache.jsp.pages.labApplication_jsp._jspService(labApplicatio
n_ js p.java:
90)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:
94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
I stuck my head into some of the code to see what was causing
this but no
luck yet. Any thoughts appreciated.....