當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpServlet.getServletName方法代碼示例

本文整理匯總了Java中javax.servlet.http.HttpServlet.getServletName方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpServlet.getServletName方法的具體用法?Java HttpServlet.getServletName怎麽用?Java HttpServlet.getServletName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.servlet.http.HttpServlet的用法示例。


在下文中一共展示了HttpServlet.getServletName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: WebgoatContext

import javax.servlet.http.HttpServlet; //導入方法依賴的package包/類
public WebgoatContext(HttpServlet servlet)
{
	this.servlet = servlet;
	databaseConnectionString = getParameter(servlet, DATABASE_CONNECTION_STRING);
	databaseDriver = getParameter(servlet, DATABASE_DRIVER);
	databaseUser = getParameter(servlet, DATABASE_USER);
	databasePassword = getParameter(servlet, DATABASE_PASSWORD);

	// initialize from web.xml
	showParams = "true".equals(getParameter(servlet, SHOWPARAMS));
	showCookies = "true".equals(getParameter(servlet, SHOWCOOKIES));
	showSource = "true".equals(getParameter(servlet, SHOWSOURCE));
	showSolution = "true".equals(getParameter(servlet, SHOWSOLUTION));
	defuseOSCommands = "true".equals(getParameter(servlet, DEFUSEOSCOMMANDS));
	enterprise = "true".equals(getParameter(servlet, ENTERPRISE));
	codingExercises = "true".equals(getParameter(servlet, CODING_EXERCISES));
	feedbackAddressHTML = getParameter(servlet, FEEDBACK_ADDRESS_HTML) != null ? getParameter(servlet,
																								FEEDBACK_ADDRESS_HTML)
			: feedbackAddressHTML;
	feedbackAddress = getParameter(servlet, FEEDBACK_ADDRESS) != null ? getParameter(servlet, FEEDBACK_ADDRESS)
			: feedbackAddress;
	showRequest = "true".equals(getParameter(servlet, SHOWREQUEST));
	isDebug = "true".equals(getParameter(servlet, DEBUG));
	servletName = servlet.getServletName();
	defaultLanguage = getParameter(servlet,DEFAULTLANGUAGE)!=null ? new String(getParameter(servlet, DEFAULTLANGUAGE)): new String("English");
	
	webgoati18n = new WebGoatI18N(this);
	
}
 
開發者ID:RIGS-IT,項目名稱:sonar-xanitizer,代碼行數:30,代碼來源:WebgoatContext.java

示例2: getActivityContext

import javax.servlet.http.HttpServlet; //導入方法依賴的package包/類
/**
 * Find the standalone ActivityContext for this web aspectran service.
 *
 * @param servlet the servlet
 * @return the ActivityContext for this web aspectran service
 */
public static ActivityContext getActivityContext(HttpServlet servlet) {
    ServletContext servletContext = servlet.getServletContext();
    String attrName = STANDALONE_WEB_SERVICE_ATTRIBUTE_PREFIX + servlet.getServletName();
    ActivityContext activityContext = getActivityContext(servletContext, attrName);
    if (activityContext == null) {
        return getActivityContext(servletContext);
    }
    return activityContext;
}
 
開發者ID:aspectran,項目名稱:aspectran,代碼行數:16,代碼來源:AspectranWebService.java


注:本文中的javax.servlet.http.HttpServlet.getServletName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。