Anonymous | Login | Signup for a new account | 12-17-2024 10:39 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0002385 | [Resin] | minor | always | 01-30-08 18:08 | 01-30-08 19:12 | ||||
Reporter | sam | View Status | public | ||||||
Assigned To | sam | ||||||||
Priority | normal | Resolution | fixed | Platform | |||||
Status | closed | OS | |||||||
Projection | none | OS Version | |||||||
ETA | none | Fixed in Version | 3.1.5 | Product Version | 3.1.4 | ||||
Product Build | |||||||||
Summary | 0002385: Allow extension of SSI with custom commands | ||||||||
Description |
Provide plugin mechanism to allow, for example <!--#mycommand a="hello" --> |
||||||||
Steps To Reproduce | |||||||||
Additional Information | |||||||||
Attached Files | |||||||||
|
Notes | |
(0002701) sam 01-30-08 19:12 |
server/198d, server/1961 Example usage: ---- WEB-INF/resin-web.xml -------------------------------------- <web-app xmlns="http://caucho.com/ns/resin"> [^] <filter filter-name='ssi' filter-class='com.caucho.servlets.ssi.SSIFilter'> <init> <factory resin:type="qa.MySSIFactory"/> </init> </filter> <filter-mapping url-pattern='*.php' filter-name='ssi'/> </web-app> ---- WEB-INF/classes/qa/MySSIFactory.java -------------------------- package qa; import com.caucho.servlets.ssi.SSIFactory; import com.caucho.vfs.Path; import com.caucho.servlets.ssi.Statement; import java.util.HashMap; public class MySSIFactory extends SSIFactory { public Statement createStatement(String cmd, HashMap<String,String> attr, Path path) { if ("foo".equals(cmd)) return new FooStatement(attr); else return super.createStatement(cmd, attr, path); } } ---- WEB-INF/classes/qa/FooStatement.java ------------------------------- package qa; import com.caucho.servlets.ssi.Statement; import com.caucho.vfs.WriteStream; import java.io.IOException; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class FooStatement extends Statement { private String _a; public FooStatement(HashMap<String, String> attr) { _a = attr.get("a"); } public void apply(WriteStream out, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { out.print("foo(" + _a + ")"); } } ---- test.php ---------------------------------- <h1>A little test</h1> <!--#foo a="hello" --> <h1>End of test</h1> |
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed. 25 unique queries executed. |