Scott Stirling

Greenhorn
+ Follow
since Mar 05, 2001
Merit badge: grant badges
For More
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 Scott Stirling

Depends on the app server. Tag caching and pooling is going to be a new thing in JRun 3.1, which is coming out in beta 1 soon (next week). I don't know how Tomcat and others handle it.
I predict by the end of the year everyone will support efficient tag reuse and pooling, but there were a lot of disagreements about how to do it on the JSP spec group during the 1.2 specification development. How you do it largely depends on when release() is called on a tag handler and what that should do, and this was a matter of contention among various vendors and experts involved in the spec.
Take a look at the generated Servlet code to see how your JSP tags are handled on the back end. Also note that with the modern, optimizing-JIT JVMs (especially HotSpot and Sun & IBM 1.3 JVMs), object creation and deletion for short-lived objects is cheap, and pooling can actually interfere with the optimizing JVM's management of allocation and garbage collection.
------------------
Scott Stirling
Author of Java Server Pages Application Development
[This message has been edited by Scott Stirling (edited March 07, 2001).]
23 years ago
What's the stack trace in the 500 error? If you don't see a stack trace in the browser try Netscape so IE doesn't hide it from you.
JRun 2.3.3 supports JSP 1.0 and 0.92. There's a knowledge base article at Allaire on how to change the version if you have the wrong one set.
But I'm won't be sure what the problem is until I see the stack trace.
------------------
Scott Stirling
Author of Java Server Pages Application Development
23 years ago
There are only two installers for JRun 3.0: UNIX and Windows. there are no differences between the Win98, NT or 2000 installers.
My guess is that you're file really is corrupted, or your disk is out of space so it's not all fitting or something. The JRun installer for Windows is around 17 MB. What's the byte count on the file you've downloaded?
Also note that Allaire's FTP servers are load balanced (and run by an ISP). So there may be a bad file on one of the servers. But more likely, I think, is that the file is not downloaded completely, or was corrupted in downloading. This is somewhat common on a dial-up connection.
------------------
Scott Stirling
Author of Java Server Pages Application Development
23 years ago
Side note: getValue() and putValue() have been deprecated in favor of getAttribute() and setAttribute() as of Servlet 2.2 API.
------------------
Scott Stirling
Author of Java Server Pages Application Development
23 years ago
Here's a suggestion. Please let me know if this fails to meet the requirements. It's "homegrown session tracking."
Use request.getParameter("x") to test whether you need to create a new session for the client. If the parameter is null, call request.getSession() to create a new session, and use session.getId() to get the unique id. Then add the session id to the hidden field in the response, and add the id and the session object to a singleton Hashtable or HashMap that's stored in the application object (this will prevent the Hashtable of sessions from being garbage collected).
If the parameter is not null and it looks like a valid session id, then do a lookup for it in the Hashtable (or whatever collection you choose).
The other main piece you'll need is a way to timeout the sessions in the Hashtable and remove them so the Hashtable doesn't grow forever. I'll leave this exercise for you. If your app server has any kind of cron or scheduler service (e.g., JRun does) you might be able to extend that to schedule a regular cleanup of the Hastable.
Does this answer stink? Sorry. But I've read elsewhere that WAP needs improvement in this area, so I'm not sure what else to tell you. Someone else may have a more elegant solution.
------------------
Scott Stirling
Author of Java Server Pages Application Development
23 years ago
No problem. Thanks for the welcome!
I was browsing around replying to posts earlier today, both on this forum and some of the others. I keep forgetting to check my sig though...
Scott
------------------
Scott Stirling
Author of Java Server Pages Application Development
23 years ago
If you mean can you use XML as the static template data instead of HTML, the answer is yes. If you want to output XML as well, you may want to set the page MIME type to xml (use the charset of your preference, I'm using the default JSP charset below):
<%@ page contentType="text/xml;charset=ISO-8859-1" %>
23 years ago
Good point. I should have added that. When you want to create a scripting variable on the page from a tag handler, you need to declare it in a TagExtraInfo class. here's an example of how to do it with an "id" attribute that'll only be available nested between opening and closing tags:

This defines a scripting variable named "id" for the tag handler "foo.bar.taglib.fooTag". It's "true" that it will be created by the tag handler, and its scope is NESTED -- i.e., it is only available/"visible" when used nested between opening and closing tags on the page.
Other possible scopes are AT_END, which means only after the closing of the tag's appearance on the page to (potentially) the end of the document, and AT_BEGIN, which means from the beginning of the tag's first appearance on the page.
Like I said, see the Jakarta taglibs. There are several examples of this sort of thing there.
------------------
Scott Stirling
Author of Java Server Pages Application Development
[This message has been edited by Scott Stirling (edited March 06, 2001).]
23 years ago
What he said. If you have a problem, let me know. You can also just edit the java.exe property in JRun\lib\global.properties to point to your new JVM. This will apply the change globally to all your server instances.
------------------
Scott Stirling
Author of Java Server Pages Application Development
23 years ago
You need to nest the <jsp :params> inside the plugin tag. Judging from the code you posted, you're not.
See examples here:
http://java.sun.com/products/jsp/tags/11/syntaxref1113.html#8837
To the other respondent, the reason for using the plugin tag instead of straight HTML is that the JSP container is supposed to write browser-specific HTML for you, saving you the effort of doing browser detection and generating different HTML for IE and Netscape.
------------------
Scott Stirling
Author of Java Server Pages Application Development
[This message has been edited by Scott Stirling (edited March 06, 2001).]
[This message has been edited by Jim Yingst (edited March 06, 2001).]
23 years ago
There's a Java Specification Request for a Standard JSP Tag Library going on at Sun. The goal is to provide a standard set of tags for JSP developers. When the spec is done (it's been brewing slowly for over a year), the goal is to have all JSP containers that support a certain future version of JSP automatically support all the standard tags.
http://java.sun.com/aboutJava/communityprocess/jsr/jsr_052_jsptaglib.html
------------------
Scott Stirling
Author of Java Server Pages Application Development
23 years ago
William may be right. It's hard to say without a specific exception or error message.
It's also common for users to have very old JDKs on their Solaris boxen, because Solaris comes with a JDK installed. If you have java 1.1.6 or 1.1.7 or even an early 1.2 I would recommend upgrading ASAP. The old JVMs in these JDKs don't handle multithreaded, network heavy apps very well.
------------------
Scott Stirling
Author of Java Server Pages Application Development
23 years ago
The form of a JSP can be pure XML because the JSP spec specifies a standard translation of JSP syntax to XML (good if your JSP container supports it), but the output of a JSP is completely separate. I.e., a JSP can ouput plain text, HTML, XHTML, an applet, more XML, etc. I think the user is asking about outputting XML from JSP, not authoring JSPs in XML.
To get XML output, make sure you format any static template data in the JSP as well-formed XML. Then at the top of the JSP set the MIME type as XML, for example (using the default charset):
<%@ page contentType="text/xml;charset=ISO-8859-1" %>
23 years ago
I am also here to answer questions. I wrote several of the chapters of the SAMS book with Forta, including the one on custom tags.
I like this site, BTW. There's tons of cool Java stuff going on. Probably the most interesting Java site next to java.sun.com, actually.
23 years ago
You can download the source to the Sun JVMs from http://java.sun.com. You can look/make changes all you want as long as it's for academic/research purposes. And then there's the (open source) Blackdown port of the Sun JVM, at blackdown.org.
You might be interested in Kaffe, an open source JVM, even though it only supports up to Java 1.1: http://www.transvirtual.com/kaffe.htm
There are others too, like Japhar. See a list here: http://www.dwheeler.com/java-imp.html
23 years ago