facebook

JSP 2.0? [Closed]

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

    Tom
    Member

    Hi –

    I created a new Project, added Struts capabilities, and imported a war file of struts example and utility source provided by a Java instructor.

    This war file deploys fine in Resin, but Eclipse has the following problems with it:
    jsp:directive.include is not yet supported
    jsp:root is not yet supported

    Was that a reasonable way to import into Eclipse, and are those JSTL tags soon to be suppored?

    Thanks again!!

    System information:
    Red Hat EL AS 3 Linux
    Eclipse version and build id: 3.0.0 – 200406251208
    MyEclipse version and build id: 3.7.101 – 200405301200-3.8-Beta1
    Using JDK version 1.4.2_04
    Installed JREs include (only) j2sdk1.4.2_04
    Using Resin 3.0.8 application server

    #209743 Reply

    Riyad Kalla
    Member

    Tom,
    AFAIK those aren’t JSTL tags but straight JSP tags… can you give us the context in which they are used? Also can you paste in your @taglib directives at the top of the page (I wonder if your instructor mapped one of the JSTL libs to “jsp” prefix….)

    #209749 Reply

    Tom
    Member

    In response to your cogent put: “AFAIK those aren’t JSTL tags but straight JSP tags… can you give us the context in which they are used? Also can you paste in your @taglib directives at the top of the page (I wonder if your instructor mapped one of the JSTL libs to “jsp” prefix….)”
    =========================
    So they are JSP and not JSTL tags….

    It seems a way to include JSTLs rather than to map them, and maybe this relates to my import, since HelloStruts.jsp and all the other JSPs with this error are siblings of WEB-INF, or are in folders which are siblings or WEB-INF, in Eclipse, as is the referenced “include” directory, and all the files at that level, and in those folders (excepting those in include) are also accompanied by the error e.g.: “File <workspace>/<project_name>/HelloStruts.jsp not in base path <workspace>/<project_name>/WebRoot”

    I hope that made sense – and I will sure very much appreciate any and all clues!!!!

    Please find HelloStruts.jsp below, followed by the referenced includes, and the actual “@ taglib” directives are below that.

    ====================
    File: webapps/uw/HelloStruts.jsp
    <jsp:directive.include file=”/include/apStartJSP.inc” />
    <html:html>
    <body>
    <c:if test=”{!(empty hello.name)}” >
    <h1>Hello ${hello.name}</h1>
    </c:if>
    <html:form action=”/hello.do” >
    Please Enter your name <html:input property=”name” />
    <html:submit/>
    </html:form>
    </body>
    </html:html>
    <jsp:directive.include file=”/include/apEndJSP.inc” />
    =====
    File: webapps/uw/include/apStart.inc:
    <jsp:directive.page contentType=”text/html” />
    <jsp:directive.include file=”/include/apStartTile.inc” />
    <%– Render the html tags as XHTML –%>
    <html:xhtml/>
    ======
    File: webapps/uw/include/apStartTile.inc:
    <jsp:directive.include file=”/include/declareTags.inc” />
    ======
    File: webapps/uw/include/declareTags.inc:
    <%– JSTL Taglibs –%>
    <jsp:directive.taglib uri=”http://java.sun.com/jstl/core&#8221; prefix=”c” />
    <jsp:directive.taglib uri=”http://java.sun.com/jstl/xml&#8221; prefix=”x” />
    <jsp:directive.taglib uri=”http://java.sun.com/jstl/fmt&#8221; prefix=”fmt” />
    <jsp:directive.taglib uri=”http://java.sun.com/jsp/jstl/functions&#8221; prefix=”fn” />
    <%– Struts Taglibs –%>
    <jsp:directive.taglib uri=”http://struts.apache.org/tags-html&#8221; prefix=”html” />
    <jsp:directive.taglib uri=”http://struts.apache.org/tags-bean&#8221; prefix=”bean” />
    <jsp:directive.taglib uri=”http://struts.apache.org/tags-logic&#8221; prefix=”logic” />
    <%– Tile Taglibs –%>
    <jsp:directive.taglib uri=”http://struts.apache.org/tags-tiles&#8221; prefix=”tiles” />
    <%– Custom Taglibs –%>
    <jsp:directive.taglib uri=”http://www.lordjoe.com/taglibs/aptags&#8221; prefix=”ap” />
    <%– JSP Taglibs –%>
    <jsp:directive.taglib tagdir=”/WEB-INF/tags/formpatterns” prefix=”fm” />

    ===================================

    [toms@workhorse webapps]$ find uw -exec grep -l ‘@ taglib’ {} \;
    uw/common/menu.jsp
    uw/common/viewSrcBodyError.jsp
    uw/el/functions.jsp
    uw/el/functions.jsp.html
    uw/layouts/menu.jsp
    uw/layouts/menuNoStruts.jsp
    uw/layouts/nestedTabsLayout.jsp
    uw/layouts/vboxLayout.jsp
    uw/pages/Welcome.jsp
    uw/WEB-INF/classes/com/att/utilities/PageProcessor.class
    [toms@workhorse webapps]$ find uw -exec grep ‘@ taglib’ {} \;
    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %>
    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %>
    <%@ taglib uri=”/WEB-INF/struts-bean.tld” prefix=”bean” %>
    <%@ taglib uri=”/WEB-INF/struts-logic.tld” prefix=”logic” %>
    <%@ taglib prefix=”my” uri=”http://jakarta.apache.org/tomcat/jsp2-example-taglib”%&gt;
    <%@ taglib prefix=”my” uri=”http://jakarta.apache.org/tomcat/jsp2-example-taglib”%&gt;
    <%@ taglib uri=”/WEB-INF/struts-logic.tld” prefix=”logic” %>
    <%@ taglib uri=”/WEB-INF/struts-bean.tld” prefix=”bean” %>
    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %>
    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %>
    <%@ taglib uri=”/WEB-INF/struts-logic.tld” prefix=”logic” %>
    <%@ taglib uri=”/WEB-INF/struts-bean.tld” prefix=”bean” %>
    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %>
    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %>
    <%@ taglib uri=”/tags/struts-bean” prefix=”bean” %>
    <%@ taglib uri=”/tags/struts-html” prefix=”html” %>
    <%@ taglib uri=”/tags/struts-logic” prefix=”logic” %>
    Binary file uw/WEB-INF/classes/com/att/utilities/PageProcessor.class matches

    #209750 Reply

    Riyad Kalla
    Member

    Ahh ok, this is JSP 2 stuff, which we don’t support yet; that is why you are getting those errors.

    As far as the errors “not in base path” that means that you need to tell MyEclipse which directory your webroot is. This is the root of your web application, one directory level above your WEB-INF directory. You can right click on yoru project root directory, and go to MyEclipse-Web, and then type in the correct webroot directory here (it looks like your teacher named it “uw”).

    You will still get the “not supported” errors because we well… don’t support JSP 2 yet 🙂

    #209755 Reply

    Tom
    Member

    Riyad,

    I’ll be able to get the base path resolved, and thanks on that, but regarding: @support-rkalla wrote:

    Ahh ok, this is JSP 2 stuff, which we don’t support yet; that is why you are getting those errors….

    I see on a different thread onJune 27th that you planned to check whether Beta-2 would include JSP 1.2 support, and hearing no good news, my only questions are is it known when it can be expected, and can I vote for it, and if so, where can I do so, and where might I direct other developers and professors and Java product managers to do the same, and how might I best make the very informative discussion in that other thread available??

    Best regards and tia!!

    Tom Starr

    #209758 Reply

    No Operation
    Member

    Even if the JSP 2.0 support is already released, your example contains several issues, which do not conform with the JSP 2.0 specification:

    Issue 1:

    <jsp:directive.taglib uri=”http://java.sun.com/jstl/core&#8221; prefix=”c” />

    The action jsp:directive.taglib does not exist.
    Use namespaces instead

    <jsp:root xmlns:c="http://java.sun.com/jstl/core">

    BUT if you plan to declare taglibs within an included file, you MUST use the page directive, since namespaces apply only to subelements! A namespace is not visible outside of the included part.

    Issue 2:

    <jsp:directive.include file=”/include/apStartTile.inc” />
    <%– Render the html tags as XHTML –%>

    The action jsp:directive.include exists but is only valid in JSP Documents.
    Since JSP Documents are using XML Syntax, the use of JSP comments is not allowed.

    => Either use directives + JSP comments or this action + XML comments

    Issue 3:

    <c:if test=”{!(empty hello.name)}” >

    the $ is missing to use the expression language

    … there might be more issues.

    Some hints:
    – If you decide to use JSP Documents instead of JSP pages, the file suffix .jspx is recommended.
    – instead of declaring a prelude and coda include manually, use the web.xml (version 2.4) and add jsp-property-groups.

    regards

    NOP

    #209798 Reply

    Riyad Kalla
    Member

    Tom,
    In addition to NOP’s comments (thanks NOP) I have to clarify that we DO support JSP 1.2 spec, but you are using elements (incorrect as NOP pointed out) from the JSP 2.0 spec, which we don’t support yet. NOP’s suggestions will atleast help you get a valid JSP 2.0 file.

    #209799 Reply

    Riyad Kalla
    Member

    I have closed this issue (please feel free to post if you want me to reopen it) and renamed it to better reflect the question.

    Just FYI, MyEclipse does support JSTL, you just have to add the taglib directives correctly and you can use it. Although we don’t support autocomplete with the EL segments yet.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: JSP 2.0? [Closed]

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