Вопрос

I am sending List from form handler to jsp using set Attribute method.When i directly pass to for each droplet it works perfect.but if i am using getvalueof tag in jsp.Then i am not getting value.

There is another problem.If i used same for each droplet twice in my jsp.The results are only shown in my first jsp .

Please help me in debugging and finding solution for this.

Это было полезно?

Решение

There are a multitude of reasons why this doesn't work so without the code I can only point out the obvious mistakes that people usually make:

Correct:

<dsp:getvalueof var="somelist" bean="formhandler.list" />

Incorrect:

<dsp:getvalueof var="somelist" param="formhandler.list" />
<dsp:getvalueof var="somelist" value="formhandler.list" />

Perhaps output the value of somelist in your JSP page to see if it does get set?

As far as your list being used in multiple JSPs. Again I have to guess. If this is an embedded JSP then you need to remember to pass the list to the included page:

<dsp:include page="some-embedded-page.jsp>
    <dsp:param name="somelist" value="${somelist}"/>
</dsp:include>

If this is a new JSP page all together, perhaps change your formhandler scope to session. But don't just change it. Make sure you understand the impact of formhandler scope (as it almost always should be request).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top