Jason Stortz

Ranch Hand
+ Follow
since Jan 11, 2001
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jason Stortz

A simpler way to say this is I want type
and see the result of
Thanks guys and gals,
20 years ago
I would like to map a name the user can type into the address bar to take a specific action.
For instance, I have the following servlet tag:
So, when the user types in:
it executes the specified controller. Now, is there any way to make ANOTHER mapping that will let the user type in:
and have it execute like this:
A.k.a., I want my landing page to be my servlet, but I want it automatically called with a parameter.
Any mapping guru's out there got any tricks for me?
20 years ago
Well, I know this is the application server forum but I have no where else to turn.
I am running Solaris 7 with sun's 6.0 webserver and service pack 4. We have j2se 1.3.1_04 installed and working.
I would like the System.out.println statements in my JSP's and Servlets to print to my console screen where I typed ./start to get thing going.
I cannot seem to find some good advice on this ANYWHERE!
I hope someone here can lend me a hand. Thanks,
20 years ago
OS: Win XP
App Server: JBoss 3.0
J2SE: 1.3.1_03
I am confused as to when I close my InitialContext? I see a lot of examples where people open the context in the init method. Does this mean I close it in the destroy method of my servlet?
I once read an example that said to open, get your bean, do your work and then close it right away.
In JBoss, with Clustering enables, if I open, do my work and close right away the load balancing seems not to work as all requests always go to one machine. However, if I open the context in the init method everything seems to go fine (note: I have not closed it even in the destroy method at this point).
Can anyone guide this confused soul? Thanks!
Okay, I'm using Tomcat 4.0.4. I'm having a hard time deciding when to use response.sendRedirect() and when to use request.getRequestDispatcher(someURL).forward(request, response).
We used to use response.sendRedirect all over the place, but that started failing once we moved from iPlanet 4.1 to Tomcat. I need to redirect the user OFF our site to another site though, so the forward method of RequestDispatcher doesn't work since it has to be a relative path.
Anyone got any hard and fast rules here? response.sendRedirect only seems to work some of the time, and I cannot tell why.
Any advice would be awesome.
Thanks for the response Mikalai!
I forgot to mention that this is in a normal, non servlet java class. I suppose I have the option of passing that information into the java class from the generating servlet, but just out of curiosity, do you have any more tricks up your sleeve?
Is there any other way to get that information? I want to change as few classes as possible.
At least you have given me some options to work with now, thanks again!
I've seen a lot of examples where people try to read properties files from WEB-INF/classes directory. I need to read an xml, I basically, need to get the fully qualified path name of the xml file, as my ancient xml parser (please don't ask), can only take a file name. So getResourceAsStream won't work for me.
However, I'm having problems with the most basic step. My xml file is in the classes directory. I use getClass().getResoure() to get a handle on the xml file as a URL, and from there I was going to try and figure out the path name. However, the URL always comes back null.
Any suggestions?
I have added several jar files to common/lib and they seem to load fine, but when I add a third the classes that are in it are not being found, and the result is NoClassDefFound errors.
When I unpack the jar into the classes directory instead of putting the jar i the common/lib it seems to work fine.
Anyone seen this before? The jar not being found is rather large compared to the rest, about 8.5 megs.
OS: Solaris 8
Tomcat: 4.x
J2SE: 1.3.1_03
Thanks Guys and Gals!
20 years ago
Does anyone know how to make the form elements in a JSP populate automatically? I am getting very sick of doing:
input type="text" name="text" value="<%= myvalue %>"
This is even uglier with select lists, those of you who have done this know what I mean.
Anyone got any ideas?
I have all the values when entering the JSP I just want to be able to do something easy to make the form populate with those values.
20 years ago
Can someone point me in the general direction of how I can setup a general images directory to be shared by all my web applications? I tried using a context entry in server.xml and mapping /images to C:\temp\images but it didn't work. I don't really want it at C:\temp\images, but if I can map all calls to \images to go there, then I know it is working and I can point it anywhere I want.
Anyone got any ideas? I have a core set of common images that I don't want to have to include with all my web appplications.
20 years ago
I suppose some of this question and answer is mostly opinion so here goes. I felt the Data class as it was provided was partially incomplete. It has empty lock and unlock methods which were not declared abstract. Had they been abstract to start with I may have thought harder about extending.
As it was, I decided to go your same route as I felt anyone desiring to reuse the data class would benefit from having implemented criteriaFind, lock and unlock methods and if they wanted different behavior they THEY could extend and reimplement my implementations of those methods.
Jason Stortz
For anyone else reading this post here are some interesting links about this cool Unreferenced interface that Mark keyed me to:
Here is a JGuru.com FAQ which details why Unreferenced may seem NOT to work as sometimes expected:
Here is the API for it:
And here's a bit about garbage collection of remote objects:
And finally here is a page with a bunch of RMI stuff and some segments on Unreferenced:
Hope this helps some of you others too.
[ February 15, 2002: Message edited by: Jason Stortz ]

Originally posted by Mark Spritzler:
Unreferenced is a Java API interface that handles when a client to RMI has lost connection.

Wow really? Okay back to the drawing board... I need to research that for a bit. Thanks a lot!
Which interface do you think is referenced ... you totally lost me on that one. I think the only interfaces I mentioned were Remote, DataAccess, RemoteDataAccess and Runnable, and I am using each of the four. Unless I misunderstood your comment.
Modifications to Data class include giving it a LockManager to be used with the lock and unlock methods. However, Data will not call its own lock and unlock methods. Data will remain for only local access. The RemoteDataServer will serve as a wrapper around the data class and call its lock and unlock methods before accessing it.
Does that explain any better?
One thing I forgot to mention. If I am thinking of all this correctly then the RemoteDataServer mentioned above will also implement Runnable and be placed in a Thread which is started just before it is returned by the getConnection method of the ConnectionFactory. Then, the only "tie" to the server the client has is in the thread on the server side.
Okay, tear into it.