Hide and Show help

I am using BEA Weblogic and I need to get a value from a previous jsp evaluate it and based on the value I need to show certain scripting on the next jsp. I was able to create a function and hide and show on the same jsp, but not get the value from one, check the value and then show or hide on the next jsp based on the value. Any help would be great! I need this as soon as possible.

[392 byte] By [869812jimmyraya] at [2007-11-26 12:18:17]
# 1

Inside the JSP you could use the implicit object HttpSession like this:

First JSP.

<%

session.setAttribute("valueName", value); //It must be an object

%>

Next JSP

<%

Value value = (Value)session.getAttribute("valueName");

%>

...some HTML code

<%=value%>//use the value

You could do the same in a Servlet if you are sending the request to it like this:

....doGet(...) {

HttpSession session = request.getSession();

session.setAttribute("valueName", value);

}

and then retrieve it in the JSP.

P.D. if the Value is primitive, use a Wrapper (Integer, Float, Long, etc...)

635385Loesa at 2007-7-7 14:57:37 > top of Java-index,Archived Forums,Socket Programming...