: Hi, how do I print the arguments that are passed into my jsp? I remember there being a simple way to do this but have forgotten. thanks :
What method do you use to pass in the arguments? via request object, session object, or query string?
Here are examples of printing out argument passing via request object, session object, and query string:
Via Request Object: (Assuming you have set the request attribute) ----------------------------------------------------------------- String msg = (String) request.getAttribute( "greetingMessage" ); out.println( "
" + msg + "
" ); or
<%=msg%>
Via Session Object: (Assuming you have set the session attribute) ----------------------------------------------------------------- String msg = (String) session.getAttribute( "greetingMessage" ); out.println( "
Comments
:
What method do you use to pass in the arguments? via request object, session object, or query string?
Here are examples of printing out argument passing via request object, session object, and query string:
Via Request Object: (Assuming you have set the request attribute)
-----------------------------------------------------------------
String msg = (String) request.getAttribute( "greetingMessage" );
out.println( "
or
Via Session Object: (Assuming you have set the session attribute)
-----------------------------------------------------------------
String msg = (String) session.getAttribute( "greetingMessage" );
out.println( "
or
Via Query String:
-----------------
String msg = request.getParameter( "greetingMessage" );
out.println( "
or
Hope this help.