ArrayList<plant> articleList = new ArrayList<plant>();
↓
ArrayList articleList = new ArrayList();
=====>내답변1
빨간줄은 사라졌는데.. 에러가 막 나요..혹시 다른 방법은 없을까요..
=====>답변1-1
음 에러가 어떤것인지 싹 올려보시죠.
=====>내 답변1-1
java파일수정하고 jsp에는 <p>${article.value}</p> 이렇게 적었습니다.
화면에는 500에러라고 alert창이 떴습니다.
2014. 9. 12 오후 2:23:20 org.apache.catalina.core.ApplicationDispatcher invoke
심각: Servlet.service() for servlet jsp threw exception
javax.el.PropertyNotFoundException: Property 'value' not found on type plantid.plant.beans.plant
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206)
at javax.el.BeanELResolver.property(BeanELResolver.java:317)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
at org.apache.el.parser.AstValue.getValue(AstValue.java:182)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967)
at org.apache.jsp.plantlistdata_jsp._jspx_meth_c_005fforEach_005f0(plantlistdata_jsp.java:168)
at org.apache.jsp.plantlistdata_jsp._jspService(plantlistdata_jsp.java:83)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at plantid.common.controller.ControllerAction.requestPro(ControllerAction.java:109)
at plantid.common.controller.ControllerAction.doPost(ControllerAction.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2014. 9. 12 오후 2:23:20 org.apache.catalina.core.StandardWrapperValve invoke
심각: Servlet.service() for servlet [ControllerAction] in context with path [/plantid] threw exception [An exception occurred processing JSP page /plantlistdata.jsp at line 19
16: <p class="title">${article.plant_kr_name}</p>
17: <p>${article.plant_en_name}</p>
18: <p>${article.scie_name}</p>
19: <p>${article.value}</p>
20: </td>
21: </tr>
22: </table>
Stacktrace:] with root cause
javax.el.PropertyNotFoundException: Property 'value' not found on type plantid.plant.beans.plant
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206)
at javax.el.BeanELResolver.property(BeanELResolver.java:317)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
at org.apache.el.parser.AstValue.getValue(AstValue.java:182)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967)
at org.apache.jsp.plantlistdata_jsp._jspx_meth_c_005fforEach_005f0(plantlistdata_jsp.java:168)
at org.apache.jsp.plantlistdata_jsp._jspService(plantlistdata_jsp.java:83)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at plantid.common.controller.ControllerAction.requestPro(ControllerAction.java:109)
at plantid.common.controller.ControllerAction.doPost(ControllerAction.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
jsp에서 받을 때 value에 값이 없다는 것 같습니다.
=====>내 답변1-1-1
java파일에 소스 추가해보겠습니다.;;;
=====>내 답변1-1-1-1
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
이렇게 추가했습니다..
이거 추가하는 거 빼먹어서 인줄 알고 얼른 했는데..
또 이런게 뜨네요...
2014. 9. 12 오후 2:29:17 org.apache.catalina.core.ApplicationDispatcher invoke
심각: Servlet.service() for servlet jsp threw exception
javax.el.PropertyNotFoundException: Property 'plant_id' not found on type java.lang.String
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206)
at javax.el.BeanELResolver.property(BeanELResolver.java:317)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
at org.apache.el.parser.AstValue.getValue(AstValue.java:182)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967)
at org.apache.jsp.plantlistdata_jsp._jspx_meth_c_005fforEach_005f0(plantlistdata_jsp.java:148)
at org.apache.jsp.plantlistdata_jsp._jspService(plantlistdata_jsp.java:83)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at plantid.common.controller.ControllerAction.requestPro(ControllerAction.java:109)
at plantid.common.controller.ControllerAction.doPost(ControllerAction.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2014. 9. 12 오후 2:29:17 org.apache.catalina.core.StandardWrapperValve invoke
심각: Servlet.service() for servlet [ControllerAction] in context with path [/plantid] threw exception [javax.el.PropertyNotFoundException: Property 'plant_id' not found on type java.lang.String] with root cause
javax.el.PropertyNotFoundException: Property 'plant_id' not found on type java.lang.String
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206)
at javax.el.BeanELResolver.property(BeanELResolver.java:317)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
at org.apache.el.parser.AstValue.getValue(AstValue.java:182)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967)
at org.apache.jsp.plantlistdata_jsp._jspx_meth_c_005fforEach_005f0(plantlistdata_jsp.java:148)
at org.apache.jsp.plantlistdata_jsp._jspService(plantlistdata_jsp.java:83)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at plantid.common.controller.ControllerAction.requestPro(ControllerAction.java:109)
at plantid.common.controller.ControllerAction.doPost(ControllerAction.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
=======>답변1-2
지금 plant라는 VO(DTO, DO) 여러개를 List로 담으려는것 같네요.
그럼 plant에 이미 value 속성을 추가하고 getter, setter까지 처리했으니
plantdata.setValue(value);
하면 끝입니다.
나머지는 필요없네요
==========>답변1-3
ArrayList<plant> articleList = new ArrayList<plant>();
↓
ArrayList articleList = new ArrayList();
그리고 요거 다시 원래대로 돌려놔도 됩니다.
=========>내답변 1-3
오 됐어요! 감사합니다! 진짜 감사합니다.
추가로 질문드려도 되나요..?
ArrayList<plant> articleList = new ArrayList<plant>();
여기에서 plant가 의미하는게
string이 string형만 받을거야 하는 것처럼..
plant라는 데이터형을 어떻게 해석해야 하나요,,?
오늘 하루도 즐겁게 마무리 하시길 바랍니다~
================>답변2
정확이 무엇을 하고 싶으신지는 모르겠지만...위에 언급하신 db에서 검색한 데이터와 함께 value값도 view 단에서 출력을 하고 싶으신건가요? 제 추측이 맞다면,
1. plant는 bean 형태로 보이내요 해당 plant에 value를 추가 하고 getter/setter 추가.