NutzCN Logo
问答 ajax提交数据进不去moudle
发布于 2339天前 作者 读书人 1986 次浏览 复制 上一个帖子 下一个帖子
标签:
function shangbao() {
		alert(111);
	
		$.ajax({  
            url : "${pageContext.request.contextPath }/report/saveReport",
            type:"POST",
            data :{"wxid":$("#wxid").val(),
            	"name":$("#name").val(),
            	"phone":$("#phone").val(),
            	"address":$("#address").val(),
            	"wenti":$("#wenti").val(),
            	"note":$("#note").val()
            	},
           error:function(request){
        	   alert(222);
           },
            dataType : "json",
            success : function(request) {
                    alert("提交成功");
                }
            
        });

	}

这里是moudle


@IocBean @At("/report") @Ok("json") @Fail("http:500") public class ReportMoudle { @Inject private ReportDao reportDao; @At public Object saveReport(@Param("wxid")String wxid,@Param("name")String name, @Param("phone")String phone,@Param("address")String address, @Param("wenti")String wenti,@Param("note")String note){ //用户上报 Report report=new Report(); report.setWxid(wxid); report.setName(name); report.setPhone(phone); report.setWenti(wenti); report.setNote(note); report.setAddress(address); report.setId(new GUID().getguid()); report.setRepDate(new Date()); reportDao.save(report); return "ok"; };

也不报错,弹窗222
alert数据,数据也有,就是进不去moudle 断点也不走

55 回复

后台总有点日志吧?>

没有,什么都没有。就是直接弹窗222

console.log(request) 看看啥错误嘛

他也不打印,。后台啥都没有,
具体是这个样的,这是微信公众号测试号,点击菜单进入到servlet,然后将获取的openid请求转发到jsp,jsp将填写的表单数据和opneid提交到module,然后module就进不去了,数据是对的,alert也有数据,但是控制台直接打印 error

因为进errror回调了

数据不规范? 老哥 怎么解决

知道console.log怎么看吧?error回调会提示原因的

这段js是写在jsp里面的?

对,js是在jsp里 。这个console 没用过。。。

chrome浏览器, 按 crtl+shift+I

error回调有3个参数的,都打印或者alert一下

 Function( jqXHR jqXHR, String textStatus, String errorThrown )

http://api.jquery.com/jquery.ajax/

	send	@	jquery-1.11.1.min.js:9631
ajax	@	jquery-1.11.1.min.js:9176
shangbao	@	ceshi.jsp:100
tijiao	@	ceshi.jsp:94
onclick	@	ceshi.jsp:156
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

 <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/Hui.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/api.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/common.css"/>
     <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/form.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath }/res/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/res/iscroll/iscroll.js"></script>
    
    <script type="text/javascript" src="${pageContext.request.contextPath }/script/common.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/script/api.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/script/file.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/script/topath.js"></script>
  </head>
  
 <style>
.header {
	padding-top: 15px;
}
.title {
	font-size: 18px;
	font-weight: bold;
}
.info {
	font-size: 12px;
	color: #999;
	padding: 5px 0;
	border-bottom: 1px #dadada solid;
}
.content {
	font-size: 16px;
	color: #333;
	padding: 10px;
	line-height: 1.5;
}
.files {
	padding: 10px;
	line-height: 2;
}

p{
	width:100%;
	
background-color: #E6E6E6;
	
	font-size: 18px;
}
select{

 border: solid 1px #E6E6E6;
 appearance:none;
  -moz-appearance:none;
  -webkit-appearance:none;

 padding-right: 14px;
	font-size:19px;
	height: 30px;

}
select::-ms-expand { display: none; }
input{
background-color:#FFFFFF;
	font-size:22px;
}
button{
background-color:#FFFFFF;
	font-size:18px;
}
  
</style>
<script type="text/javascript">
function tijiao(){
	if($("#phone").val()=="" ||$("#phone").val()==null){
        alert("手机号不能为空");
        	return false;
        }
       if($("#name").val()=="" ||$("#name").val()==null){
        alert("姓名不能为空");
        	return false;
        }
      	if($("#address").val()=="" ||$("#address").val()==null){
        alert("地址不能为空");
        	return false;
        }
            
      	shangbao();
	}
	var reurl="${pageContext.request.contextPath }/report/saveReport"
	
	function shangbao() {
		alert(reurl);
		$.ajax({  
            url : reurl,
            type:"POST",
            data :{"wxid":$("#wxid").val(),
            	"name":$("#name").val(),
            	"phone":$("#phone").val(),
            	"address":$("#address").val(),
            	"wenti":$("#wenti").val(),
            	"note":$("#note").val()
            	},
           error:function(res){
        	  
        	   alert(2222);
           },
            
            success : function(res) {
                    alert("提交成功");
                }
            
        });

	}

</script>
  <body class="fbv">

       <div class="main f1" id="wrapper">
		<form id="reportform">
			<input type="hidden"   class="village" name="wxid" id="wxid" value="${openid}"/>
   	 		 <div class="ipts type">
				<div class="label">手机号</div>
				<div class="ctx "><input type="text" maxlength="11"  class="village" name="phone" id="phone"/></div>
			</div>
			<div class="ipts type">
				<div class="label">姓名</div>
				<div class="ctx "><input type="text" class="fno" name="name" id="name"/></div>
			</div>
			
			<div class="ipts type">
				<div class="label">地址</div>
				<div class="ctx "><input type="text" class="fno" name="address" id="address"/></div>
			</div>
			<div class="ipts type">
				<div class="label">下拉框</div>
				<div class="ctx "><select id="wenti" name="wenti" border="0">
					<option value="问题1">问题1</option>
					<option value="问题2">问题2</option>
					<option value="问题3">问题3</option>
					<option value="问题4">问题4</option>
					</select></div>
			</div>
			<div class="ipts type">
				<div class="label">备注</div>
				<div class="ctx "><textarea type="text" class="fno" name="note" id="note" style="width:98%"></textarea></div>
			</div>
			</form>
     <button class="H-button H-width-100-percent  H-font-size-15 H-outline-none H-padding-vertical-both-12 H-padding-horizontal-both-20 H-theme-background-color9 H-theme-font-color-white H-theme-border-color9 H-theme-border-color9-click H-theme-background-color9-click H-theme-font-color9-click H-border-radius-3" type="button" value=""  onclick="tijiao()">提交</button>
		
     </div>
  </body>
</html>

贴这些干啥??

我把jsp代码删了 重新写一遍试试

... 你先学会console.log怎么用吧

另外,写${base}就行了,不必那么长

写了一个简单的jsp 还是老样子,,,,, 老哥,加个QQ详聊吧

学会console.log怎么看没?

没。。。 老哥 你在那个nutz 社区群不,名字是什么。qq方便

那你在qq群找人吧

没人回。。。。 这个哪写错了 怎么改

学一下console.log?

我这个是微信公众号测试号点击菜单 带openid进jsp的 用浏览器带不了openid,用console会不会有两种结果

要看errorThrown 是什么内容, error回调的第三个参数

是直接在浏览器 console 输入console.log(errorThrown) 回车吗

           error:function(res, textStatus, errorThrown ){
        	   alert(2222); // 这是你原本写的alert
        	   alert(res);
                   alert(textStatus);
                   alert(errorThrown); // 看这个报啥
        	   console.log(res);
                   console.log(textStatus);
                   console.log(errorThrown);
           },

alert(textStatus); 弹 error alert(errorThrown); 就弹空白,什么字都没有

这jsp没有跟微信公众号有关联的样子, 在Chrome浏览器里面试嘛

嗯嗯 就是在在浏览器试了,弹的空白

继续加

            alert(res.responseText);
            alert(res.status);
            alert(res.readyState);
            alert(res.statusText);
family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> /WxCat/report/saveReport</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/8.5.20</h3></body></html>

然后是 404 4 error

原来404了, 项目的ContextPath就是/WxCat ? 把启动日志发一下看看

六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/8.5.20
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Aug 2 2017 21:35:49 UTC
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         8.5.20.0
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Windows 8
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            6.2
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          amd64
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             F:\MyEclipse\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\jre
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.7.0_45-b18
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         G:\tomcat-8.5.20
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         G:\tomcat-8.5.20
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:58954
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=G:\tomcat-8.5.20
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=G:\tomcat-8.5.20
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=G:\tomcat-8.5.20/common/endorsed
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.io.tmpdir=G:\tomcat-8.5.20\temp
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.library.path=F:\MyEclipse\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\bin;G:\tomcat-8.5.20\bin
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dsun.io.useCanonCaches=false
六月 22, 2018 11:54:36 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [F:\MyEclipse\binary\com.sun.java.jdk7.win32.x86_64_1.7.0.u45\bin;G:\tomcat-8.5.20\bin]
六月 22, 2018 11:54:36 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
六月 22, 2018 11:54:36 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
六月 22, 2018 11:54:36 上午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
六月 22, 2018 11:54:36 上午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 795 ms
六月 22, 2018 11:54:36 上午 org.apache.catalina.core.StandardService startInternal
信息: Starting service [Catalina]
六月 22, 2018 11:54:36 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.5.20
六月 22, 2018 11:54:36 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [G:\tomcat-8.5.20\webapps\docs]
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [G:\tomcat-8.5.20\webapps\docs] has finished in [519] ms
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [G:\tomcat-8.5.20\webapps\examples]
六月 22, 2018 11:54:37 上午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
六月 22, 2018 11:54:37 上午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [G:\tomcat-8.5.20\webapps\examples] has finished in [532] ms
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [G:\tomcat-8.5.20\webapps\host-manager]
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [G:\tomcat-8.5.20\webapps\host-manager] has finished in [27] ms
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [G:\tomcat-8.5.20\webapps\manager]
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [G:\tomcat-8.5.20\webapps\manager] has finished in [46] ms
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [G:\tomcat-8.5.20\webapps\ROOT]
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [G:\tomcat-8.5.20\webapps\ROOT] has finished in [28] ms
六月 22, 2018 11:54:37 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory [G:\tomcat-8.5.20\webapps\WxCat]
六月 22, 2018 11:54:38 上午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
六月 22, 2018 11:54:38 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory [G:\tomcat-8.5.20\webapps\WxCat] has finished in [1,154] ms
六月 22, 2018 11:54:38 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
六月 22, 2018 11:54:38 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
六月 22, 2018 11:54:38 上午 org.apache.catalina.startup.Catalina start
信息: Server startup in 2384 ms

嗯?? eclipse里面启动的? idea里面启动的??

没有任何应用日志呢

刚接手的项目?? 其他请求和页面都正常??

我第一次弄这个微信公众号开发,其他页面也不正常,

嗯,基本可以确定项目根本没跑起来

先入门一下吧 http://nutzbook.wendal.net

六月 22, 2018 3:12:51 下午 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet [jsp] threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [14] in the generated java file: [G:\tomcat-8.5.20\work\Catalina\localhost\birthday\org\apache\jsp\weixin_jsp.java]
Only a type can be imported. com.souvc.weixin.pojo.SNSUserInfo resolves to a package

An error occurred at line: [16] in the jsp file: [/weixin.jsp]
SNSUserInfo cannot be resolved to a type
13: <body>
14:     <% 
15:         // 鑾峰彇鐢監AuthServlet涓紶鍏ョ殑鍙傛暟
16:         SNSUserInfo user = (SNSUserInfo)request.getAttribute("snsUserInfo"); 
17:         String state=request.getAttribute("state").toString();
18:         if(null != user) {
19:     %>


An error occurred at line: [16] in the jsp file: [/weixin.jsp]
SNSUserInfo cannot be resolved to a type
13: <body>
14:     <% 
15:         // 鑾峰彇鐢監AuthServlet涓紶鍏ョ殑鍙傛暟
16:         SNSUserInfo user = (SNSUserInfo)request.getAttribute("snsUserInfo"); 
17:         String state=request.getAttribute("state").toString();
18:         if(null != user) {
19:     %>


Stacktrace:
	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:212)
	at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:601)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
	at com.webro.servlet.OAuthServlet.doGet(OAuthServlet.java:41)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.nutz.mvc.NutFilter.nextChain(NutFilter.java:230)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:205)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:744)

老哥帮忙看一下 这是什么原因。

jsp就别写代码了, 啥年代了

这个项目是别人写的 领导让学习,,,一跑起来就这样了。。。

项目名字叫 birthday 我也是无奈啊

你改过东西吧?

一点都没改,下午刚拿到

SNSUserInfo cannot be resolved to a type 这类没import?

。。。jsp不提示错误, 改过来了,

六月 22, 2018 3:39:41 下午 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet [jsp] threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [15] in the generated java file: [G:\tomcat-8.5.20\work\Catalina\localhost\birthday\org\apache\jsp\weixin_jsp.java]
Only a type can be imported. com.souvc.weixin.pojo.SNSUserInfo resolves to a package

Stacktrace:
	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:212)
	at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:601)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:467)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:392)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
	at com.webro.servlet.OAuthServlet.doGet(OAuthServlet.java:41)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.nutz.mvc.NutFilter.nextChain(NutFilter.java:230)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:205)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:744)

这个错误是不是jar包的冲突啊

JSP的import了解一下?

错误不报了, 但是微信页面点击菜单提示 用户不同意授权,未获取到用户信息! 也没提示要授权啊

老师 谢谢你了,能不能推荐几本关于微信公众号开发的书啊

添加回复
请先登陆
回到顶部