<html>
<head>
<title>jsp lookup module</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="../lookupMod.js"></script>
<script language="JavaScript">
var BOOK_NAME = "O'REILLY JSP Reference";
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 Directive", "autoFlush",
		"beanName", "jsp:useBean", "beanName",
		"BodyContent", "BodyContent Class", "BodyContent",
		"BodyTag", "BodyTag Interface", "Description",
		"BodyTagSupport", "BodyTagSupport Class", "BodyTagSupport",
		"buffer", "Page Directive", "buffer",
		"class", "jsp:useBean", "class",
		"clear", "out", "clear",
		"clearBody", "BodyContent Class", "clearBody",
		"clearBuffer", "out", "clearBuffer",
		"close", "out", "close",
		"code", "jsp:plugin", "code",
		"codebase", "jsp:plugin", "codebase",
		"config", "config", "Description",
		"containsHeader", "response", "containsHeader",
		"contentType", "Page Directive", "contentType",
		"doAfterBody", "BodyTag Interface", "doAfterBody",
		"doAfterBody", "BodyTagSupport Class", "doAfterBody",
		"doEndTag", "BodyTagSupport Class", "doEndTag",
		"doEndTag", "Tag Interface", "doEndTag",
		"doEndTag", "TagSupport Class", "doEndTag",
		"doInitBody", "BodyTag Interface", "doInitBody",
		"doInitBody", "BodyTagSupport Class", "doInitBody",
		"doStartTag", "Tag Interface", "doStartTag",
		"doStartTag", "TagSupport Class", "doStartTag",
		"encodeRedirectURL", "response", "encodeRedirectURL",
		"encodeRedirectUrl", "response", "encodeRedirectUrl",
		"encodeURL", "response", "encodeURL",
		"encodeUrl", "response", "encodeUrl",
		"errorPage", "Page Directive", "errorPage",
		"exception", "exception", "Description",
		"extends", "Page Directive", "extends",
		"file", "Include Directive", "file",
		"findAncestorWithClass", "TagSupport Class", "findAncestorWithClass",
		"findAttribute", "pageContext", "findAttribute",
		"include.flush", "jsp:include", "flush",
		"flush", "BodyContent Class", "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 Class", "getAttribute",
		"getAttributeNames", "application", "getAttributeNames",
		"request.getAttributeNames", "request", "getAttributeNames",
		"session.getAttributeNames", "session", "getAttributeNames",
		"getAttributeNamesInScope", "pageContext", "getAttributeNamesInScope",
		"getAttributesScope", "pageContext", "getAttributesScope",
		"getAttributeString", "TagData Class", "getAttributeString",
		"getAuthType", "request", "getAuthType",
		"getBodyContent", "BodyTagSupport Class", "getBodyContent",
		"getBufferSize", "out", "getBufferSize",
		"getBufferSize", "response", "getBufferSize",
		"getCharacterEncoding", "request", "getCharacterEncoding",
		"getCharacterEncoding", "response", "getCharacterEncoding",
		"getClassName", "VariableInfo Class", "getClassName",
		"getContentLength", "request", "getContentLength",
		"getContentType", "request", "getContentType",
		"getContext", "application", "getContext",
		"getContextPath", "request", "getContextPath",
		"getCookies", "request", "getCookies",
		"getCreationTime", "session", "getCreationTime",
		"getDateHeader", "request", "getDateHeader",
		"getDeclare", "VariableInfo Class", "getDeclare",
		"getEnclosingWriter", "BodyContent Class", "getEnclosingWriter",
		"getException", "pageContext", "getException",
		"getHeader", "request", "getHeader",
		"getHeaderNames", "request", "getHeaderNames",
		"getHeaders", "request", "getHeaders",
		"session.getId", "session", "getId",
		"getId", "TagData Class", "getId",
		"getId", "TagSupport Class", "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 Class", "getParent",
		"getPathInfo", "request", "getPathInfo",
		"getPathTranslated", "request", "getPathTranslated",
		"getPreviousOut", "BodyTagSupport Class", "getPreviousOut",
		"getProtocol", "request", "getProtocol",
		"getQueryString", "request", "getQueryString",
		"getReader", "BodyContent Class", "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 Class", "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 Class", "getString",
		"getTagInfo", "TagExtraInfo Class", "getTagInfo",
		"getUserPrincipal", "request", "getUserPrincipal",
		"getValue", "session", "getValue",
		"getValue", "TagSupport Class", "getValue",
		"getValueNames", "session", "getValueNames",
		"getValues", "TagSupport Class", "getValues",
		"getVariableInfo", "TagExtraInfo Class", "getVariableInfo",
		"getVarName", "VariableInfo Class", "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 Directive", "import",
		"Include", "Include Directive", "Description",
		"include", "pageContext", "include",
		"info", "Page Directive", "info",
		"initialize", "pageContext", "initialize",
		"invalidate", "session", "invalidate",
		"isAutoFlush", "out", "isAutoFlush",
		"isCommitted", "response", "isCommitted",
		"isErrorPage", "Page Directive", "isErrorPage",
		"isNew", "session", "isNew",
		"isRequestedSessionIdFromCookie", "request", "isRequestedSessionIdFromCookie",
		"isRequestedSessionIdFromURL", "request", "isRequestedSessionIdFromURL",
		"isRequestedSessionIdValid", "request", "isRequestedSessionIdValid",
		"isRequestSessionIdFromUrl", "request", "isRequestSessionIdFromUrl",
		"isSecure", "request", "isSecure",
		"isThreadSafe", "Page Directive", "isThreadSafe",
		"isUserInRole", "request", "isUserInRole",
		"isValid", "TagExtraInfo Class", "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 Directive", "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 Directive", "Description",
		"page", "page", "Description",
		"pageContext", "pageContext", "Description",
		"PageContext", "pageContext", "PageContext",
		"param", "jsp:setProperty", "param",
		"popBody", "pageContext", "popBody",
		"prefix", "Taglib Directive", "prefix",
		"getProperty.property", "jsp:getProperty", "property",
		"property", "jsp:setProperty", "property",
		"pushBody", "pageContext", "pushBody",
		"putValue", "session", "putValue",
		"release", "BodyTagSupport Class", "release",
		"release", "pageContext", "release",
		"release", "Tag Interface", "release",
		"release", "TagSupport Class", "release",
		"removeAttribute", "pageContext", "removeAttribute",
		"request.removeAttribute", "request", "removeAttribute",
		"session.removeAttribute", "session", "removeAttribute",
		"session.removeValue", "session", "removeValue",
		"removeValue", "TagSupport Class", "removeValue",
		"request", "request", "Description",
		"reset", "response", "reset",
		"response", "response", "Description",
		"scope", "jsp:useBean", "scope",
		"sendError", "response", "sendError",
		"sendRedirect", "response", "sendRedirect",
		"session", "Page Directive", "session",
		"session", "session", "Description",
		"setAttribute", "application", "setAttribute",
		"setAttribute", "pageContext", "setAttribute",
		"request.setAttribute", "request", "setAttribute",
		"session.setAttribute", "session", "setAttribute",
		"setAttribute", "TagData Class", "setAttribute",
		"setBodyContent", "BodyTag Interface", "setBodyContent",
		"setBodyContent", "BodyTagSupport Class", "setBodyContent",
		"setBufferSize", "response", "setBufferSize",
		"setContentLength", "response", "setContentLength",
		"setContentType", "response", "setContentType",
		"setDateHeader", "response", "setDateHeader",
		"setHeader", "response", "setHeader",
		"setId", "TagSupport Class", "setId",
		"setIntHeader", "response", "setIntHeader",
		"setLocale", "response", "setLocale",
		"setMaxInactiveInterval", "session", "setMaxInactiveInterval",
		"setPageContext", "Tag Interface", "setPageContext",
		"setPageContext", "TagSupport Class", "setPageContext",
		"setParent", "Tag Interface", "setParent",
		"setParent", "TagSupport Class", "setParent",
		"setStatus", "response", "setStatus",
		"setTagInfo", "TagExtraInfo Class", "setTagInfo",
		"setValue", "TagSupport Class", "setValue",
		"Tag", "Tag Interface", "Description",
		"TagData", "TagData Class", "TagDataHashtable",
		"TagData", "TagData Class", "TagDataObject",
		"TagExtraInfo", "TagExtraInfo Class", "TagExtraInfo",
		"Taglib", "Taglib Directive", "Description",
		"TagSupport", "TagSupport Class", "TagSupport",
		"title", "jsp:plugin", "title",
		"type", "jsp:plugin", "type",
		"useBean.type", "jsp:useBean", "type",
		"uri", "Taglib Directive", "uri",
		"value", "jsp:param", "value",
		"setProperty.value", "jsp:setProperty", "value",
		"VariableInfo", "VariableInfo Class", "VariableInfo",
		"vspace", "jsp:plugin", "vspace",
		"width", "jsp:plugin", "width",
		"writeOut", "BodyContent Class", "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>
