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

usebean id and getProperty name

 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can anyone clear this point ?

Consider pageContext.setAttribute("emp",empObj)

Is the usebean "id" attribute will be="emp"
and getProperty "name" attribute will also be ="emp"
and setproperty "name" attribute will also be="emp"

Is it correct? or is there any "name" attribute mapping to "empobj" also?
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Amarkirt,

jsp:getProperty "name" will always match to jsp:usebean "id"
 
Tyler Wright
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Acutally, I had the same question...and I have looked into the translated java files to see that the answer appears to be YES!

But, let us say in a JSP, suppose there is an action:
<jsp:useBean id="duke" class="MyClass" scope="session" %>

Now in the translated java file -> "file_jsp.java", the attribute that is used to set the object in the session seems to have the name of the useBean attribute: "id".

as so: jspx_page_context.setAttribute("duke", duke, PageContext.SESSION_SCOPE);

I have check this twice and it always seems to be the way the translation works; but, I could still be mistaken.

regards...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic