NutzCN Logo
问答 代码生成器,生成之后,点击数据修改报错。
发布于 2381天前 作者 harryGao65535 1676 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

生成之后没有修改,就报错了

ATTRIBUTE_NOT_FOUND
	at org.beetl.core.om.ObjectAA.value(ObjectAA.java:109)
	at org.beetl.core.statement.VarAttribute.evaluate(VarAttribute.java:62)
	at org.beetl.core.statement.VarRef.evaluate(VarRef.java:118)
	at org.beetl.core.statement.PlaceholderST.execute(PlaceholderST.java:34)
	at org.beetl.core.statement.BlockStatement.execute(BlockStatement.java:68)
	at org.beetl.core.Tag.doBodyRender(Tag.java:60)
	at org.beetl.core.Tag.getBodyContent(Tag.java:69)
	at org.beetl.ext.tag.LayoutTag.render(LayoutTag.java:104)
	at org.beetl.core.statement.TagStatement.runTag(TagStatement.java:108)
	at org.beetl.core.statement.TagStatement.execute(TagStatement.java:87)
	at org.beetl.core.statement.Program.execute(Program.java:70)
	at org.beetl.core.Template.renderTo(Template.java:136)
	at org.beetl.core.Template.renderTo(Template.java:102)
	at org.beetl.ext.web.WebRender.render(WebRender.java:122)
	at org.beetl.ext.nutz.BeetlView.render(BeetlView.java:28)
	at org.nutz.mvc.impl.processor.ViewProcessor.process(ViewProcessor.java:66)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:38)
	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 cn.wizzer.app.web.commons.processor.XssSqlFilterProcessor.process(XssSqlFilterProcessor.java:35)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.NutShiroProcessor.process(NutShiroProcessor.java:52)
	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 cn.wizzer.app.web.commons.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:48)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.app.web.commons.processor.LogTimeProcessor.process(LogTimeProcessor.java:21)
	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:202)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	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.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
	at cn.wizzer.app.web.commons.filter.RouteFilter.doFilter(RouteFilter.java:31)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
	at org.nutz.mvc.WhaleFilter.doFilter(WhaleFilter.java:171)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:215)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:531)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:760)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:678)
	at java.lang.Thread.run(Thread.java:748)
[DEBUG] 18:00:08.206 org.beetl.ext.nutz.LogErrorHandler.processExcption(LogErrorHandler.java:32) - id
>>06:00:08:未找到属性(ATTRIBUTE_NOT_FOUND):id 位于15行 资源:/platform/course/course/send/edit.html
id
12|        <section class="panel panel-form">
13|            <form id="editForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
14|                  action="${base}/platform/course/course/send/editDo" method="post">
15|                <input name="id" type="hidden" value="${obj.id}">
16|                <div class="row mb10">
17|                    <div class="col-lg-12">
18|                        <div class="form-group">

[DEBUG] 18:00:08.207 cn.wizzer.app.web.commons.processor.LogTimeProcessor.process(LogTimeProcessor.java:26) - [GET ]URI=/platform/course/course/send/edit/cf98cde42a184e73903b3fca99ace5dc 42ms
html
<input name="id" type="hidden" value="${obj.id}">
8 回复

我新增了一天数据,然后点击修改按钮,页面跳转为空白,看日志就报上面的错误。

表没有id字段?

@wendal 有的 已经新增成功一条,而且 如果我把 页面的id删了,之后字段也会报错。

看了下代码生成器生成的edit没有返回值,直接把值放到了 我看


@At("/edit/?") @Ok("beetl:/platform/course/course/type/edit.html") @RequiresPermissions("platform.course.course.type") public void edit(String id,HttpServletRequest req) { req.setAttribute("obj", powzCourseTypeService.fetch(id)); log.info("obj"+req.getAttribute("obj")); }

cms模块的修改代码 返回的是object

 @At("/edit/?")
    @Ok("beetl:/platform/sys/dict/edit.html")
    @RequiresPermissions("sys.manager.dict")
    public Object edit(String id, HttpServletRequest req) {
        Sys_dict dict = dictService.fetch(id);
        if (dict != null) {
            req.setAttribute("parentUnit", dictService.fetch(dict.getParentId()));
        }
        return dict;
    }

你改返回值干毛线

方法的返回值就会设置到req的attr,名字就叫obj

@wendal 我没有改,下面的那个改了的是系统自带的,上面的那个obj的是代码生成器生成的。

我跟楼主一样的问题哎,用代码生成器生成的代码,进edit和detail就报ATTRIBUTE_NOT_FOUND的错误

已解决,lombok用习惯了,model类没有添加getter/setter的缘故。

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