JAVA spring 页面填写

wenwen1 发布于 2012/10/11 10:29
阅读 450
收藏 0
<%@page language="java" isELIgnored="false" contentType="text/html; charset=gbk" pageEncoding="gbk"%>
<jsp:directive.include file="/WEB-INF/sitemesh-decorators/include.jsp"/>
<fmt:setBundle basename="bundles.project-resources"/>
<html>
<head>
<title>Edit <fmt:message key="project.title"/></title>
</head>
<body>
<div id="contentarea">     
    <div id="lb"><div id="rb"><div id="bb"><div id="blc">
    <div id="brc"><div id="tb"><div id="tlc"><div id="trc">
    <div id="content">

       
        <form:form action="${pageContext.request.contextPath}/mysaveProject" method="POST" modelAttribute="project">
 <table cellpadding="0" cellspacing="0" id="viewTable">
                <tbody>
                    <tr>
                        <td class="label" valign="top">
                            <fmt:message key="project.projectname.title"/>:
                        </td>
                        <td>
                            <form:input id="project_projectName" path="projectName" cssStyle="width:300px;" value="a"/>
                            <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "project_projectName",widgetType : "dijit.form.ValidationTextBox",widgetAttrs : {promptMessage: "<fmt:message key="project.projectname.help"/>"}})); </script>
                        </td>

                        <td class="label" valign="top">
                            <fmt:message key="project.setupdate.title"/>:
                        </td>
                        <td>
                            <input id="project_createDate" name="createDate" type="text" value="<fmt:formatDate value="${project.createDate.time}" pattern="MM/dd/yyyy h:mm a"/>" style="width:300px;"/>
                            <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "project_createDate",widgetType : "dijit.form.ValidationTextBox",widgetAttrs : {promptMessage: "<fmt:message key="navigation.dateTime.title"/>"}})); </script>
                        </td>
                    </tr>
                    <tr>
                        <td class="label" valign="top">
                            <fmt:message key="project.specification.title"/>:
                        </td>
                        <td>
                            <form:input id="project_specification" path="specification" cssStyle="width:300px;" value="b"/>
                            <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "project_specification",widgetType : "dijit.form.ValidationTextBox",widgetAttrs : {promptMessage: "<fmt:message key="project.specification.help"/>"}})); </script>
                        </td>

                        <td class="label" valign="top">
                            <fmt:message key="project.projectno.title"/>:
                        </td>
                        <td>
                            <form:input id="project_projectNo" path="projectNo" cssStyle="width:300px;" value="c"/>
                            <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "project_projectNo",widgetType : "dijit.form.ValidationTextBox",widgetAttrs : {promptMessage: "<fmt:message key="project.projectno.help"/>"}})); </script>
                        </td>
                    </tr>                   
                    <tr>
                        <td class="label" valign="top">
                            <fmt:message key="projectartical.attribute"/>:
                        </td>
                        <td>   
                        <!-- 下拉框选择 -->                       
                               <form:select path="projectArtical.CProjectAttribute.id" id="projectArtical_attribute_id" items="${attributes}"/>
                        <!-- 下拉框选择 -->       
                        </td>   
                        <td class="label" valign="top">
                         <fmt:message key="projectartical.type.title"/>:
                       </td>
                       <td>   
                        <!-- 下拉框选择 -->                       
                       <form:select path="projectArtical.CActivityType.id" id="projectArtical_type_id" items="${types}"/>
                       <!-- 下拉框选择 -->       
                     </td>       
                    </tr>   
              <tr>
                <td class="label" valign="top">
                  <fmt:message key="projectschedule.begindate.title"/>:
                </td>
                <td>
                <input id="projectSchedule_beginDate" name="beginDate" type="text" value="<fmt:formatDate value="${projectSchedule.beginDate}" pattern="MM/dd/yyyy"/>" style="width:300px;"/>
                <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "projectSchedule_beginDate",widgetType : "dijit.form.ValidationTextBox",widgetAttrs : {promptMessage: "<fmt:message key="projectschedule.begindate.help"/>"}})); </script>
                </td>
                <td class="label" valign="top">
                <fmt:message key="projectschedule.planenddate.title"/>:
                </td>
                <td>
                <input id="projectSchedule_planEndDate" name="planEndDate" type="text" value="<fmt:formatDate value="${projectSchedule.planEndDate}" pattern="MM/dd/yyyy"/>" style="width:300px;"/>
                <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "projectSchedule_planEndDate",widgetType : "dijit.form.ValidationTextBox",widgetAttrs : {promptMessage: "<fmt:message key="projectschedule.planenddate.help"/>"}})); </script>
                 </td>
               </tr>
                <tr>
                <td class="label" valign="top">
                  <fmt:message key="projectartical.level.title"/>:
                </td>
                <td>   
                 <!-- 下拉框选择 -->                       
                  <form:select path="projectArtical.CProjectLevel.id" id="projectArtical_level_id" items="${levels}"/>
                <!-- 下拉框选择 -->       
                </td>   
               <td class="label" valign="top">
                  <fmt:message key="projectartical.projectbudget.title"/>:
                </td>
                <td>
                 <form:input id="projectArtical_projectBudget" path="projectArtical.projectBudget" cssStyle="width:300px;" value="c"/>
                 <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "projectArtical_projectBudget",widgetType : "dijit.form.ValidationTextBox",widgetAttrs : {promptMessage: "<fmt:message key="projectartical.projectbudget.help"/>"}})); </script>
                </td>
               </tr>
              </tbody>
            </table>
            <table cellpadding="0" cellspacing="0">
             <tbody>
              <tr>
             <td class="label" valign="top">
                  <fmt:message key="userInfo.userId.title"/>:
            </td>
             <td>
              <form:input id="userinfo_userId" path="userinfo.userId" cssStyle="width:300px;"/>
              <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "userinfo_userId",widgetType : "dijit.form.ValidationTextBox",widgetAttrs : {promptMessage: "<fmt:message key="userinfo.userId.help"/>"}})); </script>
             </td>
            <td class="label" valign="top">
              <fmt:message key="userbycreater.title"/>:
            </td>
            <td>   
            <!-- 下拉框选择 -->                       
             <form:select path="userByCreater.id" id="userByCreater" items="${users}"/>                           
            <!-- 下拉框选择 -->       
            </td>   
             </tr>
             </tbody>
            </table>
            <span class="inputbutton"><input class="savebutton" id="save" type="submit" value="<fmt:message key="navigation.save"/>"/></span>
            <script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'save', event:'onclick'}));</script>
        </form:form>
        <div class="clear">&nbsp;</div>
    </div>
    </div></div></div></div>
    </div></div></div></div>
</div>
</body>

</html>

我在这页面中需要写红色代码,需要写到其他数据库的字段,而userinfo和user是一对一的关系,user和project是一对一的关系,会报

org.springframework.beans.NotReadablePropertyException: Invalid property 'userinfo' of bean class [net.gvsun.preparation.domain.Project]: Bean property 'userinfo' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
    at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729)
    at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:576)
    at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:553)
    at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:719)
    at org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:99)
    at org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:219)
    at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:120)
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:178)
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:198)
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getName(AbstractDataBoundFormElementTag.java:164)
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.writeDefaultAttributes(AbstractDataBoundFormElementTag.java:127)
    at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:421)
    at org.springframework.web.servlet.tags.form.InputTag.writeTagContent(InputTag.java:142)
    at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:102)
    at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)
    at org.apache.jsp.WEB_002dINF.pages._005fproject.projectApplication_jsp._jspx_meth_form_005finput_005f4(projectApplication_jsp.java:1065)
    at org.apache.jsp.WEB_002dINF.pages._005fproject.projectApplication_jsp._jspx_meth_form_005fform_005f0(projectApplication_jsp.java:369)
    at org.apache.jsp.WEB_002dINF.pages._005fproject.projectApplication_jsp._jspService(projectApplication_jsp.java:108)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:139)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:65)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
    at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)

加载中
返回顶部
顶部