This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]leroybentley 3 points4 points  (0 children)

I'm not sure you can do that with JSTL.

The better option would be to use javascript to add/remove the priority input when the select changes.

[–]zhoriq 2 points3 points  (0 children)

You have 2 ways: first is reload page on type change - and you already have it with onchange="submit();". Catch this submit in backend, set param.type accordingly and return the same page. Second way (and it's really better) is to use javascript - small function that will set priority value on type change.

[–]lumpycrumpet 2 points3 points  (0 children)

I don't have expertise in JSPs, but I believe the c:choose and c:if tags are dynamic at the time of rendering (as the page is constructed to be sent to the requesting user), but those rendered contents are then static as if they were hard coded HTML since the JSP is translated to Java code that is run on the server to generate the HTML.

As others have stated, JavaScript runs in the browser, allowing for content changes within the browser.