Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiling Struts from CMD.

 
Vickey singh Verma
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic