الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Requesting A File From The Server And Displaying It On The Browser

بدأه gameel gamal mohammed في 3 مارس 2009 · 3 رد · 518 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

i have written a program that is dispalying to the user to type the name of the file in web pages once the users press submit query the browser send a request to the servlet and the servlet search for this file in the network using socket and it is working fine for the first time

but the problem that when the client request a nother file it show me error the stream is close

by the way i have closed the stream and socket in the finally block

and the attached file if demonstrating what i have done

please help me

reading_file_from_the_server_user_wep_pages.rar

#2

السلام عليكــم ورحمـة الله وبركاتــة ،،

أنت تقوم بخلق الSocket في الmethod init، وهذه الmethod تنفذ فقط عنذ أول تنفيذ للservlet

وبما أنك تقوم بغلق الSocket في doPost فأن الطلبات التالية ستنفذ مباشرة doPost دون المرور عبر init وبالتالي ستجد أن الsocket مغلق

لذلك أظن أنه يجب أن تحول الكود الذي يفتح الsocket من init إلى doPost

#3

Thanx so much for your prompt replay i will try it then i will let you know

sorry to communicate in english and that due to im in India and i have no keyboard in Arabic

Allha Hafiz

#4

thanx so much i have tryied it and it is working fine

مواضيع مشابهة