code: public static WebPage getWebPage(ServletContext context, Class<? extends WebPage> clazz, WebSiteRequest req) throws IOException {
  		synchronized(webPageCache) {
  			if(context==null) throw new IllegalArgumentException("context is null");
  			String classname=clazz.getName();
  			// First look for a match in the cache
  			List<WebPage> list=webPageCache.get(classname);
  			if(list!=null) {
  				int size=list.size();
  				for(int c=0;c<size;c++) {
  					WebPage page=list.get(c);
  					if(page.getClass()==clazz && page.isHandler(req)) return page;
  				}
  			}
  
  			// Make a new instance and store in cache
  			try {
  				Constructor<? extends WebPage> con=clazz.getConstructor(getWebPageRequestParams);
  				WebPage page=con.newInstance(new Object[] {req});
  				page.setServletContext(context);
  				if(list==null) webPageCache.put(classname, list=new ArrayList<>());
  				list.add(page);
  				return page;
  			} catch (ClassCastException | IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchMethodException e) {
  				throw new IOException("Unable to getWebPage: "+clazz.getName()+", classname="+classname+", req="+req, e);
  			}
  		}
  	}
docs: Gets an instance of <code>WebPage</code> given the <code>Class</code>.
  Instances returned should never have the <code>init</code> method
  called and should allocate a minimal set of resources.
  <p>
  Unless caching is disabled, the generated pages are stored in a
  cache and resolved using the pages <code>isHandler</code> method.
  
  @param  context  the context the servlet will be run in
  @param  clazz  the <code>Class</code> to get an instance of
  @param  req  the request details are used to select the right instance
  
  @return  a <code>WebPage</code> object of the given class that matches the request settings
  
  @exception  IllegalArgumentException if unable to create the instance
  
  @see  WebSiteFrameworkConfiguration#useWebSiteCaching()
  @see  #isHandler(WebSiteRequest)