I am new to JSPs and Servlets – I am wondering if there is any way for a JSP of delegating to a servlet the generation of given areas of the page such as custom controls (AWT stuff and such).
The reason why I am looking into this is that JSP pages can get really messy really fast.
Examples appreciated!
You can make a subrequest and have the subrequest’s output sent to the client instead of being buffered. For example
<c:import url='path/to/servlet'/>(or usejsp:include).If you want to call some custom Java code to produce output during a JSP page, you might consider using a custom JSP tag instead of a servlet, though. There should be less overhead since the tag is basically just instantiated and called, and the scheme for passing parameters to tags is much cleaner.