- This topic has 10 replies, 2 voices, and was last updated 19 years, 4 months ago by Riyad Kalla.
-
AuthorPosts
-
dkittleMemberI’m using ME4M2 (Build id: 20050627-4.0-Milestone-2) with Eclipse 3.1 (Build id: I20050627-1435) on RedHat EL 4 and JDK 1.5.0_03.
I created a new project with Web, JSF and Hibernate capabilities. I moved the TLD files so things were a little more organized, with JSF tlds in /WEB-INF/tld/jsf and JSTL in /WEB-INF/tld/jstl.
In my JSPs, I am able invoke Content Assist (using Ctrl-Space) in JSP tags and JSTL tags, but if I try in JSF tags I get “Content Assist not available at current location” in the status bar.
There are no validation errors for the JSP at all… Any idea what the problem might be?
Riyad KallaMemberWhat @taglib statements do you have in these paegs? what do all your <taglib> entries in your web.xml file look like?
dkittleMemberI have no <taglib> entries in my web.xml. Content Assist for JSP and JSTL tags works, for JSF it doesn’t. The jsp is as follows:
<%@ page %>
<%@ taglib prefix=”h” uri=”/WEB-INF/tld/jsf/html_basic.tld”%>
<%@ taglib prefix=”f” uri=”/WEB-INF/tld/jsf/jsf_core.tld”%>
<%@ taglib prefix=”c” uri=”/WEB-INF/tld/jstl/c-rt.tld” %>
<%@ taglib prefix=”fmt” uri=”/WEB-INF/tld/jstl/fmt-rt.tld” %>
<f:view>
<fmt:setLocale value=”${(sessionScope[‘locale’] != null) ? sessionScope[‘locale’] : header[‘Accept-Language’]}” scope=”request”/>
<fmt:setBundle basename=”resources.Text” var=”textBundle”/>
<f:loadBundle basename=”resources.Text” var=”textMsgs”/>
<h:form>
…
</h:form>
</f:view>
Riyad KallaMemberPlease read this:
http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-31.html#251And change your jsf_core URI to this: http://java.sun.com/jsf/core
and html_basic URI to this: http://java.sun.com/jsf/htmlThen close all your editors, restart MyEclipse and clean/rebuild youir project.
NOTE: It wouldn’t be a bad idea to change your JSTL URIs as well, but since you said they were working I didn’t address it.
dkittleMemberI have created taglib entries in my web.xml and still have a hiccup… Seems those URLs above return a 404 error. MyEcilpse puts a red x at the top of the JSP file and indicates ‘File “http://java.sun.com/jsf/core” not found.’ Presumably there isn’t much -you- can do about this though…
Riyad KallaMemberThese are URIs, not URLs. The two are different. They don’t need to resolve to actual file locations (that was the purpsoe of the FAQ entry). You need to have the jsf-impl.jar in your build path in order to resolve these URIs because that JAR is the one that contains the TLDs in it’s META-INF dir.
dkittleMemberOk, I’m clued in on the URI. sorry for being dense.
I DO have jsf-impl.jar in my build path. I used MyEclipse to add JSF, JSTL and Hibernate capabilities to the project and it placed the required jars in WEB-INF/lib. I confirmed this both in the IDE and in the .classpath file:
…
<classpathentry kind=”lib” path=”webroot/WEB-INF/lib/jsf-api.jar”/>
<classpathentry kind=”lib” path=”webroot/WEB-INF/lib/jsf-impl.jar”/>
<classpathentry kind=”lib” path=”webroot/WEB-INF/lib/jstl.jar”/>
<classpathentry kind=”lib” path=”webroot/WEB-INF/lib/standard.jar”/>
…
dkittleMemberOk, I exited Eclipse, deleted my project files, started Eclipse and re-created the project. I add Web capabilities (J2EE 1.4), then add JSF capabilities (with some complaints about faces-config.xml already existing, but after the wizard ends, everything is in order). When I go to add JSTL 1.1 capabilities, though, I get the error:
“JSTL 1.1 is not compatible with J2EE 1.3 specification”
I am certain that I added J2EE 1.4 when I added web capabilities. I confirmed this by looking at my build path and seeing J2EE 1.4 libraries there.I looked in the .mymetadata project file and sure enough it had j2ee-spec=”1.3″ in it. I exited Eclipse, changed this to 1.4, started Eclipse again and I could then add JSTL 1.1 capabilities to the project.
I rebuilt my project but get an error in the setLocale line of my JSP (see above). It’s complaining about encountering a ? in the value expression… According to Sun’s J2EE 1.4 tutorial (http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html#wp71088) the conditional operator is legal in 1.4. Is this a bug in the validator or am I still being stupid about something??
Riyad KallaMemberFirst let me thank you for being so thorough with your testing, second the 1.3 bug is a known issue, sorry you ran into that. And last, please paste the 5 lines around and including the line with the error.
dkittleMemberNo problem… I know what it’s like trying to find bugs that users report electronically 🙂
The problem is in the setLocale line below. Your validator indicates a problem with the ? character in the conditional operator. I tried deploying this into Resin and the container gave me the exact same error. I deployed this code against JSTL 1.0.5 (the jars are from an old WSDP) and it worked just fine. But with MyEclipse JSTL 1.0 and JSTL 1.1 jars it doesn’t work. I will test with the jars from WSDP 1.6 and see if that helps. I think it might be an issue with the Validator jars in standard.jar.
<%@ page %>
<%@ taglib prefix=”h” uri=”/WEB-INF/tld/jsf/html_basic.tld”%>
<%@ taglib prefix=”f” uri=”/WEB-INF/tld/jsf/jsf_core.tld”%>
<%@ taglib prefix=”c” uri=”/WEB-INF/tld/jstl/c-rt.tld” %>
<%@ taglib prefix=”fmt” uri=”/WEB-INF/tld/jstl/fmt-rt.tld” %>
<f:view>
<fmt:setLocale value=”${(sessionScope[‘locale’] != null) ? sessionScope[‘locale’] : header[‘Accept-Language’]}” scope=”request”/>
<fmt:setBundle basename=”resources.Text” var=”textBundle”/>
<f:loadBundle basename=”resources.Text” var=”textMsgs”/>
<h:form>
…
</h:form>
</f:view>
Riyad KallaMemberHmm if your app server is not allowing this either, then it might be a setting. I belive there isa @page directive called “isElIgnored” or “ignoreEL” something like that, that tells if the page should process the EL or not, can you try setting that to true or false and see what happens?
-
AuthorPosts