
Sorry for my late response, but I was very busy.
Well, JSP is not so different from Active Server Pages of Microsoft.
Only it is based on Java language, and not on Visual Basic.
I think that a first good entry level for JSP support is starting from the 2 main aspects of the JSP pages: scriptlets and custom tags.
Scriptlets are blocks of Java language into the HTML page (like ASP ones...), which can refer to Java built-in objects, or custom ones. For example:
<%
String id = request.getParameter("id");
if (id != null) session.setAttribute("MAINMENU_ID", mid);
%>
Both request and session are built in objects of the JSP: here I retrieve the id parameter from a POST or GET submission, and check if is or not null. If not, I set a session parameter called MAINMENU_ID.
As you can see, a block is included into the <%...%> delimiters.
Custom tags are a more powerfull (and complex) aspect, because we can define custom tags with can set or get data from the page or session or application (three levels of visibility: a more one is the current request) and manipulate data or retrieve data from a database, and so on...
Every tag is defined in a Java class, which on a web server (like Tomcat, which i use) is in a special directory of the web server itself, the WEB-INF, as a class in the
/classes subdirectory or as a library (which includes all classes) in the
/lib subdirectory. In the
/tlds subdirectory are stored the xml files (with .tld extension) which defines the tags, their properties and the java classes wich implements the behaviour. In a special file, called WEB.XML in the WEB-INF directory, are stored the references to all *.tld files which defines the custom tags.
Just as example, in the following you see a part of the log.tld file of the LOG tags library of the Jakarta project:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>log</shortname>
<uri>http://jakarta.apache.org/taglibs/log-1.0</uri>
<info>[bla...bla...bla]</info>
<tag>
<name>info</name>
<tagclass>org.apache.taglibs.log.InfoTag</tagclass>
<attribute>
<name>category</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>message</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>
This defines the tag <info> with his parameters (because the field required is set to false, this are not mandatory). I don't enter too much in explanations now, because it is only as example: in the WEB.XML file this tld file can be defined like:
<webapps>
[...]
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/log-1.0</taglib-uri>
<taglib-location>/WEB-INF/tlds/jakarta/log.tld</taglib-location>
</taglib>
</webapps>
and then, in the JSP page where i want to use the custom tag <info> I can write like this at the top of page (I must respect the definition in the WEB.XML file):
<%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
and then into the page:
<!--
<log:info>Loading...</log:info>
-->
When the web server read the jsp pages, it reads the tld files specified at the top of page, assigning the uinque name
log as tag identifier (to avoid name conflicts between more libraries): when it compiles on runtime, it checks that the tag respects the parameters condition, and then executes the tag behaviour as specified in the org.apache.taglibs.log.InfoTag class.
In this case, in the log of the web server the 'Loading...' message is written.
I understand that probably it seems so hard, and it is really so if you takes this few words... But I think also that it is not necessary to have at start so much features... The checking of the correct tag opening and closing, and of the scriptles well formatting can be a very good point of start for your software.
At the moment, only Macromedia Dreamweaver probably gives some support of custom tags, but I've stopped to use it at version 4, so I don't know about MX versions...
If you think it can be usefull, I can give you some support for JSP aspect: I'm not a guru. Let me know.
See you soon
Damiano Martorelli