关于tomcat和Struts的错误?谢谢!在线等!
我用Struts开发了一个系统,昨天还没有问题,今天在访问的时候出现下面的错误:
org.apache.jasper.JasperException: Unresolved compilation problems:
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
The method matches(String) is undefined for the type String
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
。。。。。。。。。。。。。。。。。。。。。。。。。。。
访问的相关的Action的代码如下:
/*
* InsertAction.java
*
* Generated on Sun Oct 24 16:39:52 CST 2004
* by Exadel Struts Studio
*/
package liTown.insert;
import liTown.town.*;
import liTown.sys.Database;
import liTown.sys.OperateStr;
import javax.naming.*;
import java.util .*;
import java.sql.*;
import javax.sql .*;
import java.io.*;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.util.MessageResources;
public class InsertAction extends org.apache.struts.action.Action {
// Global Forwards
public static final String GLOBAL_FORWARD_welcome = "welcome";
public InsertAction() {
// TODO: Write constructor body
}
String sql;
boolean flag;
boolean isInsert;
Database db=new Database();
String place;
String subject;
String todoPlace;
String todoSubject;
Statement stmt;
Town town=new Town();
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
todoPlace=request.getParameter("todoplace");
todoSubject=request.getParameter("todosubject");
//设定标志flag,标志是否完成了最后数据提交
HttpSession session=request.getSession() ;
//对 token进行判断,判断session中的令牌值和页面中的相同,如果不相同,返回错误信息
ActionErrors errors=new ActionErrors();
if(!isTokenValid(request)){
errors.add("errors.insert.jsp.repeatCommit",new ActionError("errors.insert.jsp.repeatCommit"));
saveErrors(request,errors);
saveToken(request);
request.setAttribute("place",todoPlace);
request.setAttribute("subject",todoSubject);
return(new ActionForward(mapping.getInput()));
}
else{
resetToken(request);
saveToken(request);
}
//录入镇区专业调查表时的动作
if(todoPlace=="town"){
if(todoSubject.matches("general")) {
town.exatrGeneral((InsertForm)form);
request.setAttribute("test","general") ;
}
else if(todoSubject.matches("baseinfo")){
town.extratBaseInfo((InsertForm)form);
request.setAttribute("test","baseinfo") ;
}
else if(todoSubject.matches("consinfo")){
town.extraConsinfo((InsertForm)form);
request.setAttribute("test","consinfo") ;
}
else if(todoSubject.matches("traconsinfo")){
town.extraTraConsinfo((InsertForm)form);
request.setAttribute("test","traconsinfo") ;
}
else if(todoSubject.matches("newconsinfo")){
town.extraNewConsinfo((InsertForm)form);
request.setAttribute("test","newconsinfo") ;
}
else if (todoSubject.matches("qualinfo")){
town.extraQualinfoInsert((InsertForm)form);
request.setAttribute("test","qualinfo") ;
}
else {
request.setAttribute("test","qualinfo") ;
town.extraCorebrickinfo((InsertForm)form);
town.inserTowndata();
session.setAttribute("flag","true");
}
}
return(mapping.findForward("insert"));
}
}
哪位好心人帮忙给看看,为什么会这样?
问题点数:0、回复次数:5Top
1 楼magie16036936(magie)回复于 2005-03-04 11:01:32 得分 0
类型不对吧`~Top
2 楼myth822(↑八月的吟游者↑)回复于 2005-03-04 11:03:17 得分 0
你的jsp有问题,
The method matches(String) is undefined for the type StringTop
3 楼li426(金丝楠木)回复于 2005-03-04 11:05:50 得分 0
jsp 有问题,能说清楚些吗?Top
4 楼java_augur(听着音乐 ☆☆☆☆☆☆)回复于 2005-03-04 11:17:24 得分 0
贴jsp代码Top
5 楼xiaozhen()回复于 2005-03-04 13:01:49 得分 0
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
一般报告这样的错误时,都是jsp代码不正确。
如果你是用jb开发的,可以用jb编译对应的jsp文件,就知道更详细的错误提示。Top




