• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Bean doubt

 
Lathaa Thiyagarajan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bean Class:




JSP1:


JSP2:


JSP2 outputs 'Generic Shop'
JSP1 does not output anything??

Please explain.
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP1 does not output anything??

even JSP1 produces output. I tried. it's working fine in both JSPs.
 
Bk Jacky
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Ravi is right.Its working for both cases.
 
Bhupendra Khabrani
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

sorry to deviate but i was searching an explaination for a doubt which i had in HFSJ.
please follown the link:
http://www.coderanch.com/t/177258/java-Web-Component-SCWCD/certification/jsp-useBean-tag

Note: i did check the errata and couldn't find any. pls help me understand if i am correct or not!
 
Vijay Bharghav bheemineni
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhupendra, you are correct. If scope is not mentioned then its "Page" scope. Ravi explained in detail regarding this in the post related to this query.
 
Bhupendra Khabrani
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vijay,
on closely looking i could find the same in the errata. as i have an old HFSJ 1.4 i couldnt find the page match. Now its clear as the new book has diff page no, which is as follows:

[416] Be the Container Answers;
The third example will not work for the same reason that the first example doesn't
work, because the attribute is at Request Scope, and the default scope is Page scope.
The handwritten comment for bullet #3 should be the same as for bullet #1.


thanks for help guys.
Bhupen
 
Prasad Tamirisa
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Latha,

Where is your servlet code..?? The output of your jsp's depends on how you have set "mb".

I mean, in which scope you have set this..??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic