Is this right...

...obviosuly not because it does not compile but is this the correct way about doing what i want:

MyBean bean =new MyBean(categoryForm, PriceForm);

request.setAttribute("valid", bean);

System.out.println(bean);

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:

symbol :class List

location:class MySite.Valid

List vids = MyBean.getVideos(categoryForm, PriceForm);

^

MySite/Valid.java:56: non-static method getVideo(java.lang.String,java.la

ng.String) cannot be referenced from astatic context

List vids = MyBean.getVideos(categoryForm, PriceForm);

^

2 errors

[1123 byte] By [eastendersa] at [2007-11-27 0:58:29]
# 1
like I said yesterday, a quick tutorial will clear this up
georgemca at 2007-7-11 23:32:25 > top of Java-index,Java Essentials,New To Java...
# 2
can you recommend any tutorials inparticular?
eastendersa at 2007-7-11 23:32:25 > top of Java-index,Java Essentials,New To Java...
# 3
http://java.sun.com/docs/books/tutorial/java/index.html
tsitha at 2007-7-11 23:32:25 > top of Java-index,Java Essentials,New To Java...
# 4

wooooooooooooooooooooooooo I think i got it!!

first error because i didnt import the list util package!

second error coz i should have done:

List vids= bean.getVideo(categoryForm, PriceForm);

Thats right isn't it? Please tell i didnt wooo for nothing?

It compiles and if i do system.out vids it displays what i set in the bean! Please let this be the solution lol

eastendersa at 2007-7-11 23:32:25 > top of Java-index,Java Essentials,New To Java...
# 5

> wooooooooooooooooooooooooo I think i got it!!

>

> first error because i didnt import the list util

> package!

> second error coz i should have done:

>

> List vids= bean.getVideo(categoryForm,

> PriceForm);

>

> Thats right isn't it? Please tell i didnt wooo for

> nothing?

> It compiles and if i do system.out vids it displays

> what i set in the bean! Please let this be the

> solution lol

well, does it do what you wanted it to do? why d'you need us to tell you what you already know?

but yeh, you got it. told you you'd get it, didn't I

georgemca at 2007-7-11 23:32:25 > top of Java-index,Java Essentials,New To Java...
# 6
yeah i was like 99% sure i'd got it working but thought "better check before i get to excited" lol Yes you told me! now just gotta get it working without hardcoding the data (hopefully not going to be too hard!)
eastendersa at 2007-7-11 23:32:25 > top of Java-index,Java Essentials,New To Java...