Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to set attribute using <c:set> using the body

 
yogesh srinivasan
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the following c:set code which sets an bean attribute from another attribute
<c:set var="bean2" scope="session" value="${bean1}">

</c:set>

and was able to view the property name ${bean2.name}

but if i try setting the bean through the body like below

<c:set var="bean2" scope="session">
${bean1}
</c:set>

I get the following excepiton

org.apache.jasper.JasperException: Exception in JSP: /test1/test2/jsp1.jsp:32

29: after cset call
30:

31:
32: TEST BEAN NAME${bean2.name}
33:
34:
35:

javax.servlet.ServletException: Unable to find a value for "name" in object of class "java.lang.String" using operator "."
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.test1.test2.jsp1_jsp._jspService(jsp1_jsp.java:113)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Please help me out.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic