错误
org.nutz.json.JsonException: !Json syntax error nearby [row:1,col:1 char 'u'], reason: 'Unexpect String = uid=1&Loginname=adminA&nickname=adminS&gender=SSSS&avatar=&email=SSSS&dt=+SSSSS'
at org.nutz.json.impl.JsonTokenScan.readObject(JsonCompileImplV2.java:297)
at org.nutz.json.impl.JsonTokenScan.read(JsonCompileImplV2.java:354)
at org.nutz.json.impl.JsonCompileImplV2.parse(JsonCompileImplV2.java:26)
at org.nutz.json.Json.fromJson(Json.java:42)
at org.nutz.mvc.adaptor.JsonAdaptor.getReferObject(JsonAdaptor.java:41)
at org.nutz.mvc.adaptor.AbstractAdaptor.adapt(AbstractAdaptor.java:226)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:28)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:126)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at com.microclass.mvc.LogTimeProcessor.process(LogTimeProcessor.java:19)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
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:474)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
function form_submit(form) {
var l = $("button[type=submit]").ladda();
$.ajax({
url : $(form).attr("action"),
type : "POST",
data : $(form).serialize(),
cache : false,
async : true,
dataType : "json",
beforeSend : function(obj) {
alert("大大大大的");
l.ladda('start');
},
complete : function(obj) {
l.ladda('stop');
},
success : function(obj) {
if (obj != null) {
//toastr_alert(obj._info, obj._type);
if (obj) {
//$("#myModal2").modal("hide");
toastr.success("登录成功");
$(window).attr('location','adminindex');
}
else {
toastr.error("账号密码错误");
}
}
}
});
}
@At("/update")
@AdaptBy(type=JsonAdaptor.class)
@Ok("json")
public Object update(@Param("..")UserProfile profile, @Attr(scope=Scope.SESSION, value="me")int userId) {
if (profile == null)
return false;
profile.setUserId(userId);//修正userId,防止恶意修改其他用户的信息
profile.setUpdateTime(new Date());
profile.setAvatar(null); // 不准通过这个方法更新
UserProfile old = getuser(userId);
// 检查email相关的更新
if (old.getEmail() == null) {
// 老的邮箱为null,所以新的肯定是未check的状态
profile.setEmailChecked(false);
} else {
if (profile.getEmail() == null) {
profile.setEmail(old.getEmail());
profile.setEmailChecked(old.isEmailChecked());
} else if (!profile.getEmail().equals(old.getEmail())) {
// 设置新邮箱,果断设置为未检查状态
profile.setEmailChecked(false);
} else {
profile.setEmailChecked(old.isEmailChecked());
}
}
Daos.ext(dao, FieldFilter.create(UserProfile.class, null, "avatar", true)).update(profile);
return true;
}