<html>
<head>
<title>jsp lookup module</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../lookupMod.js"></script>
<script language="JavaScript">
var BOOK_NAME = "O'REILLY - Référence JSP";
var KEYWORDS = new Array(
		"addCookie", "response", "addCookie",
		"addDateHeader", "response", "addDateHeader",
		"addHeader", "response", "addHeader",
		"addIntHeader", "response", "addIntHeader",
		"align", "jsp:plugin", "align",
		"application", "application", "Description",
		"archive", "jsp:plugin", "archive",
		"autoFlush", "Page Directrice", "autoFlush",
		"beanName", "jsp:useBean", "beanName",
		"BodyContent", "BodyContent Classe", "BodyContent",
		"BodyTag", "BodyTag Interface", "Description",
		"BodyTagSupport", "BodyTagSupport Classe", "BodyTagSupport",
		"buffer", "Page Directrice", "buffer",
		"class", "jsp:useBean", "class",
		"clear", "out", "clear",
		"clearBody", "BodyContent Classe", "clearBody",
		"clearBuffer", "out", "clearBuffer",
		"close", "out", "close",
		"code", "jsp:plugin", "code",
		"codebase", "jsp:plugin", "codebase",
		"config", "config", "Description",
		"containsHeader", "response", "containsHeader",
		"contentType", "Page Directrice", "contentType",
		"doAfterBody", "BodyTag Interface", "doAfterBody",
		"doAfterBody", "BodyTagSupport Classe", "doAfterBody",
		"doEndTag", "BodyTagSupport Classe", "doEndTag",
		"doEndTag", "Tag Interface", "doEndTag",
		"doEndTag", "TagSupport Classe", "doEndTag",
		"doInitBody", "BodyTag Interface", "doInitBody",
		"doInitBody", "BodyTagSupport Classe", "doInitBody",
		"doStartTag", "Tag Interface", "doStartTag",
		"doStartTag", "TagSupport Classe", "doStartTag",
		"encodeRedirectURL", "response", "encodeRedirectURL",
		"encodeRedirectUrl", "response", "encodeRedirectUrl",
		"encodeURL", "response", "encodeURL",
		"encodeUrl", "response", "encodeUrl",
		"errorPage", "Page Directrice", "errorPage",
		"exception", "exception", "Description",
		"extends", "Page Directrice", "extends",
		"file", "Include Directrice", "file",
		"findAncestorWithClass", "TagSupport Classe", "findAncestorWithClass",
		"findAttribute", "pageContext", "findAttribute",
		"include.flush", "jsp:include", "flush",
		"flush", "BodyContent Classe", "flush",
		"flush", "out", "flush",
		"flushBuffer", "response", "flushBuffer",
		"forward", "pageContext", "forward",
		"getAttribute", "application", "getAttribute",
		"getAttribute", "pageContext", "getAttribute",
		"request.getAttribute", "request", "getAttribute",
		"session.getAttribute", "session", "getAttribute",
		"getAttribute", "TagData Classe", "getAttribute",
		"getAttributeNames", "application", "getAttributeNames",
		"request.getAttributeNames", "request", "getAttributeNames",
		"session.getAttributeNames", "session", "getAttributeNames",
		"getAttributeNamesInScope", "pageContext", "getAttributeNamesInScope",
		"getAttributesScope", "pageContext", "getAttributesScope",
		"getAttributeString", "TagData Classe", "getAttributeString",
		"getAuthType", "request", "getAuthType",
		"getBodyContent", "BodyTagSupport Classe", "getBodyContent",
		"getBufferSize", "out", "getBufferSize",
		"getBufferSize", "response", "getBufferSize",
		"getCharacterEncoding", "request", "getCharacterEncoding",
		"getCharacterEncoding", "response", "getCharacterEncoding",
		"getClassName", "VariableInfo Classe", "getClassName",
		"getContentLength", "request", "getContentLength",
		"getContentType", "request", "getContentType",
		"getContext", "application", "getContext",
		"getContextPath", "request", "getContextPath",
		"getCookies", "request", "getCookies",
		"getCreationTime", "session", "getCreationTime",
		"getDateHeader", "request", "getDateHeader",
		"getDeclare", "VariableInfo Classe", "getDeclare",
		"getEnclosingWriter", "BodyContent Classe", "getEnclosingWriter",
		"getException", "pageContext", "getException",
		"getHeader", "request", "getHeader",
		"getHeaderNames", "request", "getHeaderNames",
		"getHeaders", "request", "getHeaders",
		"session.getId", "session", "getId",
		"getId", "TagData Classe", "getId",
		"getId", "TagSupport Classe", "getId",
		"getInitParameter", "application", "getInitParameter",
		"getInitParameter", "config", "getInitParameter",
		"getInitParameterNames", "application", "getInitParameterNames",
		"getInitParameterNames", "config", "getInitParameterNames",
		"getInputStream", "request", "getInputStream",
		"getIntHeader", "request", "getIntHeader",
		"getLastAccessedTime", "session", "getLastAccessedTime",
		"getLocale", "request", "getLocale",
		"getLocale", "response", "getLocale",
		"getLocales", "request", "getLocales",
		"getMajorVersion", "application", "getMajorVersion",
		"getMaxInactiveInterval", "session", "getMaxInactiveInterval",
		"getMethod", "request", "getMethod",
		"getMimeType", "application", "getMimeType",
		"getMinorVersion", "application", "getMinorVersion",
		"getNamedDispatcher", "application", "getNamedDispatcher",
		"getOut", "pageContext", "getOut",
		"getOutputStream", "response", "getOutputStream",
		"getPage", "pageContext", "getPage",
		"getParameter", "request", "getParameter",
		"getParameterNames", "request", "getParameterNames",
		"getParameterValues", "request", "getParameterValues",
		"getParent", "Tag Interface", "getParent",
		"getParent", "TagSupport Classe", "getParent",
		"getPathInfo", "request", "getPathInfo",
		"getPathTranslated", "request", "getPathTranslated",
		"getPreviousOut", "BodyTagSupport Classe", "getPreviousOut",
		"getProtocol", "request", "getProtocol",
		"getQueryString", "request", "getQueryString",
		"getReader", "BodyContent Classe", "getReader",
		"getReader", "request", "getReader",
		"getRealPath", "application", "getRealPath",
		"getRealPath", "request", "getRealPath",
		"getRemaining", "out", "getRemaining",
		"getRemoteAddr", "request", "getRemoteAddr",
		"getRemoteHost", "request", "getRemoteHost",
		"getRemoteUser", "request", "getRemoteUser",
		"getRequest", "pageContext", "getRequest",
		"getRequestDispatcher", "application", "getRequestDispatcher",
		"getRequestDispatcher", "request", "getRequestDispatcher",
		"getRequestedSessionId", "request", "getRequestedSessionId",
		"getRequestURI", "request", "getRequestURI",
		"getResource", "application", "getResource",
		"getResourceAsStream", "application", "getResourceAsStream",
		"getResponse", "pageContext", "getResponse",
		"getScheme", "request", "getScheme",
		"getScope", "VariableInfo Classe", "getScope",
		"getServerInfo", "application", "getServerInfo",
		"getServerName", "request", "getServerName",
		"getServerPort", "request", "getServerPort",
		"getServlet", "application", "getServlet",
		"getServletConfig", "pageContext", "getServletConfig",
		"getServletContext", "config", "getServletContext",
		"getServletContext", "pageContext", "getServletContext",
		"getServletName", "config", "getServletName",
		"getServletNames", "application", "getServletNames",
		"getServletPath", "request", "getServletPath",
		"getServlets", "application", "getServlets",
		"getSession", "pageContext", "getSession",
		"getSession", "request", "getSession",
		"getSession", "request", "getSession",
		"getSessionContext", "session", "getSessionContext",
		"getString", "BodyContent Classe", "getString",
		"getTagInfo", "TagExtraInfo Classe", "getTagInfo",
		"getUserPrincipal", "request", "getUserPrincipal",
		"getValue", "session", "getValue",
		"getValue", "TagSupport Classe", "getValue",
		"getValueNames", "session", "getValueNames",
		"getValues", "TagSupport Classe", "getValues",
		"getVariableInfo", "TagExtraInfo Classe", "getVariableInfo",
		"getVarName", "VariableInfo Classe", "getVarName",
		"getWriter", "response", "getWriter",
		"handlePageException", "pageContext", "handlePageException",
		"height", "jsp:plugin", "height",
		"hspace", "jsp:plugin", "hspace",
		"id", "jsp:useBean", "id",
		"iepluginurl", "jsp:plugin", "iepluginurl",
		"import", "Page Directrice", "import",
		"Include", "Include Directrice", "Description",
		"include", "pageContext", "include",
		"info", "Page Directrice", "info",
		"initialize", "pageContext", "initialize",
		"invalidate", "session", "invalidate",
		"isAutoFlush", "out", "isAutoFlush",
		"isCommitted", "response", "isCommitted",
		"isErrorPage", "Page Directrice", "isErrorPage",
		"isNew", "session", "isNew",
		"isRequestedSessionIdFromCookie", "request", "isRequestedSessionIdFromCookie",
		"isRequestedSessionIdFromURL", "request", "isRequestedSessionIdFromURL",
		"isRequestedSessionIdValid", "request", "isRequestedSessionIdValid",
		"isRequestSessionIdFromUrl", "request", "isRequestSessionIdFromUrl",
		"isSecure", "request", "isSecure",
		"isThreadSafe", "Page Directrice", "isThreadSafe",
		"isUserInRole", "request", "isUserInRole",
		"isValid", "TagExtraInfo Classe", "isValid",
		"jreversion", "jsp:plugin", "jreversion",
		"jsp:fallback", "jsp:fallback", "Description",
		"jsp:forward", "jsp:forward", "Description",
		"jsp:getProperty", "jsp:getProperty", "Description",
		"jsp:include", "jsp:include", "Description",
		"jsp:param", "jsp:param", "Description",
		"jsp:params", "jsp:params", "Description",
		"jsp:plugin", "jsp:plugin", "Description",
		"jsp:setProperty", "jsp:setProperty", "Description",
		"jsp:useBean", "jsp:useBean", "Description",
		"JspWriter", "out", "JspWriter",
		"language", "Page Directrice", "language",
		"log", "application", "log",
		"log", "application", "logDeprecated",
		"getProperty.name", "jsp:getProperty", "name",
		"param.name", "jsp:param", "name",
		"plugin.name", "jsp:plugin", "name",
		"setProperty.name", "jsp:setProperty", "name",
		"nspluginurl", "jsp:plugin", "nspluginurl",
		"out", "out", "Description",
		"forward.page", "jsp:forward", "page",
		"include.page", "jsp:include", "page",
		"Page", "Page Directrice", "Description",
		"page", "page", "Description",
		"pageContext", "pageContext", "Description",
		"PageContext", "pageContext", "PageContext",
		"param", "jsp:setProperty", "param",
		"popBody", "pageContext", "popBody",
		"prefix", "Taglib Directrice", "prefix",
		"getProperty.property", "jsp:getProperty", "property",
		"property", "jsp:setProperty", "property",
		"pushBody", "pageContext", "pushBody",
		"putValue", "session", "putValue",
		"release", "BodyTagSupport Classe", "release",
		"release", "pageContext", "release",
		"release", "Tag Interface", "release",
		"release", "TagSupport Classe", "release",
		"removeAttribute", "pageContext", "removeAttribute",
		"request.removeAttribute", "request", "removeAttribute",
		"session.removeAttribute", "session", "removeAttribute",
		"session.removeValue", "session", "removeValue",
		"removeValue", "TagSupport Classe", "removeValue",
		"request", "request", "Description",
		"reset", "response", "reset",
		"response", "response", "Description",
		"scope", "jsp:useBean", "scope",
		"sendError", "response", "sendError",
		"sendRedirect", "response", "sendRedirect",
		"session", "Page Directrice", "session",
		"session", "session", "Description",
		"setAttribute", "application", "setAttribute",
		"setAttribute", "pageContext", "setAttribute",
		"request.setAttribute", "request", "setAttribute",
		"session.setAttribute", "session", "setAttribute",
		"setAttribute", "TagData Classe", "setAttribute",
		"setBodyContent", "BodyTag Interface", "setBodyContent",
		"setBodyContent", "BodyTagSupport Classe", "setBodyContent",
		"setBufferSize", "response", "setBufferSize",
		"setContentLength", "response", "setContentLength",
		"setContentType", "response", "setContentType",
		"setDateHeader", "response", "setDateHeader",
		"setHeader", "response", "setHeader",
		"setId", "TagSupport Classe", "setId",
		"setIntHeader", "response", "setIntHeader",
		"setLocale", "response", "setLocale",
		"setMaxInactiveInterval", "session", "setMaxInactiveInterval",
		"setPageContext", "Tag Interface", "setPageContext",
		"setPageContext", "TagSupport Classe", "setPageContext",
		"setParent", "Tag Interface", "setParent",
		"setParent", "TagSupport Classe", "setParent",
		"setStatus", "response", "setStatus",
		"setTagInfo", "TagExtraInfo Classe", "setTagInfo",
		"setValue", "TagSupport Classe", "setValue",
		"Tag", "Tag Interface", "Description",
		"TagData", "TagData Classe", "TagDataHashtable",
		"TagData", "TagData Classe", "TagDataObject",
		"TagExtraInfo", "TagExtraInfo Classe", "TagExtraInfo",
		"Taglib", "Taglib Directrice", "Description",
		"TagSupport", "TagSupport Classe", "TagSupport",
		"title", "jsp:plugin", "title",
		"type", "jsp:plugin", "type",
		"useBean.type", "jsp:useBean", "type",
		"uri", "Taglib Directrice", "uri",
		"value", "jsp:param", "value",
		"setProperty.value", "jsp:setProperty", "value",
		"VariableInfo", "VariableInfo Classe", "VariableInfo",
		"vspace", "jsp:plugin", "vspace",
		"width", "jsp:plugin", "width",
		"writeOut", "BodyContent Classe", "writeOut"
);

// JSP Lookup Module
function referenceLookup(){
	var retVal = null;
  var dom = dw.getDocumentDOM();
	
  if (dom){
    // The idea here is that we don't want to bother doing ASP keyword processing if
    // the file is not a JSP file.
    if (dom.documentType != 'JSP')
    {
  		retVal = new Array("");
  	}
		else{
  	  var docEl = dom.documentElement;
    	var wholeDoc = docEl.outerHTML;
    	var theSel = dom.source.getSelection();
  		
  		var startPoint = searchBackwards(theSel[0],dom);
  		var endPoint = searchForwards(theSel[1],dom,wholeDoc.length);
  		var keyword;
  		var j;
  		
  		keyword = dom.source.getText(startPoint,endPoint);
  		
  		// Special cases (multiple entries for single keyword)
  		if (keyword == "getAttribute") {
  			if (getPrevWord(startPoint,dom).toLowerCase() == "session"){
  				keyword = "session.getAttribute";
  			}else if (getPrevWord(startPoint,dom).toLowerCase() == "request"){
  				keyword = "request.getAttribute";
  			}
  		}else if (keyword == "getAttributeNames") {
  			if (getPrevWord(startPoint,dom).toLowerCase() == "session"){
  				keyword = "session.getAttributeNames";
  			}else if (getPrevWord(startPoint,dom).toLowerCase() == "request"){
  				keyword = "request.getAttributeNames";
  			}
  		}else if (keyword == "getId") {
  			if (getPrevWord(startPoint,dom).toLowerCase() == "session"){
  				keyword = "session.getId";
  			}
  		}else if (keyword == "getValue") {
  			if (getPrevWord(startPoint,dom).toLowerCase() == "session"){
  				keyword = "session.getValue";
  			}
  		}else if (keyword == "name") {
  			if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:getProperty"){
  				keyword = "getProperty.name";
  			}else if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:setProperty"){
  				keyword = "setProperty.name";
  			}else if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:param"){
  				keyword = "param.name";
  			}else if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:plugin"){
  				keyword = "plugin.name";
  			}
  		}else if (keyword == "flush") {
  			if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:include"){
  				keyword = "include.flush";
  			}
			}else if (keyword == "property") {
  			if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:getProperty"){
  				keyword = "getProperty.property";
  			}
			}else if (keyword == "page") {
  			if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:forward"){
  				keyword = "forward.page";
  			}else if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:include"){
  				keyword = "include.page";
  			} 
  		}else if (keyword == "removeAttribute") {
  			if (getPrevWord(startPoint,dom).toLowerCase() == "session"){
  				keyword = "session.removeAttribute";
  			}else if (getPrevWord(startPoint,dom).toLowerCase() == "request"){
  				keyword = "request.removeAttribute";
  			}
  		}else if (keyword == "removeValue") {
  			if (getPrevWord(startPoint,dom).toLowerCase() == "session"){
  				keyword = "session.removeValue";
				}
  		}else if (keyword == "setAttribute") {
  			if (getPrevWord(startPoint,dom).toLowerCase() == "session"){
  				keyword = "session.setAttribute";
  			}else if (getPrevWord(startPoint,dom).toLowerCase() == "request"){
  				keyword = "request.setAttribute";
  			}
  		}else if (keyword == "type") {
  			if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:useBean"){
  				keyword = "useBean.type";
  			}
  		}else if (keyword == "value") {
  			if (getTagName(startPoint,dom,wholeDoc.length) == "jsp:setProperty"){
  				keyword = "setProperty.value";
  			}
  		}
  		retVal = getTopic(keyword);
    }
		if (!retVal){
			retVal = new Array("");
		}
	}
	return retVal;
	
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">

</body>
</html>
