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
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
> 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