1 16 17 package org.apache.jk.config; 18 19 import java.io.File ; 20 import java.io.FileWriter ; 21 import java.io.IOException ; 22 import java.io.PrintWriter ; 23 import java.util.Vector ; 24 25 26 47 48 52 public class GeneratorJk1 implements WebXml2Jk.MappingGenerator { 53 WebXml2Jk wxml; 54 String vhost; 55 String cpath; 56 String worker; 57 PrintWriter out; 58 59 public void setWebXmlReader(WebXml2Jk wxml ) { 60 this.wxml=wxml; 61 vhost=wxml.vhost; 62 cpath=wxml.cpath; 63 worker=wxml.worker; 64 } 65 66 public void generateStart( ) throws IOException { 67 File base=wxml.getJkDir(); 68 File outF=new File (base, "jk.conf"); 69 out=new PrintWriter ( new FileWriter ( outF )); 70 71 out.println("# This must be included in the virtual host section for " + vhost ); 72 } 73 74 public void generateEnd() { 75 out.close(); 76 } 77 78 79 public void generateServletMapping( String servlet, String url ) { 80 out.println( "JkMount " + cpath + url + " " + worker); 81 } 82 83 public void generateFilterMapping( String servlet, String url ) { 84 out.println( "JkMount " + cpath + url + " " + worker); 85 } 86 87 public void generateLoginConfig( String loginPage, 88 String errPage, String authM ) { 89 out.println( "JkMount " + cpath + loginPage + " " + worker); 90 } 91 92 public void generateErrorPage( int err, String location ) { 93 94 } 95 96 public void generateMimeMapping( String ext, String type ) { 97 98 } 99 100 public void generateWelcomeFiles( Vector wf ) { 101 102 } 103 104 105 public void generateConstraints( Vector urls, Vector methods, Vector roles, boolean isSSL ) { 106 for( int i=0; i<urls.size(); i++ ) { 107 String url=(String )urls.elementAt(i); 108 109 out.println( "JkMount " + cpath + url + " " + worker); 110 } 111 } 112 } 113 | Popular Tags |