blob: 6ceb75e9ca5e5e65365c162a8206415fcbb68eaa [file] [log] [blame]
<%@ jet package="org.eclipse.jst.j2ee.web"
imports="org.eclipse.jst.j2ee.internal.web.operations.* java.util.* "
class="ServletTemplate"
%><%@ include file="servletHeader.template" %>
<%if (model.isPublic()) {%>public<%}%> <%if (model.isAbstract()) {%>abstract <%}%><%if (model.isFinal()) {%>final <%}
%>class <%=model.getServletClassName()%><%String superClass = model.getSuperclassName();
if (! "".equals(superClass)) {%> extends <%=superClass%><%}%><%
List interfaces = model.getInterfaces();
if (interfaces.size()>0) {%> implements <% }
for (int i=0; i<interfaces.size(); i++) {
String INTERFACE = (String) interfaces.get(i);
if (i>0) { %>, <%}%><%=INTERFACE%><%}%> {
static final long serialVersionUID = 1L;
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public <%=model.getServletClassName()%>() {
super();
} <% if (model.shouldGenInit()) { %>
/* (non-Javadoc)
* @see javax.servlet.GenericServlet#init()
*/
public void init(ServletConfig config) throws ServletException {
// TODO Auto-generated method stub <% if (model.isGenericServletSuperclass()) { %>
super.init(); <% } %>
} <% } %> <% if (model.shouldGenDestroy()) { %>
/* (non-Javadoc)
* @see javax.servlet.Servlet#destroy()
*/
public void destroy() {
// TODO Auto-generated method stub <% if (model.isGenericServletSuperclass()) { %>
super.destroy(); <% } %>
} <% } %> <% if (model.shouldGenGetServletConfig()) { %>
/* (non-Javadoc)
* @see javax.servlet.Servlet#getServletConfig()
*/
public ServletConfig getServletConfig() {
// TODO Auto-generated method stub <% if (model.isGenericServletSuperclass()) { %>
return super.getServletConfig(); <% } else { %>
return null; <% } %>
} <% } %> <% if (model.shouldGenGetServletInfo()) { %>
/* (non-Javadoc)
* @see javax.servlet.Servlet#getServletInfo()
*/
public String getServletInfo() {
// TODO Auto-generated method stub <% if (model.isGenericServletSuperclass()) { %>
return super.getServletInfo(); <% } else { %>
return null; <% } %>
} <% } %> <% if (model.shouldGenService() && !model.isHttpServletSuperclass()) { %>
/* (non-Java-doc)
* @see javax.servlet.GenericServlet#service(ServletRequest request, ServletResponse response)
*/
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
} <% } %> <% if (model.shouldGenService() && model.isHttpServletSuperclass()) { %>
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
*/
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
super.service(request, response);
} <% } %> <% if (model.shouldGenDoGet()) { %>
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
super.doGet(request, response);
} <% } %> <% if (model.shouldGenDoPost()) { %>
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
super.doPost(request, response);
} <% } %> <% if (model.shouldGenDoPut()) { %>
/* (non-Javadoc)
* @see javax.servlet.http.HttpServlet#doPut(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
super.doPut(request, response);
} <% } %> <% if (model.shouldGenDoDelete()) { %>
/* (non-Javadoc)
* @see javax.servlet.http.HttpServlet#doDelete(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
super.doDelete(request, response);
} <% } %> <% if (model.shouldGenDoHead()) { %>
/* (non-Javadoc)
* @see javax.servlet.http.HttpServlet#doHead(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
super.doHead(request, response);
} <% } %> <% if (model.shouldGenDoOptions()) { %>
/* (non-Javadoc)
* @see javax.servlet.http.HttpServlet#doOptions(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
protected void doOptions(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
super.doOptions(request, response);
} <% } %> <% if (model.shouldGenDoTrace()) { %>
/* (non-Javadoc)
* @see javax.servlet.http.HttpServlet#doTrace(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
protected void doTrace(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
super.doTrace(request, response);
} <% } %>
}