File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes useBean class attribute is invalid during polymorphism in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "useBean class attribute is invalid during polymorphism in jsp" Watch "useBean class attribute is invalid during polymorphism in jsp" New topic
Author

useBean class attribute is invalid during polymorphism in jsp

shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 216

.java file code is :



and my jsp code is ::


can anyone help me too resolve this...
shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 216

thanks bear for helping...
can you please tell me how do you add these code tags??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Click the link in my post.

Also be sure to use proper indentation.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 216

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

Joined: Jan 10, 2002
Posts: 60782
    
  65

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

Joined: Jul 15, 2012
Posts: 216

okeys...
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
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

Joined: Jan 10, 2002
Posts: 60782
    
  65

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.
 
jQuery in Action, 2nd edition
 
subject: useBean class attribute is invalid during polymorphism in jsp
 
Similar Threads
<jsp:setProperty> is raising Exceptions
Help with jsp beans
jsp bean doubt
can not forward after response has been committed
Simple java bean problem