• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

useBean class attribute is invalid during polymorphism in jsp

 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.java file code is :



and my jsp code is ::


can anyone help me too resolve this...
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks bear for helping...
can you please tell me how do you add these code tags??
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Click the link in my post.

Also be sure to use proper indentation.
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okeys ...

Now,, do you knoe the solution of above query??
if yes then please help me out from this..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, sorry. Actions such as get and set property are antiquated left-overs from JSP 1 and I haven't used them in the over 10 years since JSP 2 was introduced with the JSTL and EL.
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okeys...
 
Stefan Evans
Bartender
Pie
Posts: 1670
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class Programmer is not public.
To be used as a java bean, the class must be public.

Also I recommend that you put the Programmer class into its own file, rather than lumping it in with the Job class.
Generally one class per file is the rule in java.

I know if I went looking for the Programmer class, I would look for a file Programmer.java.


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good catch on the public class, Stefan.

All beans must conform to the JavaBean standards or things will go awry. This is true even with the modern JSTL and EL.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic