Question

I have a select tag with a bunch of option tags and I want to use JSTL to check which option has been selected but not sure where to begin. If I select one of the options then I need the JSTL to check it but that only runs when the page reloads so if I reload the page, then the option is reset to default. So how would I send a value to the JSTL code?

I have done this option by using:

<input type="submit" name="SignInButton" value="Sign In" />
<input type="hidden" name="submitted" value="true" />

for buttons for example and then using something like this:

<c:when test="${param.SigningOut == 'true' && sessionScope.SignedIn == 'true'}">

To check it but I don't know how to do it for multiple options in a down list using

I hope it makes sense what I am trying to do. Thanks for reading.

Pas de solution correcte

Autres conseils

JSTL runs on server side, so you cannot validate nor process any data in client using JSTL nor any other JSP tag. Note that scriptlets also run on server side, so it is not an option either.

If you want/need to perform any validation, action, effect, etc. on client side, use Javascript. Either if you need to validate the data on server side, you can use ajax for better user experience within your web application.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top