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(Appl ication
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterCh
ain.java:157)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.
java:704)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD ispatch
er.java:590)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis patcher
.java:510)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireStri ng(Impo
rtSupport.java:314)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(Im portSup
port.java:179)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_c_import_0(labAppl ication
_jsp.java:295)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_subview_0(labApp licatio
n_jsp.java:271)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_h_form_0(labApplic ation_j
sp.java:225)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_view_0(labApplic ation_j
sp.java:141)
at
org.apache.jsp.pages.labApplication_jsp._jspService(labApplication_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(JspServletWrapper .java:3
24)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 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(Appl ication
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterCh
ain.java:157)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.
java:704)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica tionDis
patcher.java:474)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD ispatch
er.java:409)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis patcher
.java:312)
at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatc h(Servl
etExternalContextImpl.java:405)
at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspV iewHand
lerImpl.java:280)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java: 300)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl ication
FilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterCh
ain.java:157)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.
java:704)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD ispatch
er.java:590)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis patcher
.java:510)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireStri ng(Impo
rtSupport.java:314)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(Im portSup
port.java:179)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_c_import_0(labAppl ication
_jsp.java:295)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_subview_0(labApp licatio
n_jsp.java:271)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_h_form_0(labApplic ation_j
sp.java:225)
at
org.apache.jsp.pages.labApplication_jsp._jspx_meth_f_view_0(labApplic ation_j
sp.java:141)
at
org.apache.jsp.pages.labApplication_jsp._jspService(labApplication_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.....

Reply via email to