File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Compiling Struts from CMD. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Compiling Struts from CMD." Watch "Compiling Struts from CMD." New topic

Compiling Struts from CMD.

Vickey singh Verma

Joined: Jul 11, 2008
Posts: 22
Hello everyone, I have a struts actionform code shown below. I'm unable to figure out the errors. Please help me out.


How can I include the package org.apache.action.....
where is it present, I have already pasted the struts lib in the WEB-INF/lib folder.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

The problem is in the way you're compiling,

Look out the "-classpath" flag, It's position is wrong.
Correct one,

And are you sure, its enough to pass "servlet-api.jar" file only, I think it will need struts.jar, too

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
David Newton

Joined: Sep 29, 2008
Posts: 12617

In addition, there's a large number of typos, all of which are reported in the compile errors. Are you not using an IDE to write the code?Note that while you *may* have intended it to behave this way, if the form is null, you'll end up on the "success" forward, which seems wrong given the rest of the code. Those aside... if the form itself is null then Struts itself is likely broken--you *can* check for a null form but I'm not entirely sure it's necessary. Personally, I'd write you logic something closer to this:I don't have a problem with multiple return points in short methods, especially when it's very clear and linear like it is here. It's also clear how null forms will be handled, whereas the original version had to be read completely to the end of the function to know what would happen (and even then I had to scan back to the top to see what "target" was set to).

You also need to make sure *your* classes are available on the compilation classpath (for example, one of the compiler messages was about a missing LookupForm class).
I agree. Here's the link:
subject: Compiling Struts from CMD.
It's not a secret anymore!