new to STRUTS

R

roohbir

Hello,

I have just started Struts and am trying to run a simple application
on my machine. However when I try to compile the java files it, the
following error comes up on the command-prompt:
===============================================================
C:\java\login>javac -classpath WEB-INF\lib\commons-
beanutils-1.7.0.jar;WEB-INF
\lib\commons-validator-1.3.1.jar;WEB-INF\lib\commons-
digester-1.8.jar;WEB-INF\li
b\oro-2.0.8.jar;WEB-INF\lib\struts-core-1.3.8.jar;WEB-INF\lib
\standard-1.0.2.jar
;WEB-INF\lib\struts-extras-1.3.8;WEB-INF\lib\struts-
scripting-1.3.8.jar;C:\Sun\S
DK\lib\j2ee.jar;"C:\Program Files\Apache Group\Tomcat 5.5\common\lib
\servlet-api
..jar" WEB-INF\src\com\hold\login\*.java -d WEB-INF\classes
WEB-INF\src\com\hold\login\MyForm.java:4: cannot find symbol
symbol : class ActionError
location: package org.apache.struts.action
import org.apache.struts.action.ActionError;
^
WEB-INF\src\com\hold\login\MyForm.java:50: cannot find symbol
symbol : class ActionError
location: class com.hold.login.MyForm
errors.add("password", new
ActionError("error.login.password.invalid
"));
^
2 errors
================================================================

I copied and pasted all the jar files that came with the download of
struts-1.3.8 into my lib directory. Am I missing any file or something
else?

Would be really grateful if somebody could advise me.

ros
 
L

lukasz.kalek

Hello,

I have just started Struts and am trying to run a simple application
on my machine. However when I try to compile the java files it, the
following error comes up on the command-prompt:
===============================================================
C:\java\login>javac -classpath WEB-INF\lib\commons-
beanutils-1.7.0.jar;WEB-INF
\lib\commons-validator-1.3.1.jar;WEB-INF\lib\commons-
digester-1.8.jar;WEB-INF\li
b\oro-2.0.8.jar;WEB-INF\lib\struts-core-1.3.8.jar;WEB-INF\lib
\standard-1.0.2.jar
;WEB-INF\lib\struts-extras-1.3.8;WEB-INF\lib\struts-
scripting-1.3.8.jar;C:\Sun\S
DK\lib\j2ee.jar;"C:\Program Files\Apache Group\Tomcat 5.5\common\lib
\servlet-api
.jar" WEB-INF\src\com\hold\login\*.java -d WEB-INF\classes
WEB-INF\src\com\hold\login\MyForm.java:4: cannot find symbol
symbol : class ActionError
location: package org.apache.struts.action
import org.apache.struts.action.ActionError;
^
WEB-INF\src\com\hold\login\MyForm.java:50: cannot find symbol
symbol : class ActionError
location: class com.hold.login.MyForm
errors.add("password", new
ActionError("error.login.password.invalid
"));
^
2 errors
================================================================

I copied and pasted all the jar files that came with the download of
struts-1.3.8 into my lib directory. Am I missing any file or something
else?

Would be really grateful if somebody could advise me.

ros

Hi,

class ActionError has been deprecated since struts 1.2.0 and replaced
with ActionMessage. You should try to use the latter one.

Regards,
Bigos
 
C

ck

Hi,

class ActionError has been deprecated since struts 1.2.0 and replaced
with ActionMessage. You should try to use the latter one.

Regards,
Bigos

ActionError is deprecated that does not imply that the class would not
compile, it should compile with warnings.
Could you just try to compile by adding struts.jar file in environment
variable classpath instead of javac -classpath option. You probably
are not providing the correct classpath options in

This is just such a confusing way of compiling. Try compiling with
complete path instead of relative path like "c:\struts\struts.jar"
 
L

lukasz.kalek

ActionError is deprecated that does not imply that the class would not
compile, it should compile with warnings.
Could you just try to compile by adding struts.jar file in environment
variable classpath instead of javac -classpath option. You probably
are not providing the correct classpath options in

Right, it should compile with warnings with Struts 1.2.0 - but
ActionError class does not exist in Struts 1.3.8 at all - so it's not
a problem of CLASSPATH.

Regards,
Bigos
 
L

Lew

Right, it should compile with warnings with Struts 1.2.0 - but
ActionError class does not exist in Struts 1.3.8 at all - so it's not
a problem of CLASSPATH.

Besides, it's usually better to specify classpath in the compile command
rather than in an envar, and there is absolutely nothing wrong with using
relative paths in the classpath. In fact, relative classpaths are a great way
to ensure portability of your build script.

-- Lew
 
C

ck

Besides, it's usually better to specify classpath in the compile command
rather than in an envar, and there is absolutely nothing wrong with using

Certainly right
relative paths in the classpath. In fact, relative classpaths are a great way
to ensure portability of your build script.

If at all you call this a build script how do you ensure portability?
C:\java\login>javac -classpath WEB-INF\lib\commons-
beanutils-1.7.0.jar;WEB-INF
\lib\commons-validator-1.3.1.jar;WEB-INF\lib\commons-
digester-1.8.jar;WEB-INF\li
b\oro-2.0.8.jar;WEB-INF\lib\struts-core-1.3.8.jar;WEB-INF\lib
\standard-1.0.2.jar
;WEB-INF\lib\struts-extras-1.3.8;WEB-INF\lib\struts-
scripting-1.3.8.jar;C:\Sun\S
DK\lib\j2ee.jar;"C:\Program Files\Apache Group\Tomcat 5.5\common\lib
\servlet-api.jar"

I would certainly not call it a script, I would rather like to set
Environment variable or use ANT script than to type something so messy
every time(In windows once you close command prompt you cant get
the history of commands) or at least use a batch file.
 
L

Lew

If at all you call this a build script how do you ensure portability?

I never called this a build script.
I would certainly not call it a script,

No one would, unless, of course, those commands were issued from a batch file
and what the OP gave us was the echo of that run.
I would rather like to set Environment variable or use ANT script than to type something so messy
every time(In windows once you close command prompt you cant get
the history of commands) or at least use a batch file.

envars are not the way to go unless you only use your computer from one
project. Ant is definitely the way to go.

My use of the term "build script" was meant to be a big, fat hint to the OP
that if they weren't using a build script, they should. The notion that the
original process was not scripted was meant to be highlighted through irony.
Glad you caught it. (Surely you didn't think I was being anything but ironic?)

-- Lew
 
C

ck

Lew said:
My use of the term "build script" was meant to be a big, fat hint to the OP
that if they weren't using a build script, they should. The notion that the
original process was not scripted was meant to be highlighted through irony.
Glad you caught it. (Surely you didn't think I was being anything but ironic?)

-- Lew

LOL, I know probably I over reacted. Thats first symptom of
inexperience.
 
L

Lew

ck said:
LOL, I know probably I over reacted. Thats first symptom of
inexperience.

I'm glad you chuckled. Actually, you deserve credit for spotting exactly what
the issue was.

-- Lew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top