Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setProperty doubt!

 
Joe Harry
Ranch Hand
Posts: 10091
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ranchers,

Om page 362 of the HFSJ book, the line says <jsp:setProperty name="person" property="empID" value="<%=request.getParameter("empID")%>" Why does this fail to compile when the empID is of type int?? I'm not understanding?
 
VijayKumar Sivagnanam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the automatic type conversion will not happen for jsp expression while el expression will do the type conversion. thatz why it will give a compilation error.
 
Joe Harry
Ranch Hand
Posts: 10091
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijayakumar,

How does the EL does the implicit type conversion?? Is there any rule or is it according to the spec?
 
Sanjeev Singh
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That we can find somewhere in Specification for JSP?
Jothi do you have the link for the specification of JSP and servlets?
 
Joe Harry
Ranch Hand
Posts: 10091
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sanjeev,

That is a good thing to look at the specs. you can get it here.
[ January 11, 2007: Message edited by: Jothi Shankar Kumar Sankararaj ]
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jothi,

Just remember this. Auto-Type_Conversion WILL NOT happen in jsp:setProperty, if we use scripting in 'value' attribute.

To get rid of this problem, use EL or string literal.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic