Adam Chace

Greenhorn
+ Follow
since May 24, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adam Chace

Trevor is right. Your tag is thread-safe.
------------------
Adam Chace
Author of :JSP Tag Libraries
Chalk Creek Software
17 years ago
Sounds like you might not be sending the contents of the temporary buffer (the enclosing JspWriter) to the browser. Your doAfterBody() should look like:
public int doAFterBody() {
try {
BodyContent body = getBodyContent();
JspWriter out = body.getEnclosingWirter();
out.println( body.getString() );
if ( <your condition> ) {
return( EVAL_BODY_TAG );
} else {
return( SKIP_BODY );
}
...
------------------
Adam Chace
Author of :JSP Tag Libraries
Chalk Creek Software
17 years ago
Thank you all for your questions and your interest in JSP tags.

------------------
Adam Chace
Author of :JSP Tag Libraries
Chalk Creek Software
18 years ago
tld
You can define just one or more tags in a single tld. Typically a tld corresponds to a library.
------------------
Adam Chace
Author of :JSP Tag Libraries
Chalk Creek Software
[This message has been edited by Adam Chace (edited June 27, 2001).]
18 years ago
You can write custom tags that interact with EJBs, a practice we showcase in my book. I assume this what you mean?
------------------
Adam Chace
Author of :JSP Tag Libraries
Chalk Creek Software
18 years ago
No problem at all
Seems to happen a lot, oddly. I guess Adam and Andy are easy names to mix up.
Thanks for the question and the interest in tags.

------------------
Adam Chace
Author of :JSP Tag Libraries
Chalk Creek Software
18 years ago
I'm pretty sure this isn't possible with the import statement, since it doesn't support a runtime expression value for the file attribute.
------------------
Adam Chace
Author of :JSP Tag Libraries
Chalk Creek Software
18 years ago
Just do:
Select count( field ) as ct from table
where "field" is the name of the primary key. Then you can use "ct" as the fieldname for the count.
------------------
Adam Chace
Author of :JSP Tag Libraries
Chalk Creek Software
18 years ago
Richard,
You raise some good questions here, being a custom JSP zealot I will offer my perspective on a couple of your points.
1. both separate content from format. This is a Good Thing!
<adam>I fully agree</adam>
2. both have the ability to create almost unreadable HTML/XSL files. Bad bad bad.
<adam>I fully agree that XSL/XSLT files can and often are very unreadable, but I think well designed tags in HTML are typically very readable, especially to HTML folks who are used to tags and attributes.</adam>
3. both cause significant additional work on the part of the developer. I personally find custom JSP quite complex, even if you use a pre-built framework like Struts.
<adam>I would agree that the actual API for tags could be simpler, but it is improving. The resulting tag, if designed well, should be easy for the content developer though</adam>
4. both need additional processing power.
<adam>Not sure exactly what you mean by this, but if you mean that a standard web server needs to exert additional effort to server either, that is true. However, this is more a matter of how you partition the processing. If your web/appserver supports JSP you can simply view this as part of the processing power of the web server</adam>

------------------
Adam Chace
Author of :JSP Tag Library
18 years ago
Your posting says Andy, but I think you might have meant me?
I think some of the links in the forums point to the wrong place, but the book is available on Amazon at the link below (in my signature).
Our book mostly discusses how to write custom tags. This includes tags that perform iteration, change their body, interact with a database, nested tags, tags that use J2EE and many more. During our discussion we talk about the merits of tag use and how they fit into a complete web application architecture.

------------------
Adam Chace
Author of :JSP Tag Library
18 years ago
From within a tag handler, you can access the session most easily through the methods of PageContext class. An instance of the PageContext class is available to you, if your handler extends TagSupport or BodyTagSupport, automatically as "pageContext". You can get the session directly by calling:
pageContext.getSession()
or you can get and set values to the session through the cleaner:
pageContext.getAttribute( "attributeName", PageContext.SESSION_SCOPE )
pageContext.setAttribute( "attributeName", value, PageContext.SESSION_SCOPE )
Hope this helps,
-Adam
------------------
Adam Chace
Author of :JSP Tag Library
18 years ago
As far as the .tld file goes in Tomcat, you can put this right in the root of the WEB-INF directory of your web application, or you can specify another location for it in the web.xml - something like WEB-INF/tlds.
-Adam
18 years ago
Jeff,
You should take a look at the JavaMail API which provides functionality for sending email in Java. If the web/appserver you are using doesn't include JavaMail support then there are a few simple classes out there that will send email as well. If this the case, email me at adam@chalkcreek.com and I will send you one that I like to use.
-Adam
18 years ago
The prefix is especially useful when you are using more than one library of tags in a particular JSP to prevent name conflicts.
18 years ago