|
INTERVIEW QUESTIONS
J2EE
STRUTS
DETAILS
Question: When do I need "struts.jar" on my classpath?
Answer: When you are compiling an application that uses the Struts classes, you must have the "struts.jar" on the classpath your compiler sees -- it does not have to be on your CLASSPATH environment variable. Why is that an important distinction? Because if you are using a servlet container on your development machine to test your application, the "struts.jar" must not be on your CLASSPATH environment variable when running the container. (This is because each Web application must also have their own copy of the Struts classes, and the container will become confused if it is on the environment path as well.) There are several general approaches to this issue: * Use ANT for building your projects -- it can easily assemble classpaths for the compiler. (This is how Struts itself is built, along with Tomcat and most other Java-based projects). * Use an IDE where you can configure the "class path" used for compilation independent of the CLASSPATH environment variable. * Use a shell script that temporarily adds struts.jar to the classpath just for compilation, for example javac -classpath /path/to/struts.jar:$CLASSPATH $@
|
|
|
Category |
Struts Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 8393 users |
Added on |
8/31/2014 |
Views |
71134 |
Rate it! |
|
|
Question:
When do I need "struts.jar" on my classpath?
Answer:
When you are compiling an application that uses the Struts classes, you must have the "struts.jar" on the classpath your compiler sees -- it does not have to be on your CLASSPATH environment variable. Why is that an important distinction? Because if you are using a servlet container on your development machine to test your application, the "struts.jar" must not be on your CLASSPATH environment variable when running the container. (This is because each Web application must also have their own copy of the Struts classes, and the container will become confused if it is on the environment path as well.) There are several general approaches to this issue: * Use ANT for building your projects -- it can easily assemble classpaths for the compiler. (This is how Struts itself is built, along with Tomcat and most other Java-based projects). * Use an IDE where you can configure the "class path" used for compilation independent of the CLASSPATH environment variable. * Use a shell script that temporarily adds struts.jar to the classpath just for compilation, for example javac -classpath /path/to/struts.jar:$CLASSPATH $@ Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Struts Interview Questions & Answers - Exam Mode /
Learning Mode
|