本文整理匯總了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);
}
示例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;
}