tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28168] New: - patch to add webdoclet tags to jspc output
Date Fri, 02 Apr 2004 20:16:52 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28168>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

patch to add webdoclet tags to jspc output

           Summary: patch to add webdoclet tags to jspc output
           Product: Tomcat 4
           Version: Nightly Build
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: toby@caboteria.org


Hi!  I like to compile jsp pages into servlets before putting them into
production, and I also like to use webdoclet to generate web.xml.  This patch
lets me do both.  It just adds a class comment with a couple of webdoclet tages
to jspc's output classes.

Index: jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java
===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
retrieving revision 1.38
diff -u -u -r1.38 JspParseEventListener.java
--- jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java     
21 May 2002 01:40:13 -0000   1.38
+++ jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java     
2 Apr 2004 20:08:55 -0000
@@ -257,10 +257,10 @@
     }
  
     private void generateHeader() throws JasperException {
-        String servletPackageName = ctxt.getServletPackageName();
+        String servletPackageName = null == ctxt.getServletPackageName() ? "" :
ctxt.getServletPackageName();
         String servletClassName = ctxt.getServletClassName();
         // First the package name:
-        if (! "".equals(servletPackageName) && servletPackageName != null) {
+        if (! "".equals(servletPackageName)) {
             writer.println("package "+servletPackageName+";");
             writer.println();
         }
@@ -273,6 +273,11 @@
        generateAll(FileDeclarationPhase.class);
        writer.println();
  
+        writer.println("/**");
+        writer.println(" * @web.servlet name=\"" + servletPackageName + "." +
servletClassName + "\"");
+        writer.println(" * @web.servlet-mapping url-pattern=\"" +
ctxt.getJspFile() + "\"");
+        writer.println(" */");
+
        writer.print("public class "+servletClassName+ " extends ");
        writer.print(extendsClass.equals("") ? jspServletBase : extendsClass);

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message