9 Replies Latest reply on Jul 13, 2006 7:19 PM by 807567

    JSTL and SUNOne Web Server 6.1 SP2

    807567
      I would like to use JSTL tags in my JSP files located in the SUNWwbsvr/docs directory. I created a WEB-INF/lib directory under the docs directory, copied the JSTL jar files, and modified my JSP to use a JSTL tag.....but this did not work.

      Any Ideas?
        • 1. Re: JSTL and SUNOne Web Server 6.1 SP2
          807567
          Here is what I've done:

          I copied the c.tld and x.tld files to the SUNWwbsvr/docs/WEB-INF directory and added <taglib> entries in SUNWwbsvr/docs/WEB-INF/web.xml. When I ran my JSP, the server returned an error stating that it could not find /WEB-INF/c.tld. I moved the c.tld and x.tld files to SUNWwbsvr/docs, modifed my web.xml to reflect this...and the JSP file found the tld files. If I move the TLD's to a directory called SUNWwbsvr/docs/tlds, modify the web.xml, and rerun the JSP file....it finds the TLD's and works fine.

          So my question is: Why can I move the TLD's to SUNWwbsvr/docs/tlds and the web server finds them, but if I move them to SUNWwbsvr/docs/WEB-INF the server cannot find them?
          • 2. Re: JSTL and SUNOne Web Server 6.1 SP2
            807567
            Ok....got it to work.....here is whats going on: the directory /opt/SUNWwbsvr/docs appears to be the default WEB-INF. So...if you want the TLD's to reside in the WEB-INF directory...you would have to say <taglib-location>/WEB-INF/WEB-INF/c.tld</taglib-location>

            This is why if you just have <taglib-location>/WEB-INF/c.tld</taglib-location> in the web.xml....then copy the c.tld to the /opt/SUNWwbsvr/docs directory...everything works just fine...

            How did I figure this out: If you enter <taglib-location>./WEB-INF/c.tld</taglib-location> in the web.xml....look at the error log and it will say something like: Can't find TLD at /WEB-INF/./WEB-INF/c.tld
            • 3. Re: JSTL and SUNOne Web Server 6.1 SP2
              807567
              ignore my last post....this DOES NOT work.
              • 4. Re: JSTL and SUNOne Web Server 6.1 SP2
                807567
                In Web Server 6.1 and Service Packs, legacy servlets is not supported and do not work.

                While JSPs do work it is not supported and it will not be able to lookup "Webapp" resources like WEB-INF\lib even if you create it in the doc root. You will need to package your JSPa and TLDs as a webapp (WAR) and deploy it on the webserver for this to work.
                • 5. Re: JSTL and SUNOne Web Server 6.1 SP2
                  807567
                  In Web Server 6.1 and Service Packs, legacy servlets
                  is not supported and do not work.

                  While JSPs do work it is not supported and it will
                  not be able to lookup "Webapp" resources like
                  WEB-INF\lib even if you create it in the doc root.
                  You will need to package your JSPa and TLDs as a
                  webapp (WAR) and deploy it on the webserver for this
                  to work.
                  Hi Hari
                  Could you expalin this further. I was unable to run examples from JavaServer Pages ver.3 by Hans Bergsten on my Sun ONE web server 6.1
                  I kept getting JSTL errors... complaing about the uri issue. The book examples are download-able but they don't come in war file. I tried creating a war file but received further errors.

                  here are the errors:

                  GET /myapp/login.jsp, service-j2ee reports: StandardWrapperValve[jsp]: WEB2792: Servlet.service() for servlet jsp threw exception
                  org.apache.jasper.JasperException: WEB4117: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application


                  Hari, you seem to have some insight to it. Do you have a work around for this issue. Is it possible that you could email me directly.
                  EMal: hmdasti a_t yahoo . com

                  I thank you for your help in advance.

                  hm dasti
                  • 6. Re: JSTL and SUNOne Web Server 6.1 SP2
                    807567
                    I am trying to execute a JSP page which has JSTL code too.
                    I am using sun one webserver 6.1.I had cpied all the tld files to WebServer6.1\bin\https\webapps\user-app\WEB-INF,also i had added this to WebServer6.1\bin\https\webapps\user-app\WEB-INF\web.xml

                    <taglib>
                    <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
                    <taglib-location>fmt.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
                    <taglib-location>fmt-rt.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
                    <taglib-location>c.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
                    <taglib-location>c-rt.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
                    <taglib-location>sql.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
                    <taglib-location>/WEB-INF/sql-rt.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
                    <taglib-location>/WEB-INF/x.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
                    <taglib-location>/WEB-INF/x-rt.tld</taglib-location>
                    </taglib>

                    but still it is giving this error....

                    org.apache.jasper.JasperException: WEB4117: This absolute uri (http://java.sun.c
                    om/jstl/core) cannot be resolved in either web.xml or the jar files deployed wit
                    h this application
                    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoIm
                    pl.java:194)
                    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoIm
                    pl.java:174)
                    at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirecti
                    ve(JspParseEventListener.java:1218)
                    at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspP
                    arseEventListener.java:802)
                    at org.apache.jasper.compiler.DelegatingListener.handleDirective(Delegat
                    ingListener.java:125)

                    Kindly tell me what is the reason........

                    Thanks
                    Mridul.
                    • 7. Re: JSTL and SUNOne Web Server 6.1 SP2
                      807567
                      I am having the same problem of org.apache.jasper.JasperException: WEB4117: This absolute uri (http://java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application

                      Anyone knows why? Thanks!
                      • 8. Re: JSTL and SUNOne Web Server 6.1 SP2
                        807567
                        If I changed the index.jsp to index.html, the problem goes away. The Sun ONE document did say what special configuration is required to run JSP.
                        • 9. Re: JSTL and SUNOne Web Server 6.1 SP2
                          807567
                          I have not yet done this on my own system (I will try it tonight), but generally, you will need to create a Web application:

                          Use the SWS admin tool to create and deploy a Web application. In that Web application directory, include your files in the /WEB-INF/ directory. I.e. you cannot simply use that /SUNWwbsvr/docs directory, because that is not a Web application directory. As the other poster said, you might be able to run simple JSPs from that directory, but it's not a Web application directory in which you can "install" and run the JSTL.

                          So, in other words, the /SUNWwbsvr/docs directory is just a sort of dummy directory in which you can place (and run) certain simple Web stuff. However, to use programming elements that relate to Web applications, you'll actually have to set up a Web application in the server. It's fairly easy, but you may want to look at the Sun documentation for the exact steps on how to do that.

                          dailysun