日期:2014-05-18  浏览次数:20804 次

cookie与路由器有关么?
我用jsp写了一个读写cookie的程序,服务器是tomcat。
我自己有一个路由器,路由器的ip:191.168.1.1,我的电脑是:192.168.1.2
现在在路由器中设置了一个转发规则,端口为:8080,指向192.168.1.2
当我在ie中输入http://localhost:8080/test.jsp,则运行正常
当我在ie中输入http://60.186.222.192:8080/test.jsp,则运行出错
错误信息如下:
exception  

org.apache.jasper.JasperException:   test_cookie
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
util.MainFilter.doFilter(MainFilter.java:31)


root   cause  

java.lang.IllegalArgumentException:   test_cookie
org.apache.tomcat.util.http.ServerCookie.maybeQuote(ServerCookie.java:276)
org.apache.tomcat.util.http.ServerCookie.appendCookieValue(ServerCookie.java:209)
org.apache.coyote.tomcat5.CoyoteResponse.addCookie(CoyoteResponse.java:950)
org.apache.coyote.tomcat5.CoyoteResponseFacade.addCookie(CoyoteResponseFacade.java:291)
org.apache.jsp.sys.ip_005fmac_005faddress_jsp._jspService(ip_005fmac_005faddress_jsp.java:134)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
util.MainFilter.doFilter(MainFilter.java:31)

注明:60.186.222.192是通过拨号上网获得的一个ip
            test_cookie是设置cookie的值

目前对出现错误的原因不明,解决方案也未找到,希望大家指点



------解决方案--------------------
恭喜~~~
接分