Servlet-api.jar has no source attachment problem with Tomcat authoring web in Eclipse

Source: Internet
Author: User
Tags tomcat tomcat server

Servlet-api.jar has no source attachment problem with Tomcat authoring web in Eclipse
https://www.iyunv.com/forum.php?mod=viewthread&tid=96915&fromuid=272238
(Source: Operation and Maintenance Network)


These days, I want to finish the mail server hypothesis through James, do a simple Web application verification, in the service side jump when there is a problem, when the debug is executed but there is no page jump, debug the result is .... Surface phenomena:
.../tomcat_home/servlet-api.jar has no source attachment found himself a bit in the build path added, and in the. /tomcat/lib/also exist Servlet.jar, is not find the problem, is Google, finally on the csdn have a similar encounter of the elder brother (also may be elder sister), finally he did not solve, play two Cs, I did a bit of modification
The jump statement that appears in the Servlet program
Request.getrequestdispatcher (URL). Forward (request, response);
Switch
RequestDispatcher rd=request.getrequestdispatcher (URL);
Rd.forward (request, response);
Restarting the Tomcat server, and then running on the inexplicable completion rate jump, not easy ah. It took a couple of hours to fix it, and there was not much excitement, and the feeling was that eclipse might have bugs, write points, and hopefully have a similar situation to help.
Problem solving:
  


After installing Tomcat, there was an error in compiling the. java file: Package Javax.servlet does not exist
Originally this package in the Web server only, J2SE did not, so caused the error.
Workaround:
Method (1) Find the Servlet-api.jar in the%tomcat%\common\lib directory, add this path to the environment variable classpath, it is possible. (This doesn't seem to work very well, after I re-installed Tomcat, I don't have to reconfigure it.)
Method (2) Locate the Servlet-api.jar in the%tomcat%\common\lib directory, add the jar to the%java_home%/\jdk1.6.0\jre\lib\ext directory, and the different JDK versions are the same.
This situation can lead to a lot of bugs, and it is recommended to use the method (2) To solve the problem completely.
Java enthusiasts who want to help beginners
  
We have a reference .....
Finally thanks, Apache's James Mail server .....

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.