Next Generation Emulation banner

simple JSP question

664 Views 0 Replies 1 Participant Last post by  Proto
Ok I just started to learn JSP but I haven't found a little question I have in my book so here it is :p

I want to define a set of links that when clicked, will reload the current page the user is into, but with a different text according to the page you are into.


So say, I define a String setText(int text) function that will contain all the possible texts. However, how can I make that my link executes the session.setAttribute( "attribute",setText(numberhere)); thingy before reloading the page


Im guessing the page goes like this
<HTML>
<BODY>
<%= session.getAttribute( "attribute" ) %>

</BODY>
</HTML>

Also, how can I set that this "attibute" will be set to some welcome string by default (for the first time I load my page)

Or if my approach is plainly wrong please tell me how to do it :p
1 - 1 of 1 Posts
1 - 1 of 1 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top