• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts

 
Eldo Zacharia
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
I am very much new to struts ..so i have a problem compiling and building struts application .. i have followed the standard directory structure ..buti get the errors below during compilation this is the classpath i have set in the environment variable section (windows xp)
C:\j2sdk1.4.\jre\lib\rt.jar;.;C:\ProgramFiles\Tomcat\common\lib\servlet.jar;.;C:\struts\jakarta-struts-1.1-b2\lib\struts.jar;.;C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\classes

and i use the following .bat file on the cmd line to complie

set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar
set cp =%cp%;C:\Program Files\Tomcat\common\lib\servlet.jar
set classpath=%classpath%;cp
javac -d ..\..\..\classes *.java

Iam doing anything wrong plz let me know if iam

anyone help.


this is the output on the cmd window
C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set_classpath

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\li
b\struts.jar

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set cp =;C:\Program Files\Tomcat\common\lib\servlet.jar

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set classpath=C:\j2sdk1.4.0\jre\lib\rt.jar;.;C:\Program Fi
les\Tomcat\common\lib\servlet.jar;.;C:\struts\jakarta-struts-1.1-b2\lib\struts.jar;.;C:\Program Files\Tomcat\webapps\Min
iHr\WEB-INF\classes;cp;cp

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>javac -d ..\..\..\classes *.java
SearchAction.java:8: cannot resolve symbol
symbol : class ActionFoward
location: package action
import org.apache.struts.action.ActionFoward;
^
SearchAction.java:16: cannot resolve symbol
symbol : class HttpRequest
location: class com.miniHr.SearchAction
HttpRequest request,
^
SearchAction.java:17: cannot resolve symbol
symbol : class HttpResponse
location: class com.miniHr.SearchAction
HttpResponse response)throws Exception
^
SearchAction.java:14: cannot resolve symbol
symbol : class ActionFoward
location: class com.miniHr.SearchAction
public ActionFoward execute(ActionMapping mapping,
^
 
Guido Schoepp
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eldo Zacharia:
set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar
set cp =%cp%;C:\Program Files\Tomcat\common\lib\servlet.jar
set classpath=%classpath%;cp


Try this:
set classpath=%classpath%;%cp%

Guido
 
Eldo Zacharia
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,Thanks a lot for the reply to my question ... but iam still facing the same proble ....This is what i get at the cmd window

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set_classpath

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set cp = C:\Progra
m Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set cp =;C:\Progra
m Files\Tomcat\common\lib\servlet.jar

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>set classpath=C:\j
2sdk1.4.0\jre\lib\rt.jar;.;C:\Program Files\Tomcat\common\lib\servlet.jar;.;C:\s
truts\jakarta-struts-1.1-b2\lib\struts.jar;.;C:\Program Files\Tomcat\webapps\Min
iHr\WEB-INF\classes;.;C:\j2sdk1.4.0\bin;;

C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\src\com\miniHr>javac -d ..\..\..\
classes *.java
SearchAction.java:8: cannot resolve symbol
symbol : class ActionFoward
location: package action
import org.apache.struts.action.ActionFoward;
^
SearchAction.java:16: cannot resolve symbol
symbol : class HttpRequest
location: class com.miniHr.SearchAction
HttpRequest request,
^
SearchAction.java:17: cannot resolve symbol
symbol : class HttpResponse
location: class com.miniHr.SearchAction
HttpResponse response)throws Exception
^
SearchAction.java:14: cannot resolve symbol
symbol : class ActionFoward
location: class com.miniHr.SearchAction
public ActionFoward execute(ActionMapping mapping,



the set_class path.bat file which i use is

set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar
set cp =%cp%;C:\Program Files\Tomcat\common\lib\servlet.jar
set classpath=%classpath%;%cp%
javac -d ..\..\..\classes *.java

thanks again
 
Guido Schoepp
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eldo Zacharia:
set classpath=C:\j2sdk1.4.0\jre\lib\rt.jar;.;C:\Program Files\Tomcat\common\lib\servlet.jar;.;C:\struts\jakarta-struts-1.1-b2\lib\struts.jar;.;C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\classes;.;C:\j2sdk1.4.0\bin;;


I really don't know if the CLASSPATH is case sensitive in Windows but try it:
set CLASSPATH=%CLASSPATH%;%cp%

Otherwise try to set the classpath by parameter of javac:
javac -classpath %classpath% -d ..\..\..\classes *.java

Guido

...and use struts 1.2.4 instead of 1.1-b2...
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

and use struts 1.2.4 instead of 1.1-b2...

Or at least using 1.1-b3, which is the final release of Struts 1.1

Nick
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the set_class path.bat file which i use is

set cp = C:\Program Files\Tomcat\webapps\MiniHr\WEB-INF\lib\struts.jar
set cp =%cp%;C:\Program Files\Tomcat\common\lib\servlet.jar
set classpath=%classpath%;%cp%
javac -d ..\..\..\classes *.java


please try follow me

- create src, classes, lib in c:\
- copy struts.jar to c:\lib directory and
- copy all source code to c:\src directory


set p=c:\classes

set cp=C:\lib\struts.jar

set classpath=.;%p%;%cp%;%classpath%

javac -d %p% *.jar



This will help you to solve problem.
 
Eldo Zacharia
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks a lot for all ur help i was finally able to make a jar file ....will need ur help in near future ..
thank a lot
 
Eldo Zacharia
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi I have come over the problem and sloved the problem ...i was placing my *.java files in a wrong folder..
Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic