Craig Treptow

Greenhorn
+ Follow
since Oct 29, 2007
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 Craig Treptow

David Newton wrote:Unfortunately, you're also declaring methods in essentially random places.



Sorry, I'm not following. This is the full content of what I am referring to as the caller:

Aha! I think I see what you mean now.

Caller:



And the class:



Success!

Thanks for making me step away and take another look!

Craig
13 years ago
Hi. I'm going through the book "Groovy In Action" using Eclipse. On page, 135,136, I wanted to see the benchmark run. So, I have this:

The caller:



and the class:



However, the error I see is:



I'm at a loss. I believe I am passing an Integer and a closure.

What am I missing?

Thanks in advance!

Craig
13 years ago
This is a vendor application that I'm enhancing. So, these came from the vendor and are used by the vendor. The .tld files do contain some information and usually an example like this:


So, hopefully, I can figure out how to put them to use.
14 years ago
JSP

Bear Bibeault wrote:That is not a standard JSP action. You'll need to let us know what library it is from.



Thank you. I think you just helped me. Since the JSP also has this:



It must be coming from one of those. So I should be able to look and see what is going on?
14 years ago
JSP
I have a JSP that has lines like this:



Later they reference it like this:




It looks like that is just a way to populate something from some Java class. In this case you get CSArea objects.

Is it as simple as that? Can I just write a class that also returns CSArea objects, or does the "context" mean I have to do something special?
14 years ago
JSP

Bear Bibeault wrote:Unless there is a filter to set up the CSClient variable, it will never exist.

Are you sure that you're not supposed to be looking in the session or someplace else for it?



Their docs say CSClient represents the user's session.
14 years ago

Bear Bibeault wrote:Unless there is a filter to set up the CSClient variable, it will never exist.

Are you sure that you're not supposed to be looking in the session or someplace else for it?



No, I'm not sure, just starting with the sample provided. The docs they provide are very vague about these details. They basically say you can use JSP, or servlets, see the examples.

In their sample web.xml I see this:



That's for the working sample that I started with.

Guess it's time to read about filters and what they do...
14 years ago

Bear Bibeault wrote:Whoever provided those sample writes extremely sloppy code, in my opinion.

With regards to the scoped variable, if the servlet is the first thing that executes in the request, your fetch will always return null as there is no way that anything will have had an opportunity to set a variable into the request.

Are there filters configured that execute before the servlet?

If your forward is failing -- and again, using an include instead of a forward is sloppy sloppy sloppy -- it's because something is tinkering with the request other than the code you have in the servlet.



What you say about that scoped variable is making some sense. I guess I'll poke around on the vendor's site and see if I can learn something else. All the examples I've seen use the include.

No filters:

14 years ago

Bear Bibeault wrote:

CSClient client = (CSClient)request.getAttribute( "iw.csclient");


The fact that the very first thing you are doing in the servlet is to fetch a request-scoped variable is highly suspicious that something else is executing before the servlet. Otherwise, there would be no opportunity for there to even be such a variable in request scope.

What is it that you're not telling us?



This is also from a working sample provided by the sample. I need a CSClient object to do almost anything with the application.

I'm not deliberately withholding information, but I could be easily ignorant of some key piece that would help you out.
14 years ago

Bear Bibeault wrote:No it doesn't. An include is not a suitable substitute for the forward. The problem lies elsewhere, though I cannot see it upon inspection.

This is a very (and I do mean very) common scenario, so it should all work. There must be more to it than what is posted.



Include doesn't give control back? Going from page 207 in the Head First book:

the include() method sends the request to something else (typically another servlet) to do some work and then comes back to the sender!



Is the book wrong, or have I misunderstood something?
14 years ago

Bear Bibeault wrote:And, why the init and destroy methods? If you don't have anything to do, omit them.



This was also due to starting with a sample provided by the vendor.
14 years ago

Bear Bibeault wrote:By the way, why the private method? Why not just have doPost invoke doGet or vice versa?



I simply started with a sample provided with the TeamSite product.
14 years ago

Craig Treptow wrote:

Found the answer!



Needs to be:



I don't understand why though. Include gives control back to the servlet, but I didn't think I would want for this purpose? At least the Heads First book makes me think I don't want the include.

Craig

14 years ago

Max Rahder wrote:What calls "processRequest()", and does it do anything with the response? My guess is that the calling routine is writing to the response stream.



Here's all of it:

14 years ago