(I think what Bergsten says is that when you dynamically include things, you have to put verbatim tags
around non-jsf stuff to make sure the tree gets built in order... not the issue I am having....)
On Mar 22, 2005, at 1:23 AM, [EMAIL PROTECTED] wrote:
Hi
Should not the <c:import url="${labApplicationWizard.currentPanel}"/> be
enclosed in a f:verbatim tag ?
Hermod
-----Original Message----- From: Matthias Wessendorf [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 22, 2005 10:18 AM To: MyFaces Discussion Subject: Re: EL w/<c:import/>
perhaps a silly thing,
but try to use none scope for "labApplicationWizard"
-Matthias
Rob Williams wrote:Nevermind. It doesn't work with the RI either. I cannot believe it is
impossible to use EL for a page include. This is all I'm trying to do:
<html> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <f:view> <head> <title></title> </head> <body> <h:messages style="color: red" layout="table"/> <f:subview id="labApplicationPanelInfo"> <h:form id="labApplicationForm" rendered="#{labApplicationWizard != null}"> <c:import url="${labApplicationWizard.currentPanel}"/> </h:form> </f:subview> </body> </f:view> </html>
I am trying to get the panel to embed by calling a bean method. How on
Earth can that be too much to ask????
On Mar 22, 2005, at 12:17 AM, Rob Williams wrote:
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
it: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<%@ 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
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDbeen committed at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDisisp atcher.java:324) at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatcpat cher.java:312) at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspVh(S ervletExternalContextImpl.java:405) at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:iew HandlerImpl.java:280) at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)300) atOf 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
isagainst 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 itbe 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
javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)more spectacular failure, including some of the craziest stack traces I've ever seen (looks like an endless loop). Here's an excerpt: atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilterat
org.apache.catalina.core.ApplicationFilterChain.doFilter(Applica(Ap pl ication FilterChain.java:237) at
org.apache.catalina.core.ApplicationDispatcher.invoke(Applicatiotio nF ilterCh ain.java:157) at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicanDi sp atcher. java:704) at
org.apache.catalina.core.ApplicationDispatcher.include(Applicatitio nD ispatch er.java:590) at
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquironD is patcher .java:510) at
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTeSt ri ng(Impo rtSupport.java:314) at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_c_import_0(laag( Im portSup port.java:179) at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_subview_0(lbAp pl ication _jsp.java:295) at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_h_form_0(labAabA pp licatio n_jsp.java:271) at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_view_0(labAppl ic ation_j sp.java:225) at
org.apache.jsp.pages.labApplication_jsp._jspService(labApplicatippl ic ation_j sp.java:141) at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:on_ js p.java: 90) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)94) atorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrat
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.japp er .java:3 24) at
236)ava : 292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:javax.servlet.http.HttpServlet.service(HttpServlet.java:802)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilterat
org.apache.catalina.core.ApplicationFilterChain.doFilter(Applica(Ap pl ication FilterChain.java:237) at
org.apache.catalina.core.ApplicationDispatcher.invoke(Applicatiotio nF ilterCh ain.java:157) at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApnDi sp atcher. java:704) at
org.apache.catalina.core.ApplicationDispatcher.doForward(Applicapli ca tionDis patcher.java:474) at
org.apache.catalina.core.ApplicationDispatcher.forward(Applicatitio nD ispatch er.java:409) at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dionD is patcher .java:312) at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderViewspa tc h(Servl etExternalContextImpl.java:405) at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.(Js pV iewHand lerImpl.java:280) at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)jav a: 300) atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilterat
org.apache.catalina.core.ApplicationFilterChain.doFilter(Applica(Ap pl ication FilterChain.java:237) at
org.apache.catalina.core.ApplicationDispatcher.invoke(Applicatiotio nF ilterCh ain.java:157) at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicanDi sp atcher. java:704) at
org.apache.catalina.core.ApplicationDispatcher.include(Applicatitio nD ispatch er.java:590) at
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquironD is patcher .java:510) at
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTeSt ri ng(Impo rtSupport.java:314) at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_c_import_0(laag( Im portSup port.java:179) at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_subview_0(lbAp pl ication _jsp.java:295) at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_h_form_0(labAabA pp licatio n_jsp.java:271) at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_view_0(labAppl ic ation_j sp.java:225) at
org.apache.jsp.pages.labApplication_jsp._jspService(labApplicatippl ic ation_j sp.java:141) at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:on_ js p.java: 90) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)94) atI stuck my head into some of the code to see what was causing
this but no luck yet. Any thoughts appreciated.....
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email.
This email message has been virus checked by the virus programs used in the DnB NOR Group.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

