tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luis Andrei Cobo" <va...@megapathdsl.net>
Subject RE: dynamic includes.
Date Thu, 14 Sep 2000 05:15:31 GMT
if you can actually solve this one, I'd pay big bucks.


Unfortunately, there doesnt seem to be much by way of support fo parametric
includes in JSP, or ASP for that matter

Perhaps however, someone will catch on that this could be a relatively good
thing, and write an extention for _jspservice or something which handles
this.

I worked with a psuedo-programming language ( more of a syntactical
interface over java) which took anything as a parameter for a file include
(parsable 100%). It was a scripting type of language called "Borscht" which
was developed by Organic I beleive. It was very unusual, and had it own
unique brand of syntax and grammar. on the server side was servlets that
would interpret the syntax, intercepting commands to other servlets, which
led to an interesting beldn fo server/client programming, although somewhat
expensive on the machines. The includes were parsed on the server by a
servlet which would simply accept the concantenation of strings as file
arguments and include them in the resulting parsing, which would yeild some
interesting results, however those files were required to be .HTML files
even if there were snippets of "borscht" code in them. It was certainly
exciting though since it yeilded some fabulously dynamic templates.

I personally would LOVE to have this mechanism in JSP. Ive worked with it
for a long time and am sorry to see it not in standard programming. There is
probably the concern that the JSP would have to be recompiled Everytime an
include argument changes, and even if it doesnt change, it would natually
assume it has and recompile, which would exhaust system resources a great
deal.

Oddly, considering the performance impact in JSP, with compilation issues,
im SUPER surprised that a lanugage like ASP can not handle this sort ot
technique considering that the page parses out every time you load it
anyhow.!!

There is a dirty alternative, one thats not glamourous, which will allow
only HTML tags to actually work, and that would be to use a FileReader
/inputStream to write a file directly to the page. Only HTML would actually
parse out, but all JSP tags would simply show up as text on the resulting
page.


Luis Andrei Cobo




-----Original Message-----
From: theo@vecnatech.com [mailto:theo@vecnatech.com]
Sent: Thursday, September 14, 2000 12:46 AM
To: tomcat-user@jakarta.apache.org
Subject: dynamic includes.


I am trying to figure out how to do an include where the file to be
included is specified in a user profile object.
I have tried many things, read the relevant jsp spec pages, scanned
through lots of the mailing list archive..... nothing.

It seems to me like this is something that people would want to do, so
I am either missing something simple (likely) or there must be another
way to accomplish the objective.

of course the first thing I tried was

<%@ include file = profile.getContentFile() %>

but the jsp engine wasn't too happy about it.

The objective is to include one of several files based on a parameter in
my profile object.

Any help would be greatly appreciated....
theo



Mime
View raw message