Basic JSP - declaring variables???

J

Joey P

Hi,

I'm completely new to JSP and i have to carry out some tasks involving
variables. I've been asked to declare two variables 'x' (page scope)
and 'y' (session scope) and to then set the value of 'x' to 5 using a
value attribute and set the value of 'y' to 12 via the content of the
set element.

I thought I might be able to set the value of 'x' to 5 by doing
something like...

<c:set value="5" var="x" scope="page">
or
<c:set value="5" var="x" scope="page"></c:set>

but I'm not sure if any of the above are correct and I don't really
know how I could do the second part of the task. If anybody could give
me some explanation as to whether I'm heading along the right track or
not, I'd be very grateful.

Thanks again!

Joe P
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top