0

I have a newbie question. On my jsp page, I have currently a TextArea filled with a value. I do not need that TextArea but I need its content to handle it inside a 'if' statement. Seems simple, yet for me I can't figure it out. I tried to set the value with < c : set ...." ,but the problem is it seems not have a link to the content.

What if have :

<tr>
            <td><bean:message key="systematiccontrol.search.status" /></td>
            <td>
                <textarea id="OverruleStatusField" name="status" rows="2" cols="60"></textarea>                 
            </td>
        </tr>

This actualy shows the correct status in the textarea ('AUTO_PROCESSED'), but I want this in a var, I don't want the textarea. What I tried (but does not work) :

<tr>
            <td><bean:message key="systematiccontrol.search.status" /></td>
            <td>

                <c:set var="status" scope="session" value="status"/>
                <p>${status}</p>
                <c:if test="${status=='AUTO_PROCESSED'}"> <p>Auto</p> </c:if>
                <c:if test="${status!='AUTO_PROCESSED'}"> <p>${status}Not Auto</p> 
            </td>
        </tr>

Main problem is I can't figure out how to access my session variable set by the java backend.

Extra info, not sure if you need it : The statusvalues are coming from an enum. When I code :

<c:set var="systematicControlStatus" scope="request" value="${sessionScope.systematiccontrolstates}"/>
<p>look ${systematicControlStatus}</p>

I get a array list with all the possible values in the enum.

Hope someone can help

  • so the value in textarea is typed by user ? or you are setting it ? if its typed by user you cannot get it directly either you need to submit value or use ajax for setting these value in some session. – Swati May 25 '20 at 14:06
  • @Swati Hey, When the page is loaded, the value is preset from the backend. It's not typed in by the user. – Danny Doubbel May 25 '20 at 14:20
  • So the value is in session ? if yes this [post](https://stackoverflow.com/questions/17419727/how-to-use-session-in-jsp-pages-to-get-information) might help . – Swati May 26 '20 at 04:16

0 Answers0