Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:useBean and jsp:setProperty action tag

 
Madhawi Maurya
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can we use the following scriptlet statements as jsp action tag,
jsp:useBean and jsp:setProperty.

<%
List<TransactionReportValue> transactionList = (List<TransactionReportValue>)request.getAttribute("reportListInfo");
TransactionReportValue transactionRepVal = transactionList.get(0);
%>
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jsp:setProperty and jsp:getProperty tags (which are somewhat obsolete these days) were not meant to do things like that.

If you're building your pages with scriptlets, (also obsolete and considered a poor practice), there is no need for those tags, you can use Java syntax to set and get bean properties.

Those tags, like their their successors (EL and JSTL), are meant for working with scriptless JSPs. Scriptless JSPs are those which do nothing but mark up the results of requests that were processed by servlets, and Java objects in an Model, View, Controller architecture (MVC). Mixing scriptlets and any of the technologies mentioned above does nothing to improve the quality of your JSPs and is worse than using pure scriptlets.

Pick a boat and keep both feet in it.
[ January 17, 2008: Message edited by: Ben Souther ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic