example of using ServletUnit to test JSP's

后端 未结 2 1176
余生分开走
余生分开走 2021-01-06 20:08

Can anyone point me to an example of how to use ServletUnit to test JSP\'s? Do I need I need to call registerServlet()? If so, what class name do I pass?

2条回答
  •  感动是毒
    2021-01-06 20:24

    You do not need to registerServlet if you are going use the default Jasper compiler. However, I needed Jasper jars and their dependencies on the CLASSPATH. The Maven dependencies I needed to get a basic JSP to compile and render were:

    
      tomcat
      jasper
      3.3.2
      test
    
    
      tomcat
      jasper-compiler
      5.5.23
      test
    
    
      tomcat
      tomcat-util
      5.5.23
      test
    
    
      tomcat
      core_util
      3.3.2
      test
    
    

    I am stuck in a JDK1.4 project,so you may be able to use newer versions. I haven't gotten standard taglib working yet...

提交回复
热议问题