سؤال

ورئيس أول كتاب يقول عن تشمل التوجيه كما تتضمن رمز من أي ملف آخر في ملف JSP في وقت الترجمة، التي لا يمكن تغييرها بشكل حيوي.

ولكن، I تضمين ملف JSP في التضمين التوجيه، الذي يولد عددا عشوائيا في كل مرة كنت الوصول إلى الصفحة مع تضمين التوجيه. وفي كل مرة رقما جديدا يولد بدلا من مرة واحدة فقط خلال الترجمة لبريمج التعليمات البرمجية. لماذا ذلك؟

وشكرا مقدما.

هل كانت مفيدة؟

المحلول

The 1st JSP file includes the code of 2nd JSP file at translation time. The random number you see is after execution.

If you now change your 2nd JSP then you won't see the changes when you access 1st JSP.

نصائح أخرى

The JSP file includes that other code, which in turn generates a random number when executed.

What it doesn't do is execute that other code and only include the output, which is what you expect if I understand you correctly.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top