不行哦!
错误如下:
HTTP Status 500 - type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unexpected internal error near index 1
\
^
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
newsassurancefinal.servlet.ShowSecondTitleServlet.doGet(ShowSecondTitleServlet.java:18)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
^
java.util.regex.Pattern.error(Pattern.java:1650)
java.util.regex.Pattern.compile(Pattern.java:1403)
java.util.regex.Pattern.<init>(Pattern.java:1124)
java.util.regex.Pattern.compile(Pattern.java:817)
java.lang.String.replaceAll(String.java:2000)
org.apache.jsp.rightView_jsp._jspService(org.apache.jsp.rightView_jsp:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
newsassurancefinal.servlet.ShowSecondTitleServlet.doGet(ShowSecondTitleServlet.java:18)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
偶的代码:
for (int j = 0; j < bean1.getSecondTitleList(bean0).size(); j++) //得到标题的ArrayList的长度
{
String url = bean1.getUrl(bean2); //从数据库中得到所需文件的路径(得到的路径就是我上面写的哪个!)
String url1 = url.replaceAll("\\", "/");
out.println(url1);