facebook

Myeclipse not recognizing the Struts TLDs

  1. MyEclipse IDE
  2.  > 
  3. Feature Requests
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #215244 Reply

    aannam01
    Member

    I just started uisng the MyEclipse with the Struts.It is mt recognizing the Struts-html and other tlds.

    Here is my web.xml

    
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app>
       <servlet>
          <servlet-name>action</servlet-name>
          <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
          <init-param>
             <param-name>config</param-name>
             <param-value>/WEB-INF/struts-config.xml</param-value>
          </init-param>
          <init-param>
             <param-name>debug</param-name>
             <param-value>3</param-value>
          </init-param>
          <init-param>
             <param-name>detail</param-name>
             <param-value>3</param-value>
          </init-param>
          <load-on-startup>0</load-on-startup>
       </servlet>
       <servlet-mapping>
          <servlet-name>action</servlet-name>
          <url-pattern>*.do</url-pattern>
       </servlet-mapping>
       <taglib>
       <taglib-uri>struts-html</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
       </taglib>
    </web-app>
    
    

    Here is My JSP page

    
    <%@ page language="java"%>
    <%@ taglib uri="struts-html" prefix="html" %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html locale="true">
       <body>
        <html:form action="becomeaffiliate.do" method="post">
          <table border="0">
            <tr>
              <td>Login:</td>
              <td><html:text property="companyname" /></td>
            </tr>
            <tr>
              <td>Password:</td>
              <td><html:text property="physicaladdress" /></td>
            </tr>
            <tr>
              <td colspan="2" align="center"><html:submit /></td>
            </tr>
          </table>
        </html:form>
      </body>
    </html:html>
    

    This is my project webroot structure

    webroot
    META-INF
    WEB-INF
    lib
    struts-html.tld
    web.xml
    struts-config.xml
    pages
    becomeaffiliate.jsp

    And this is the error I am getting
    org.apache.jasper.JasperException: File “/pages/struts-html” not found
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:105)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:430)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:180)

    I really appreciate any help.Please let me know if you need any more information.

    Thank you

    #215270 Reply

    Riyad Kalla
    Member

    I cannot reproduce this, from the screenshot do you see anything I missed? I copy-pasted your web.xml file and jsp file:

    #215271 Reply

    Riyad Kalla
    Member

    Note, I also placed becomeaffiliate.jsp in two folders, one under webroot and one under web-inf, because I couldn’t tell from your post where it was. Both worked.

    #215275 Reply

    Paul
    Participant

    I don’t have a reference to the TLD’s in my web.xml file. In my JSPs though, the reference to those TLD’s looks like this – note my uri is different than yours. Those TLD files are also placed inside the web-inf directory (hard to tell from the formatting of your post if that’s the case for you)

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

    Did you start this struts project by creating a web project, then applying ‘add struts capabilities’ to it? That was all I had to do. HTH.

    #215279 Reply

    aannam01
    Member

    Thanks for the reply.

    I have my Pages folder under WebRoot.

    I am creating the Project by going to New ->Project->J2EE Project->WebProject and then adding the struts capabilities .

    Before modifying anything in the web.xml i cretaed simple JSP and tried to access it , still i get the error .

    After i changed the references in the web.xml to struts-html anf tried that way, still get the error .

    Do i need to set any paths , before cretaing a project.

    I really apprecitae any help.

    #215280 Reply

    aannam01
    Member

    I just started using MyEclipse , so not able to figure out how to view two files at a time.Please let me know, so that i will post the screenshot of my project if required.

    #215284 Reply

    aannam01
    Member

    If give the absolute URI for tag libraries this is the error i am getting

    org.apache.jasper.JasperException: This absolute uri (http://jakarta.apache.org/struts/tags-bean) cannot be resolved in either web.xml or the jar files deployed with this application

    #215286 Reply

    Riyad Kalla
    Member

    aannam,
    Right click on your project root node, and go to “Properties” then got to Java Build Path and then “Libraries”, amke sure all the struts libraries (especially struts.jar) are added here to your build path. If they are not, click on “Add JAR” and add them from your project.

    Also you can show two files side by side by clicking on the tab of oen, and dragging it over until its next to the existing file.

    #215287 Reply

    aannam01
    Member

    I have all the jar files included.But still getting the error.Is there a sample project available for struts, so that i Import and start from there.

    #215289 Reply

    Riyad Kalla
    Member

    I have posted my project for you here, please try it:
    http://www.u.arizona.edu/~rsk/myeclipse/TestWeb4.zip

    #215293 Reply

    aannam01
    Member

    Thanks it is working now ,but by copying your SRC and WebRoot directories.I am stilll not able to figure out what was wrong.Thanks again

    #215296 Reply

    Riyad Kalla
    Member

    Its hard to say, maybe a flaky dot file? (.project, .classpath, .mymetadata, etc.) it could be a lot of things, i’m glad it worked though.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Myeclipse not recognizing the Struts TLDs

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