Hi Josh, I need to print all the values which I have added in the Session to be in my <HTML:OPTIONS> How can I do that ? Deepak
-----Original Message----- From: Josh McCulloch [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 1:43 PM To: Struts Users Mailing List Subject: Re: <HTML:SELECT> What is the error you are getting. Your message shows you placing a variable in session scope, and then using a scriptlet to display a variable in request scope... Here is some code I find helpful to better debug these situations: Put this at the bottom of a jsp / footer: <!-- if(com.whatever.Class.DEBUG_REQUEST) out.println(com.whatever.Class.getDumpContents(request); --> public static String getDumpContents(HttpServletRequest request) { StringBuffer content = new StringBuffer(4096); content.append(dumpRequest(request)); content.append(dumpSession(request.getSession(false))); return content.toString(); } public static String dumpSession(HttpSession session) { StringBuffer buf = new StringBuffer(1024); buf.append("*(HttpSession)**************************\n"); // Append non-attribute data here Enumeration enum = session.getAttributeNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); buf.append(key); buf.append("=\""); buf.append(session.getAttribute(key)); buf.append("\"\n"); } buf.append("\n\n"); return buf.toString(); } public static String dumpRequest(HttpServletRequest request) { StringBuffer buf = new StringBuffer(1024); buf.append("*(HttpRequest)**************************\n"); // Append non-attribute data here buf.append("\nAttributes:\n"); Enumeration enum = request.getAttributeNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); buf.append(key); buf.append("=\""); buf.append(request.getAttribute(key)); buf.append("\"\n"); } buf.append("\nParameters:\n"); enum = request.getParameterNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); buf.append(key); buf.append("=\""); buf.append(request.getParameter(key)); buf.append("\"\n"); } buf.append("\nHeaders:\n"); enum = request.getHeaderNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); buf.append(key); buf.append("=\""); buf.append(request.getHeader(key)); buf.append("\"\n"); } buf.append("\n\n"); return buf.toString(); } [EMAIL PROTECTED] wrote: >Hi All, >I am not able to get values in <HTML:OPTIONS> , I am adding values in >my Session thru Controller , but not able to retrieve it in JSP form I >put values in Session like this :- >context.setAttribute(context.SESSION,"OPTION",option); > >And try to retrieve values in JSP like this :- ><html:select property="status"> ><html:options collection="OPTION"/> ></html:select> > >Am I doing something wrong , bcoz I am trying to figure this problem >since long time , but no luck Can some body please tell me how to get >values in <HTML:OPTIONS> when the values are added to Session thru >Servlet. When I do this ><%System.out.println(request.getAttribute("OPTION")); %> I can see all >the values , but not with Struts tags Thanks in Advance >Deepak > > > >This e-mail may contain confidential or privileged information. If you >think you have received this e-mail in error, please advise the sender >by reply e-mail and then delete this e-mail immediately. Thank you. >Aetna > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > -- Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with [EMAIL PROTECTED] http://shopnow.netscape.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail may contain confidential or privileged information. If you think you have received this e-mail in error, please advise the sender by reply e-mail and then delete this e-mail immediately. Thank you. Aetna --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]