luehe 2004/05/18 14:16:46
Modified: jasper2/src/share/org/apache/jasper JspC.java
Log:
Added setJspFiles() method, to allow comma-separated list of JSPs to be specified
from ant
Revision Changes Path
1.79 +27 -6
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
Index: JspC.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- JspC.java 18 May 2004 19:02:48 -0000 1.78
+++ JspC.java 18 May 2004 21:16:46 -0000 1.79
@@ -513,6 +513,21 @@
}
}
+ /*
+ * Parses comma-separated list of JSP files to be processed.
+ *
+ * <p>Each file is interpreted relative to uriroot, unless it is absolute,
+ * in which case it must start with uriroot.
+ *
+ * @param jspFiles Comma-separated list of JSP files to be processed
+ */
+ public void setJspFiles(String jspFiles) {
+ StringTokenizer tok = new StringTokenizer(jspFiles, " ,");
+ while (tok.hasMoreTokens()) {
+ pages.addElement(tok.nextToken());
+ }
+ }
+
public void setCompile( boolean b ) {
compile=b;
}
@@ -843,18 +858,20 @@
locateUriRoot( firstJspF );
}
- if( context==null )
+ if (uriRoot == null) {
+ throw new JasperException(
+ Localizer.getMessage("jsp.error.jspc.no_uriroot"));
+ }
+
+ if( context==null ) {
initServletContext();
+ }
- // No explicit page, we'll process all .jsp in the webapp
+ // No explicit pages, we'll process all .jsp in the webapp
if (pages.size() == 0) {
scanFiles( new File( uriRoot ));
}
- if (uriRoot == null) {
- throw new JasperException(
- Localizer.getMessage("jsp.error.jspc.no_uriroot"));
- }
File uriRootF = new File(uriRoot);
if (!uriRootF.exists() || !uriRootF.isDirectory()) {
throw new JasperException(
@@ -867,6 +884,9 @@
while (e.hasMoreElements()) {
String nextjsp = e.nextElement().toString();
File fjsp = new File(nextjsp);
+ if (!fjsp.isAbsolute()) {
+ fjsp = new File(uriRootF, nextjsp);
+ }
if (!fjsp.exists()) {
if (log.isWarnEnabled()) {
log.warn
@@ -1116,4 +1136,5 @@
// pass straight through
}
}
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]