473,396 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with errors urgent please

Expand|Select|Wrap|Line Numbers
  1. MyBean bean = new MyBean(categoryForm, PriceForm);
  2.         request.setAttribute("valid", bean);
  3.         System.out.println(bean);
  4.  
  5.         List vids =MyBean.getVideos(categoryForm, PriceForm);
I have a servlet which does this, is should create a new MyBean and pass in the params the bean then uses the params to acess a db and run a queray, the result set then adds the data into an array list , i then want to return the data to the servlet . When compiling it says:

Expand|Select|Wrap|Line Numbers
  1. symbol  : class List
  2. location: class MySite.Valid
  3.                 List vids = MyBean.getVideos(categoryForm, PriceForm);
  4.                 ^
  5. MySite/Valid.java:56: non-static method getVideo(java.lang.String,java.la
  6. ng.String) cannot be referenced from a static context
  7.                 List vids = MyBean.getVideos(categoryForm, PriceForm);
  8.                                        ^
  9. 2 errors
I know this islikely something very simple but i really need to get this to compile quickly can anybody tell me whats wrong with it and how to solve it?
Apr 13 '07 #1
2 1255
r035198x
13,262 8TB
Expand|Select|Wrap|Line Numbers
  1. MyBean bean = new MyBean(categoryForm, PriceForm);
  2.         request.setAttribute("valid", bean);
  3.         System.out.println(bean);
  4.  
  5.         List vids =MyBean.getVideos(categoryForm, PriceForm);
I have a servlet which does this, is should create a new MyBean and pass in the params the bean then uses the params to acess a db and run a queray, the result set then adds the data into an array list , i then want to return the data to the servlet . When compiling it says:

Expand|Select|Wrap|Line Numbers
  1. symbol : class List
  2. location: class MySite.Valid
  3. List vids = MyBean.getVideos(categoryForm, PriceForm);
  4. ^
  5. MySite/Valid.java:56: non-static method getVideo(java.lang.String,java.la
  6. ng.String) cannot be referenced from a static context
  7. List vids = MyBean.getVideos(categoryForm, PriceForm);
  8. ^
  9. 2 errors
I know this islikely something very simple but i really need to get this to compile quickly can anybody tell me whats wrong with it and how to solve it?
List is in the java.util package. Did you import that?
Which object are you trying to call the getVideos method on?
Apr 14 '07 #2
List is in the java.util package. Did you import that?
Which object are you trying to call the getVideos method on?
Thanks i forgot to import that package and the other error was because i was calling the wrong method
Apr 14 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Aliandro | last post by:
Hi I am really stuck and need some expertise help please. I have an XML file: <XML> <USER_INFO> <USERNAME>username</USERNAME> <PASSWORD>password%</PASSWORD> </USER_INFO> <SITE_INFO>...
1
by: Rahul S. | last post by:
Hey all: I need urgent information how to set the environment in Visual.NET wiritng in C. I am working with a licensed version of the Analyze 6.0 software from mayo clinic. I need to write...
3
by: Rahul S. | last post by:
Hey all: I need urgent information how to set the environment in Visual.NET wiritng in C. I am working with a licensed version of the Analyze 6.0 software from mayo clinic. I need to write...
1
by: situ | last post by:
hi all, this is the procedure i have created CREATE PROCEDURE XIREL2.proc_size_2 (p_dummy CHAR(1)) SPECIFIC XIREL2.proc_size_2 DYNAMIC RESULT SETS 3...
1
SKJoy2001
by: SKJoy2001 | last post by:
PLEASE HELP ME!!! P E R L!!! I have a CGI (PERL) file namely 'test.cgi' and it has the correct permission (755) on the FTP server and it is within the CGI path. I have the following code in it:...
1
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include...
2
by: David Thielen | last post by:
Hi; When I get an undlanled exception and need to pass info (like the exception) to the error page - I don't want to pass that in the url. Is there a way to pass it so the user does not see it?...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
6
by: xhe | last post by:
I am using ffmpeg to convert video, this is a sample script: $str='/home/transla1/bin/ffmpeg -i /home/transla1/public_html/ cybertube/web/uploads/video/31_AK000005.AVI -s 240x180 -b 100k -ar...
3
by: jats | last post by:
I am a .NET programmer and i had recently got a web application designed in Classic ASP, to make some modifications. When i run the application and try to create a new user the following error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.