You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Kin-Man Chung <Ki...@Eng.Sun.COM> on 2001/09/18 02:08:35 UTC

[PATCH] Jspc throws NPE when used without -webapp

This patch fixes the reopen #3529.  Now jspc works for taglib when -webapp is
not specified.

The logic used in JspC.java to get the uri root and base is still very
convoluted and should be a prime target for rewrite, maybe later.


misto% runsocks cvs diff -u JspC.java
Index: JspC.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspC.java,
v
retrieving revision 1.11
diff -u -r1.11 JspC.java
--- JspC.java   2001/09/14 05:02:15     1.11
+++ JspC.java   2001/09/17 23:37:53
@@ -699,6 +699,16 @@
             } else {
                 try {
                     if (ubase != null) {
+                        try {
+                            JspCServletContext context =
+                                new JspCServletContext
+                                (new PrintWriter(System.out),
+                                 new URL("file:" + ubase.replace('\\','/') + 
"/"));
+                            tldLocationsCache = new TldLocationsCache(context);
+                        } catch (MalformedURLException me) {
+                            System.out.println("**" + me);
+                        }
+
                         File fjsp = new File(file);
                         String s = fjsp.getCanonicalPath();
                         if (s.startsWith(ubase)) {


Re: [PATCH] Jspc throws NPE when used without -webapp

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Thanks Kin-Man.  Can you validate the proposed patch for #3640 as well,
if it is still needed?

Craig


On Mon, 17 Sep 2001, Kin-Man Chung wrote:

> Date: Mon, 17 Sep 2001 17:08:35 -0700 (PDT)
> From: Kin-Man Chung <Ki...@Eng.Sun.COM>
> Reply-To: tomcat-dev@jakarta.apache.org,
>      Kin-Man Chung <Ki...@Eng.Sun.COM>
> To: tomcat-dev@jakarta.apache.org
> Subject: [PATCH] Jspc throws NPE when used without -webapp
>
> This patch fixes the reopen #3529.  Now jspc works for taglib when -webapp is
> not specified.
>
> The logic used in JspC.java to get the uri root and base is still very
> convoluted and should be a prime target for rewrite, maybe later.
>
>
> misto% runsocks cvs diff -u JspC.java
> Index: JspC.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/JspC.java,
> v
> retrieving revision 1.11
> diff -u -r1.11 JspC.java
> --- JspC.java   2001/09/14 05:02:15     1.11
> +++ JspC.java   2001/09/17 23:37:53
> @@ -699,6 +699,16 @@
>              } else {
>                  try {
>                      if (ubase != null) {
> +                        try {
> +                            JspCServletContext context =
> +                                new JspCServletContext
> +                                (new PrintWriter(System.out),
> +                                 new URL("file:" + ubase.replace('\\','/') +
> "/"));
> +                            tldLocationsCache = new TldLocationsCache(context);
> +                        } catch (MalformedURLException me) {
> +                            System.out.println("**" + me);
> +                        }
> +
>                          File fjsp = new File(file);
>                          String s = fjsp.getCanonicalPath();
>                          if (s.startsWith(ubase)) {
>
>