新建了一个工程,Message,做了一个findall.jsp,无论里面的代码如何去修改,都是报这一种错误。如下:
org.apache.jasper.JasperException: Unable to compile class for JSP
No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path
而且main.jsp,报的是找不到Action\findall,我tomcat下的JAR包没有问题,还有而把finall换到别的网站的文件夹下,就可以,即使报错,也是正常报错。
我的Message里面的Struts配置文件如下:
<action-mappings>
<action input="/main.jsp" name="formBean" parameter="add" path="/createmessage" scope="request" type="messagestruts.MessageControlAction" validate="true">
<forward name="createsuccess" path="/created.jsp" />
</action>
<action input="/main.jsp" name="formBean" parameter="queryall" path="/createmessage" scope="request" type="messagestruts.MessageControlAction" validate="true">
<forward name="queryallsuccess" path="/findwall.jsp" />
</action>
</action-mappings>
会不会是配置文件的问题呢?
參考答案:你用的什么工具? 是不是需要jar包 有的jdk 没有 得手工加 也可能是jdk路径配置有问题