Request object in classes

I have this code before , below in jsp format...I want to fit it into a java class file.There are request objects in this jsp..When i try to fit that code in a class compiler doesnt recognize request object...So how am i going to write this request object here...?

Please show me a way... Do I must use servlet or create a Http Request object and how?

thank you

klasor_adres="C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\albumyap\\WEB-INF\\album_arsiv\\deneme\\"+klasor_adres+"\\";

String resim_adi="";

// look at the line below request object

boolean isMultipart = FileUpload.isMultipartContent(request);

if(!isMultipart)

System.out.println("multipart deil");

else

{

DiskFileUpload upload =new DiskFileUpload();

List items = upload.parseRequest(request);

Iterator iter = items.iterator();

while(iter.hasNext())

{

FileItem item=(FileItem) iter.next();

if(!item.isFormField())

{

resim_adi=String.copyValueOf((klasor_adres+item.getName()).toCharArray(),(klasor_adres+item.getName()).lastIndexOf("\\")+1,(klasor_adres+item.getName()).length()-(klasor_adres+item.getName()).lastIndexOf("\\")-1);

File uploaded =new File(klasor_adres+resim_adi);

item.write(uploaded);

out.println(resim_adi);

}

}

}

[1943 byte] By [netsonicca] at [2007-10-2 13:30:30]
# 1

http://java.sun.com/docs/books/tutorial/java/index.html

You need to get a better handle on Java.

I know you said about JSP before but this conversion stuff is going to take a long while until you get a better handle on what you are converting into. I am not even sure how you would convert some of this stuff... as in what you are trying to do.

To answer an earlier question of yours

my question is,can i request these parameters from java classes

No.

or i must do this in jsp files and send them as a variable to classes.

Yes.

netsonicca at 2007-7-13 11:14:41 > top of Java-index,Java Essentials,New To Java...