• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compiling Struts from CMD.

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
reply
    Bookmark Topic Watch Topic
  • New Topic