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 JSP java bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP java bean" Watch "JSP java bean" New topic
Author

JSP java bean

veena bijur
Ranch Hand

Joined: May 16, 2011
Posts: 67
















Please tell me what has gone wrong, have checked but not getting.
Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

That's a lot of code with no explanation. Please TellTheDetails.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
veena bijur
Ranch Hand

Joined: May 16, 2011
Posts: 67
yes i agree.
Explanation:

1. Accept the department number from the user and match department number in department table in database and fetch the corresponding id,name,salary,deptno and display to user.

2. i am using java bean to carry out the task.

3. class Employee is used to store details fetched from database.

4. class DBconnection is uesd to make database connection.

5. DAO class used to get the details from department table from database.

6.employeedetails.jsp used to display contents to user, in this page i am getting error.

Thanks.

harish shankar
Greenhorn

Joined: Jul 13, 2008
Posts: 18
What error are you getting?
veena bijur
Ranch Hand

Joined: May 16, 2011
Posts: 67

hi,

in the last page of code, as have commented you can see, that line is causing error.


compile time error Error: dao cannot be resolved.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

Veena,

First of all avoid using java codes inside jsp, it was used long back. Use JSTL/Custom tags etc. No as far as your error is concerned, there is not variable called exist in your code. You need to create that variable of type
com.usebean.DAO.



Swastik
veena bijur
Ranch Hand

Joined: May 16, 2011
Posts: 67
Hi, Swastik.


As you said correct, i have used java bean tag to create the object



As you said made changes in the code. When i run the the file and enter the department number
here is the error
HTTP Status 500 - /StandardActions/empdetails.jsp (line: 15, column: 6) Invalid standard action

Could you please tell where it went wrong?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

Case counts. Pay attention to detail.

And why are you using Java scriptlets in a JSP over 12 years after they have been replaced by the JSTL and EL?
veena bijur
Ranch Hand

Joined: May 16, 2011
Posts: 67

Yes, i agree. As i am learning i just want to know how it works.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61198
    
  66

The you should be learning the right way to do things. Be sure to use the JSTL and EL in all new code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP java bean