| /** |
| * Servlet Filter implementation class <%= model.getClassName() %> |
| <% |
| if (model.isAnnotated()) { |
| %> |
| * |
| * @web.filter |
| * name="<%= model.getFilterName() %>" |
| * display-name="<%= model.getFilterName() %>" |
| <% |
| if (model.getDescription() != null && model.getDescription().length() > 0) { |
| %> |
| * description="<%= model.getDescription() %>" |
| <% |
| } |
| |
| List<IFilterMappingItem> mappings = model.getFilterMappings(); |
| for (IFilterMappingItem mapping : mappings) { |
| %> |
| * |
| * @web.filter-mapping |
| <% |
| if (mapping.isUrlPatternType()) { |
| %> |
| * url-pattern="<%= mapping.getName() %>" |
| <% |
| } else if (mapping.isServletNameType()) { |
| %> |
| * servlet-name="<%= mapping.getName() %>" |
| <% |
| } |
| |
| String dispatcher = model.getDispatcherList(mapping); |
| if (dispatcher.length() > 0) { |
| %> |
| * dispatcher="<%= dispatcher %>" |
| <% |
| } |
| } |
| |
| List<String[]> initParams = model.getInitParams(); |
| if (initParams != null && initParams.size() > 0) { |
| for (int i = 0; i < initParams.size(); i++) { |
| String name = model.getInitParam(i, CreateFilterTemplateModel.NAME); |
| String value = model.getInitParam(i, CreateFilterTemplateModel.VALUE); |
| String description = model.getInitParam(i, CreateFilterTemplateModel.DESCRIPTION); |
| %> |
| * |
| * @web.filter-init-param |
| * name="<%= name %>" |
| * value="<%= value %>" |
| <% |
| if (description != null && description.length() > 0) { |
| %> |
| * description="<%= description %>" |
| <% |
| } |
| } |
| } |
| } |
| %> |
| */ |