facebook

struts taglib JSP entries

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #236352 Reply

    Is there a way to default the taglib directives to use the tlds in my project, instead of http pointers back to the jakarta project?

    I looked for a way in the ME preferences but didn’t see anything so obvious as a way to manipulate the directives that get automatically inserted when creating a JSP page using the wizard.

    Thanks.
    Robin.

    #236388 Reply

    Riyad Kalla
    Member

    Robin,
    Take a look at this entry to better understand what those URIs actually are doing: http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-31.html#251

    If your TLDs are in the META-INF dir of one of the JARs in your classpath, and the <uri> defined in them is the default URI you are using in your JSP page, then the actual TLD being used is the one in the JAR. If you are talking about a custom Taglib, you will need to add <taglib> entries to your web.xml file in order for those URIs to resolve to a real file.

    #236394 Reply

    Thanks for the article.

    So, it seems that adding the mappings to web.xml is a manual process and not part of the struts configuration wizard. Is that correct or is their a way to automatically add the <jsp-config> tags when adding struts capabilities?

    Thanks.

    #236396 Reply

    Riyad Kalla
    Member

    Correct it is manual because it is not needed. The URIs we use for all our taglibs (Struts, JSTL, JSF, etc.) in our templates are all the default ones specified in the TLDs that are in the JARs for each of the supported technologies.

    If we chose to do custom mappings as part of the wizard (“enter your URI”) then we would be forced to add not only the <taglib> entries to the web.xml file, but also the TLD files into the WEB-INF dir someplace. As it stands now you merely need the JARs in your build path and that’s it.

    TO get an idea of what I mean, use WinZip or some other archive program to actually open up your struts.jar file, notice the META-INF dir? Look inside it, see the different TLDs? Open them up, look around the 5th line down, you should see a tag like:
    <uri>http://blahblah</uri&gt;

    That is the default URI that is used to map that taglib without you needing to do anything. So if you use the default URI in your JSP’s, there is no more work to be done.

    #236398 Reply

    kewl, thanks.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: struts taglib JSP entries

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