Announcement Announcement Module
Collapse
No announcement yet.
useless packaging of authz.tld? Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • useless packaging of authz.tld?

    I am confused because the authz.tld packaged inside the jar is unusable. To use it, the developer has to extract the tld file and put it in their war file.

    From my understanding, there is absolutely no way for an application to utilize this tld file (inside a jar). If one wants to load a tld file from a jar, the tld needs to be located in the jar as "META-INF/taglib.tld"

    Then this would work:
    <%@ taglib uri='/WEB-INF/lib/acegi-security-1.0.3.jar' prefix='authz' %>

    I am going to extract the tld file and add this to my jsp:
    <%@ taglib uri='/WEB-INF/tlds/authz.tld' prefix='authz' %>

    If I am incorrect, please straighten me out. If I am correct, how about renaming authz.tld to taglib.tld?

    BTW, using tomcat 5.0.28

    Phillip

  • #2
    Have you had a read of the reference manual?
    All taglib classes are included in the core acegi-security-xx.jar file, with the authz.tld located in the JAR's META-INF directory. This means for JSP 1.2+ web containers you can simply include the JAR in the WAR's WEB-INF/lib directory and it will be available. If you're using a JSP 1.1 container, you'll need to declare the JSP taglib in your web.xml file, and include authz.tld in the WEB-INF/lib directory. The following fragment is added to web.xml:
    Code:
    <taglib>
      <taglib-uri>http://acegisecurity.org/authz</taglib-uri>
      <taglib-location>/WEB-INF/authz.tld</taglib-location>
    </taglib>
    http://www.acegisecurity.org/docbook/acegi.html#taglib

    Comment


    • #3
      I did read the documentation and that is why I posted.

      Tomcat 5.x is a JSP 2.0 container.

      Putting the jar into the lib directory does not make it automatically make it available. At least in my case, it did not process the authz tags in my jsp.

      Afterwhich the tag was not processed, I added this to my jsp
      <%@ taglib uri='/WEB-INF/lib/acegi-security-1.0.3.jar' prefix='authz' %>

      The JSP errored out stating that the /META-INF/taglib.tld could not be found inside acegi-security-1.0.3.jar

      It's okay now (having extracted the tld from the jar), but my original point still holds true. Thanks for your response.

      Phillip

      Comment


      • #4
        So if you leave everything as it was originally and then simply include the correct taglib, it doesn't work?
        e.g.
        Code:
        <%@ taglib prefix='authz' uri='http://acegisecurity.org/authz' %>

        Comment


        • #5
          Strange we simply put the tags in place in our default include and it all worked. Without changing jars, wars of whatever. Do you have the correct acegi jar downloaded from the acegi website?

          Comment


          • #6
            I dropped the acegi-security-sample-tutorial WAR in webapps and fired up Tomcat. I pasted the authz tag in to print out the username, it didn't work. I add the taglib include (shown on my previous post) and everything worked fine.

            Comment


            • #7
              Thanks

              Thanks for clearing it up.

              From the documentation, I thought since i had a JSP 1.2+ container, the tag would just work. I didn't see anything about adding the taglib declaration to the jsp page.
              <%@ taglib prefix='authz' uri='http://acegisecurity.org/authz' %>


              I appreciate your help very much.

              Comment


              • #8
                With JSP 1.2 or up you can ommit the part from the web.xml. You still need the taglib declaration in the jsp pages.

                Comment


                • #9
                  Lets clear this up once and for all.
                  http://opensource.atlassian.com/proj...browse/SEC-455

                  Comment


                  • #10
                    Hi all!
                    Just a question: I included this in my jsp page:
                    Code:
                    <%@ taglib uri='http://acegisecurity.org/authz' prefix='authz'%>
                    but what happens if the uri='http://acegisecurity.org/authz' is down?
                    Should Have I a copy of xml for well-formed validation?

                    Thanks

                    Comment


                    • #11
                      Isn't this URL simply related to the information in the authz.tld file?
                      Code:
                      	<tlib-version>1.0</tlib-version>
                      	<jsp-version>1.2</jsp-version>
                      	<short-name>authz</short-name>
                      	<uri>http://acegisecurity.org/authz</uri>
                      	<description>
                              Acegi Security Systems Authorization Tag Library
                      		$Id: authz.tld 1754 2006-11-17 02:01:21 +0000 (Fri, 17 Nov 2006) benalex $
                      	</description>

                      Comment


                      • #12
                        Karl, try to use auth tag in your jsp page and then close your internet connection.
                        Does it work?
                        Mine don't.

                        What am I missing?

                        Comment


                        • #13
                          Ok, I'll give it a try when I get home from work.

                          Comment


                          • #14
                            Originally posted by rhodebump View Post
                            I am confused because the authz.tld packaged inside the jar is unusable. To use it, the developer has to extract the tld file and put it in their war file.

                            From my understanding, there is absolutely no way for an application to utilize this tld file (inside a jar). If one wants to load a tld file from a jar, the tld needs to be located in the jar as "META-INF/taglib.tld"

                            Then this would work:
                            <%@ taglib uri='/WEB-INF/lib/acegi-security-1.0.3.jar' prefix='authz' %>

                            I am going to extract the tld file and add this to my jsp:
                            <%@ taglib uri='/WEB-INF/tlds/authz.tld' prefix='authz' %>

                            If I am incorrect, please straighten me out. If I am correct, how about renaming authz.tld to taglib.tld?

                            BTW, using tomcat 5.0.28

                            Phillip
                            The jsf-1_1_01 jar file has both html_basic.tld and jsf_core.tld in the jar file at /meta-inf. But I'm reading confusing JSP specs from sun that say a taglib in a jar file must be stored at meta-inf/taglib.tld.

                            If JSF jar files stored to tld's in the same jar, how can you define a prefix for each tld, if you use the jar file syntax for the URI. There must be some way to reference the tld file name in the jar when you use the jar reference. Is there some way to specify files in a jar with a special syntax?

                            Also, you might find this of interest although it changed nothing for me when I located tomcat to a directory with no spaces in the path:

                            http://issues.apache.org/bugzilla/show_bug.cgi?id=42202

                            Comment

                            Working...
                            X