Geoff Boushey

Greenhorn
+ Follow
since Jan 21, 2005
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 Geoff Boushey

Hi Sam,

Truthfully, I'm early enough in this that I can't be sure there is any advantage over writing a small script on my own.

The algorithm needs a set of input parameters, and I need to send back machine readable information on how to process it - ie, whether it ran, how it ran, how long it took, whether there were any flags or warnings, what output (if any) was produced, where it can be found... and the client (machine) will act on this information. So I think ome kind of XML response over HTTP would probably be the easiest way to go.

It looks like Axis will produce a lot of this for me, with very minimal effort, so it seems more appealing than writing my own. I also like the idea of being able to use tomcat and what appear to be very simple java classes to expose methods. But I don't just want to jump on the first easy framework I find, which is why I'm investigating a few others (I found out about restlets while I was googling around about Axis).

- Geoff
15 years ago
I'd love to get some feedback on the possibility of using REST for remote procedure calls (or the sort of problem addressed by RPC).

Right now, I have a time and data intensive algorithm that can take anywhere from 2-30 minutes to run. This algorithm is just one part of a process, but it is by far the most computationally expensive. Our current approach is to place the code on a dedicated server and run it through remote procedure calls.

I've just started looking into this, and Apache Axis looks very promising - and I'll admit that part of its appeal is that it was extremely easy to get up and running with it. Essentially, it appears to require little more than creating a special java class with the method calls I need and a special extension.

I'm interested in restlets in general, but for the task at hand, would they offer substantially more than I would get out of axis? Or is this sort of internal RPC issue not really what restlets are designed to handle?

Looking forward to reading RESTful web services. Thanks.
15 years ago
Unfortunately, the "input=" has always been there.

This isn't too much of a surprise. I started by writing a very simple application, got the validation working, and then started elaborating on it (i.e., taking an iterative approach). Somewhere along the line, I must have added something that broke the validation.

It's pretty clear that something has gone wrong with the mapping. Unfortunately, I'm not getting an error message from struts (I've noticed some bug reports about struts failing silently). One possiblity is to go into struts and try to generate some outputs, but I think I'll just try retracing my steps first - ie., try to reconstruct the app from the simple one that works and see if I can figure out how and where this problem is happening.

Anyway, if I figure this out, I'll post a summary of what was going wrong. Thanks for your responses.
16 years ago
Hi Marc,

here's an excerpt from my struts-config file...



(note - all my jsp's are in a subdirectory named jsp)

Does this have the "input=" parameter that you're referring to?

I greatly appreciate the help.
16 years ago
Hi Marc,

Thanks for the reply. The strange thing here is that it *does* work unless the if clause catches an error. So my input= configuration does work for form processing... just not for error handling.

I found a thread from a couple of months ago that seems to describe the same error...

http://forum.java.sun.com/thread.jspa?threadID=634680&messageID=3688289

I think you're right about the forwarding problem - I carefully stepped through my code through my code and found that the action is recognized, the actionform is created, and the validate method gets called. The only thing left to do is forward the request, as far as I can tell. But strangely, it isn't happening - just a blank screen.
16 years ago
Has anyone had a problem with a blank screen on struts validation?
i.e., something like...

public ActionErrors validate(ActionMapping, HttpServletRequest request) {
ActionErrors = new ActionErrors();

if(form_field_1.equals("")) {
errors.add("form_field_1", new ActionError("error.input.notValid"));
}

return errors;
}

This actually worked earlier for me, but now I'm getting a blank screen when I submit the form with no value in form_field_1 (or whenever the if clause fails).

Any ideas as to why this is happening?

Thanks
16 years ago
I'm not sure if I understand your question exactly... are you trying to upload a file using struts?

There's a fairly easy to understand example of file uploads in the struts-examples file included with the struts download. You'll probably have to adapt it, but it'll get you started.
17 years ago
Thanks for the responses. I'm kind of doing a sanity-check on my approach - making sure I haven't stumbled onto a well known anti-pattern .
17 years ago
Hi,

Just looking for some advice on approaching a struts app. It appears that you need three classes to move from web forms to populating a pojo model - the actual model for the class (pojo), an action form (struts), and an action (struts). So my first approach was to read forms from the web into an action form, persist the object in a separate model class, and use the action to move between the two.

One thing that makes it seem like this may be the wrong approach - there's a lot of duplicate code between the action form and the model.

Any advice?
17 years ago
congrats, Ankit.



I took the the SCJP1.4 yesterday, and I know that any kind of pass takes a lot of work.
17 years ago
Hi,

This is my first post, though I benefitted greatly from this site and discussion as I prepared for the exam. Just wanted to share some of my thoughts and advice on taking this exam.

For starters, I want to say that it isn't an easy test. I'd been programming in Java for a couple of years, and I needed to do very substantial review before taking the exam. It turned out to be a worthwhile effort. If you find you are writing the same code over and over, you may not be getting the chance to learn about other aspects of Java. The exam forces you to spend time reading broadly in the language. Passing the test is the main purpose of studying, of course, but you may also find better ways of doing things that you hadn't thought about for a while.

I used the same study materials that a lot of other people on this board have used - Kathy and Bert's book, Marcus Green's exams, the Rules Roundup, etc... this covers all the bases, and is very good study material. The only other bit of advice I can offer is to open up a terminal window and write code as much as possible. On several occasions while reading K&B, I had had questions that weren't answered in the text. My advice is don't guess, write some code - the compiler and jvm will answer any question you have. Another helpful technique is to try to think up some questions for yourself, and solve them without looking at the book. It's just too easy to overlook something when it's already there on the page. When you start thinking of what's tricky about threads and devise some questions to get at it, you're thinking like the test writers. This will also help you connect with the material - you may know in the abstract that you need to throw an exception in a particular method, but there's nothing quite like puzzling over a compiler error to really drill it into your head. I also noticed that I become much better at knowing when there would be a runtime error, exception, or compiler error after writing code.

Anyway, my advice is to find a way to connect with the material as much as possible. If this had been an empty exercise just to pass a test, it would have been a lot harder to stick with it.

Best of luck.
- Geoff
17 years ago