facebook

Problems referencing JSTL and Struts taglibs

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #214542 Reply

    mbagai
    Member

    Hello,

    After installing the latest (3.8.1, 3rd QF) MyEclipse release, I am having a terrible time trying to use the standard Struts JSP taglibs.

    With previous releases, I used to be able to simply reference the taglib with the default uri at the top of my JSP pages like this:

    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>

    With a fresh MyEclipse J2EE 1.4 project with WebProject and Struts capabilities added, this no longer works. I tried adding a <jsp-config> element to the deployment descriptor with taglib elements, like this:

    <jsp-config>
           <taglib>
               <taglib-uri>http://jakarta.apache.org/struts/tags-html</taglib-uri>
               <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
           </taglib>
       </jsp-config>

    but that still gives me this error when trying to use the struts-html tags:

    javax.servlet.ServletException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope
            org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
            org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
            org.apache.jsp.login_jsp._jspService(login_jsp.java:175)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    
    
    root cause 
    javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope
            org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)
            org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
            org.apache.jsp.login_jsp._jspx_meth_html_text_0(login_jsp.java:191)
            org.apache.jsp.login_jsp._jspService(login_jsp.java:124)
            org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    I had a similar problem with JSTL which I solved changing the MyEclipse preferences to use the JSTL 1.1 jars instead of 1.0 set that ships with 3.8.1, but I would really like to know how to get this to work out-of-the-box.

    I’m using Tomcat 5.0.19 on OS X 10.3.5.

    Thanks,

    Morten

    #214552 Reply

    Riyad Kalla
    Member

    Morten,
    This looks like a classpath issue, what JARs do you have on your classpath in your Java Build Path settings for your Project properties? (make sure none of them have red X’s on them).

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Problems referencing JSTL and Struts taglibs

You must be logged in to post in the forum log in