Tuesday, 15 May 2012

setattribute - how to store the values of request parameter in jsp for next page -


I have read in this forum myself when we use request.SetAttribute and request.getAttribute

Its value is only kept until the JSP page is loaded. So they recommend using a hidden form and when I am using that hidden form - I can not find it right, it says that it is not allowed for zero values ​​from which I am sure I can assemble through all the values.SsetAttribute has some initial values.

Here is the code where the error was shown

  ** org.apache.jasper.JasperException: unable to compile class for JSP: An error occurred on the line: In the 83 jsp file: /season1.jsp method is not applicable for printing (boolean) type JspWriter Logic (zero) 80: & lt ;! - end .content - & gt; & Lt; / Div & gt; 81: & lt; / Form & gt; 82: & lt;% i = 1;% & gt; 83: & lt; Input type = "hidden" name = "apnostorage" value = "& lt;% = request.setAttribute (" ipano ", ipano)% & gt; / & Gt; 84: & lt; Input type = "hidden" name = "casostorgas" value = "& lt;% = request.setAttribute (" case ", i)% & gt;" / & Gt; 85: <% 86:} An error occurred in the line: 84 in the JSP file: /season1.jsp method print (boolean) type is not applicable for logic in JspWriter (zero) 81: & lt; / Form & gt; 82: & lt;% i = 1;% & gt; 83: & lt; Input type = "hidden" name = "apnostorage" value = "& lt;% = request.setAttribute (" ipano ", ipano)% & gt; / & Gt; 84: & lt; Input type = "hidden" name = "casostorgas" value = "& lt;% = request.setAttribute (" case ", i)% & gt;" / & Gt; 85: & lt;% 86:} 87: and if (i == 1) **    

One way to store session value is

  session.setAttribute ("name", value);    

No comments:

Post a Comment