سؤال

The below code is not printing a session date but the string itself i.e. "%{#session.travelDate}".

So, the problem is why the value is not being evaluated?

<input type="text" id="datepicker"
    name="departDate" readonly="readonly" required="required"
    value="%{#session.travelDate}" />
هل كانت مفيدة؟

المحلول

OGNL expressions don't work in HTML tags. This is the reason why you should use Struts tags.

<s:textfield id="datepicker"
    name="departDate" readonly="readonly" required="required"
    value="%{#session.travelDate}" />
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top