Re: Log4J
It says no class definition found rather than no class found, are you initializing the class correctly ? Sathish Babu K R wrote: hi kalra yep i have that log4j in lib folder sathish __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Log4J
hi kwok how to initialize the class what am i doing is i m having loggers.java as package com.pronto.util; import java.io.*; import java.util.*; import org.apache.log4j.*; /** * Title: * Description: Uses new Log4j class to log all the message to a file * Copyright:Copyright (c) 2003 * Company: * @author Sathish Babu * @version 1.0 */ public class Loggers { public static int DEBUG_LOG_LEVEL = 1; public static int INFO_LOG_LEVEL = 2; public static int ERROR_LOG_LEVEL = 4; private static PrintWriter _printWriter = null; private static String _logFile = null; private static int _logLevel; private static Logger logger = Logger.getLogger(com.pronto.web); public static TreeMap levels = new TreeMap(); static { levels.put(String.valueOf(DEBUG_LOG_LEVEL), DEBUG); levels.put(String.valueOf(INFO_LOG_LEVEL), INFO); levels.put(String.valueOf(ERROR_LOG_LEVEL), ERROR); _logLevel = logger.getLevel().toInt(); ConsoleAppender app =(ConsoleAppender)logger.getAppender(Log); // RollingFileAppender app =(RollingFileAppender)logger.getAppender(Log); // _logFile = app.getFile(); } public synchronized static void logMessage(Object message, int logLevel) { System.out.println(got into log message); /*if(logLevel == ERROR_LOG_LEVEL) { logger.error(message); } else if(logLevel == INFO_LOG_LEVEL) { logger.info(message); } else {*/ System.out.println(got into debug message); logger.debug(message); //} } public static void setLoggingLevel(int level) { if( logger.getLevel().toInt() != level ) { if(level == DEBUG_LOG_LEVEL) logger.setLevel(Level.DEBUG); if(level == INFO_LOG_LEVEL) logger.setLevel(Level.INFO); if(level == ERROR_LOG_LEVEL) logger.setLevel(Level.ERROR); logMessage(Setting logging level to + levels.get(String.valueOf(level)), level); } } public static void clearLogFile() { try { if(_printWriter != null) _printWriter.close(); _printWriter = new PrintWriter(new FileWriter(_logFile), true); logMessage(Cleared out logfile, logger.getLevel().toInt()); } catch(Exception e) { logMessage(Error while Clearing logfile +e.getMessage(), ERROR_LOG_LEVEL); } } public static void writeFileToWriter(Writer out) { try { BufferedReader br = new BufferedReader(new FileReader(_logFile)); char[] buff = new char[2048]; int bytesRead; while(-1 != (bytesRead = br.read(buff, 0, buff.length))) { out.write(buff, 0, bytesRead); } br.close(); } catch(Exception e) { Loggers.logMessage(Error while writing the file to writer +e.getMessage(),ERROR_LOG_LEVEL); } } public static int getLoggingLevel() { return _logLevel; } private Loggers() { } public static void main(String[] args) { System.out.println(Hello World!); Loggers.logMessage(stupid..idiot, Loggers.ERROR_LOG_LEVEL); } } i m calling that in actionform class as Loggers.logMessage(stupid..idiot, Loggers.DEBUG_LOG_LEVEL); tell me solution sathish --- Kwok Peng Tuck [EMAIL PROTECTED] wrote: It says no class definition found rather than no class found, are you initializing the class correctly ? Sathish Babu K R wrote: hi kalra yep i have that log4j in lib folder sathish __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 1.0 and servlet
No. Both 1.0 and 1.1 only need 2.2 -Original Message- From: Melanie Pfefer [mailto:[EMAIL PROTECTED] Sent: Wednesday, 10 December 2003 14:56 To: [EMAIL PROTECTED] Subject: Struts 1.0 and servlet Hi; Does Struts 1.0 have a servlet 2.3 dependency? Thanks BT Yahoo! Broadband - Save £80 when you order online today. Hurry! Offer ends 21st December 2003. The way the internet was meant to be. http://uk.rd.yahoo.com/evt=21064/*http://btyahoo.yahoo.co.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4J
The Category class has been deprecated and they talked about taking it out of the distribution after mid 2003 (according to the javadocs). Try using Logger instead. Not sure if this is your problem but it's still a good idea to switch over to the Logger class and if you're using a hyper-uptodate jar then it might do the trick... alan -Original Message- From: Sathish Babu K R [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 10:53 PM To: Struts Users Mailing List Subject: RE: Log4J hi kalra yep i have that log4j in lib folder sathish __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4J
hi alan i don't use category class at all then how come its showing errori don't get it... whatz that jar that makes trick?tell me sathish __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4J
from the code you sent , there doesnt seem to be any problem. i don't use category class at all then how come its showing errori don't get it... Some classes internally still uses this class. They will finally be removed. Check to see that Category class (org/apache/log4j/Category) is indeed present in you jar. one more check Where are your com.pronto.web.AccessSummaryReportForm class lying ? -Original Message- From: Sathish Babu K R [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 12:38 PM To: Struts Users Mailing List Subject: RE: Log4J hi alan i don't use category class at all then how come its showing errori don't get it... whatz that jar that makes trick?tell me sathish __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4J
hi kalra com.pronto.web.accesssummaryreportform is in web-inf/classes will there be any probs due to log4j.prop..its as log4j.rootLogger=ALL ,Log log4j.appender.Log=org.apache.log4j.ConsoleAppender log4j.appender.Log.layout=org.apache.log4j.PatternLayout log4j.appender.Log.layout.ConversionPattern=%d{dd MMM yyy HH:mm:ss,SSS} %-5p %c - %m%n # Define the type of logger #log4j.appender.Log=org.apache.log4j.RollingFileAppender #log4j.appender.Log.File=logs/dbcube.log #log4j.appender.Log.MaxFileSize=1KB # Keep one backup file #log4j.appender.Log.MaxBackupIndex=1 # Define the stuff to log #log4j.appender.Log.layout=org.apache.log4j.PatternLayout #log4j.appender.Log.layout.ConversionPattern=%d{dd MMM yyy HH:mm:ss,SSS} %-5p %c - %m%n #log4j.logger.dbcube=ALL, Log regards sathish --- Kalra, Ashwani [EMAIL PROTECTED] wrote: from the code you sent , there doesnt seem to be any problem. i don't use category class at all then how come its showing errori don't get it... Some classes internally still uses this class. They will finally be removed. Check to see that Category class (org/apache/log4j/Category) is indeed present in you jar. one more check Where are your com.pronto.web.AccessSummaryReportForm class lying ? -Original Message- From: Sathish Babu K R [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 12:38 PM To: Struts Users Mailing List Subject: RE: Log4J hi alan i don't use category class at all then how come its showing errori don't get it... whatz that jar that makes trick?tell me sathish __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4J
I dont see any problem here.Only thing is that your property file should be present in classpath somewhere. may be in web-inf\classes. Also check the req category class is present in jar file. and no other log4.jar is present in your classpath. -Original Message- From: Sathish Babu K R [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 12:47 PM To: Struts Users Mailing List Subject: RE: Log4J hi kalra com.pronto.web.accesssummaryreportform is in web-inf/classes will there be any probs due to log4j.prop..its as log4j.rootLogger=ALL ,Log log4j.appender.Log=org.apache.log4j.ConsoleAppender log4j.appender.Log.layout=org.apache.log4j.PatternLayout log4j.appender.Log.layout.ConversionPattern=%d{dd MMM yyy HH:mm:ss,SSS} %-5p %c - %m%n # Define the type of logger #log4j.appender.Log=org.apache.log4j.RollingFileAppender #log4j.appender.Log.File=logs/dbcube.log #log4j.appender.Log.MaxFileSize=1KB # Keep one backup file #log4j.appender.Log.MaxBackupIndex=1 # Define the stuff to log #log4j.appender.Log.layout=org.apache.log4j.PatternLayout #log4j.appender.Log.layout.ConversionPattern=%d{dd MMM yyy HH:mm:ss,SSS} %-5p %c - %m%n #log4j.logger.dbcube=ALL, Log regards sathish --- Kalra, Ashwani [EMAIL PROTECTED] wrote: from the code you sent , there doesnt seem to be any problem. i don't use category class at all then how come its showing errori don't get it... Some classes internally still uses this class. They will finally be removed. Check to see that Category class (org/apache/log4j/Category) is indeed present in you jar. one more check Where are your com.pronto.web.AccessSummaryReportForm class lying ? -Original Message- From: Sathish Babu K R [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 12:38 PM To: Struts Users Mailing List Subject: RE: Log4J hi alan i don't use category class at all then how come its showing errori don't get it... whatz that jar that makes trick?tell me sathish __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4J
hi kalra everything is fine in respective classpaths sathish --- Kalra, Ashwani [EMAIL PROTECTED] wrote: I dont see any problem here.Only thing is that your property file should be present in classpath somewhere. may be in web-inf\classes. Also check the req category class is present in jar file. and no other log4.jar is present in your classpath. -Original Message- From: Sathish Babu K R [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 12:47 PM To: Struts Users Mailing List Subject: RE: Log4J hi kalra com.pronto.web.accesssummaryreportform is in web-inf/classes will there be any probs due to log4j.prop..its as log4j.rootLogger=ALL ,Log log4j.appender.Log=org.apache.log4j.ConsoleAppender log4j.appender.Log.layout=org.apache.log4j.PatternLayout log4j.appender.Log.layout.ConversionPattern=%d{dd MMM yyy HH:mm:ss,SSS} %-5p %c - %m%n # Define the type of logger #log4j.appender.Log=org.apache.log4j.RollingFileAppender #log4j.appender.Log.File=logs/dbcube.log #log4j.appender.Log.MaxFileSize=1KB # Keep one backup file #log4j.appender.Log.MaxBackupIndex=1 # Define the stuff to log #log4j.appender.Log.layout=org.apache.log4j.PatternLayout #log4j.appender.Log.layout.ConversionPattern=%d{dd MMM yyy HH:mm:ss,SSS} %-5p %c - %m%n #log4j.logger.dbcube=ALL, Log regards sathish --- Kalra, Ashwani [EMAIL PROTECTED] wrote: from the code you sent , there doesnt seem to be any problem. i don't use category class at all then how come its showing errori don't get it... Some classes internally still uses this class. They will finally be removed. Check to see that Category class (org/apache/log4j/Category) is indeed present in you jar. one more check Where are your com.pronto.web.AccessSummaryReportForm class lying ? -Original Message- From: Sathish Babu K R [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 12:38 PM To: Struts Users Mailing List Subject: RE: Log4J hi alan i don't use category class at all then how come its showing errori don't get it... whatz that jar that makes trick?tell me sathish __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error message display in the case of redirect = true
Hello Gurpreet, Thanks for the input but can you please send me an example of how to do it. Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) Gurpreet Dhanoa [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] atainc.com cc: (bcc: alok.garg/Polaris) Subject: Re: Error message display in the case of redirect = true 12/10/03 11:28 AM Please respond to Struts Users Mailing List hi ALok You can stop the resubmitting of form with the help of Tokens in struts - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:00 AM Subject: RE: Error message display in the case of redirect = true You are right even I knew that it was the same problem. But then in that case if I make redirect = false and if the user refreshes the page then the request is again submitted. So, can you throw some light on how to stop the user from re submitting the same URL. Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) Navjot Singh [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] dia.net cc: (bcc: alok.garg/Polaris) Subject: RE: Error message display in the case of redirect = true 12/09/03 06:02 PM Please respond to Struts Users Mailing List not sure but the logic says that error messages are being stored in the REQUEST SCOPE and when you set redirect=true, naturally that's a new request so you won't get the errors set in earlier request. anybody else? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 5:53 PM To: Struts Users Mailing List Subject: Error message display in the case of redirect = true Hello all, I want to display the errors stack provided y Struts in the jsp page using the html:errors/ tag. I am able to display it but the moment I add the redirect=true in the action mapping tag I am not able to see the error messages. Please help with it. Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit Us at http://www.polaris.co.in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 1.0 and servlet
thx Mel. --- Andrew Hill [EMAIL PROTECTED] wrote: No. Both 1.0 and 1.1 only need 2.2 -Original Message- From: Melanie Pfefer [mailto:[EMAIL PROTECTED] Sent: Wednesday, 10 December 2003 14:56 To: [EMAIL PROTECTED] Subject: Struts 1.0 and servlet Hi; Does Struts 1.0 have a servlet 2.3 dependency? Thanks BT Yahoo! Broadband - Save £80 when you order online today. Hurry! Offer ends 21st December 2003. The way the internet was meant to be. http://uk.rd.yahoo.com/evt=21064/*http://btyahoo.yahoo.co.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] BT Yahoo! Broadband - Save £80 when you order online today. Hurry! Offer ends 21st December 2003. The way the internet was meant to be. http://uk.rd.yahoo.com/evt=21064/*http://btyahoo.yahoo.co.uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error message display in the case of redirect = true
HI Alok , here is the code for it Follwoing is the snapshot for the same. public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes and/or parameters we will need // When navigating to this action, ActionForm is null, so // user's info is copied into the form and then saved in request scope if (form == null) { // Set a transactional control token to prevent double posting saveToken(request); } //IF this Action has been called of by Submit Form // Validate the transactional control token if (!isTokenValid(request))//This is an inbuild method of ACtion class to check the Token { request.setAttribute(DOUBLE_POST_ATTEMPT_KEY, trapped); return new ActionForward(mapping.getInput()); } HOpe this may help Cheers Gary - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 12:54 PM Subject: Re: Error message display in the case of redirect = true Hello Gurpreet, Thanks for the input but can you please send me an example of how to do it. Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) Gurpreet Dhanoa [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] atainc.com cc: (bcc: alok.garg/Polaris) Subject: Re: Error message display in the case of redirect = true 12/10/03 11:28 AM Please respond to Struts Users Mailing List hi ALok You can stop the resubmitting of form with the help of Tokens in struts - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:00 AM Subject: RE: Error message display in the case of redirect = true You are right even I knew that it was the same problem. But then in that case if I make redirect = false and if the user refreshes the page then the request is again submitted. So, can you throw some light on how to stop the user from re submitting the same URL. Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) Navjot Singh [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] dia.net cc: (bcc: alok.garg/Polaris) Subject: RE: Error message display in the case of redirect = true 12/09/03 06:02 PM Please respond to Struts Users Mailing List not sure but the logic says that error messages are being stored in the REQUEST SCOPE and when you set redirect=true, naturally that's a new request so you won't get the errors set in earlier request. anybody else? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 5:53 PM To: Struts Users Mailing List Subject: Error message display in the case of redirect = true Hello all, I want to display the errors stack provided y Struts in the jsp page using the html:errors/ tag. I am able to display it but the moment I add the redirect=true in the action mapping tag I am not able to see the error messages. Please help with it. Alok Garg Polaris Software Lab Ltd. ( + 91 - 022 - 28290019 Ext. # 1308 ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
iterate over string array and html:text tag
hello i probalbly have a simply question but i dont get it working i have a bean which i use as a action form public class SearchBean extends ActionForm{ private String[] searchString; //+ getter setter methods ... } now i want to present this searchString in jsp page in input field i made it as followas logic-el:iterate collection=${AdvancedSearchForm.searchString} id=val indexId=ctr input type=text name=searchString[c:out value=${ctr}/] value=c:out value=${val}/ /logic-el:iterate how can i use instead of the handcoded html text the html:text tag? Thx for any help i tried now 10 differernt version all with no success Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tool bar for struts tag generator
- Original Message - From: Peter Rajesh To: Struts Users Mailing List Sent: Wednesday, December 10, 2003 2:42 PM hi all is there any work around in net beans to have default struts tag generator some thing like a tool bar regards peter
form data lost through login
Hi, I'm having troubles submitting data through an form/action which is protected by the servlet container. Let me explain better the problem: I'm using struts (ver 1.1). I have a JSP containing a form (whith method=POST) to collect some data from a user. Something like: html:form action=/submit method=post ... ... /html:form The submission is protected by container security, i.e. the url of the action (e.g. /submit.do ) is declared in a security-constraint block in the web.xml file: security-constraint web-resource-collection web-resource-nameprivate action/web-resource-name url-pattern/submit.do/url-pattern /web-resource-collection auth-constraint role-nameadmin/role-name /auth-constraint /security-constraint The container (Tomcat 4.1.24) is configured to ask credentials by means of a FORM login, i.e.: login-config auth-methodFORM/auth-method realm-nameprivate/realm-name form-login-config form-login-page/login.jsp/form-login-page form-error-page/loginerror.jsp/form-error-page /form-login-config /login-config As expected, when I fill the form and press the submission button the login form appears. I fill it with user name and password, then I press the submisison button of the login form. What appens then is that the Action that I'm using to handle the submitted data doesn't receive the data. The Action Form contains null values. The action is declared with 'session' as scope in my struts-config file. i.e.: action path=/submit scope=session type=org.myexample.MyAction forward name=success path=/aJpsPage.jsp included=true/ /action Do you know if this is a fault of mine, Tomcat, Struts or, maybe, an expected behavior ? best regards, roberto. -- Roberto Tiella Automated Reasoning Systems - ITC-irst Via Sommarive 18 - Povo 38050 TRENTO - ITALY [EMAIL PROTECTED] tel: +390461314452 http://sra.itc.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tool bar for struts tag generator
Try Struts-Menu - Original Message - From: Peter Rajesh [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:13 PM Subject: tool bar for struts tag generator - Original Message - From: Peter Rajesh To: Struts Users Mailing List Sent: Wednesday, December 10, 2003 2:42 PM hi all is there any work around in net beans to have default struts tag generator some thing like a tool bar regards peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tiles, fixed height, scrollbar
Cool! Didn't know that. Thanks a lot :-) -- Chris. - Original Message - From: Skip Morehead [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 10:29 PM Subject: Re: Tiles, fixed height, scrollbar If you put a div in your tile you can force the div to scroll with div ... style=overflow:auto; ... / -- CLIP! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
When HashMap will replace ActionForm ?
Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When HashMap will replace ActionForm ?
DynaValidator forms stores data in Hashmap internally if you dont want to define norma action forms. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When HashMap will replace ActionForm ?
I can't say there will be any move or not. But MAP backed ActionForms are alreadt there, If you are not interested in using the actionforms and be contended with just hashmaps. Mostly, not always, I treat ActionForm as HashMap but with getter setter already classcasted and defined for properties. not more than that. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set action path from Action.
Thanks for reply. Ok I got what I need. I will do this. In struts-config.xml I will put 5 ForwardActions like this action path=/Sales_Home forward=/sales/index.jsp/ action path=/HR_Home forward=/hr/index.jsp/ etc. At login time a parameter wil be put in the session 'home' with a value of each users home which is the path attribute of action element defined earlier. In every JSP the link is provided like this. html:link action=%=session.getAttribute(home).toString()%Log out/html:link This will work in JSP's. But how to invoke this action from another action class. I have to construct a new ActionForward like this. return new ActionForward(/home.do); Also how to invoke global forward from action class. rgds Antony Paul - Original Message - From: Ted Husted [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 9:31 PM Subject: Re: How to set action path from Action. The different entry points should each be represented by their own ActionForwards. The Action class decides to forward the user to science or biology. The ActionForward supplies the page and directory. Generally, it is helpful to think of the ActionForwards as boxes on a flowchart. The Action class encapsulates the logic that decides it is time to forward to this box or that box. The directory and pages are implmentation details. The focal point is the *logical* names of the ActionForward, not the paths they encapsulate. HTH, Ted. Antony Paul wrote: Hi, After user login based on the dept of user user has to forwarded to pages in different directories. How to do it ?. There are 5 departments. This directory and page to be used in other parts to identify the home page and directory of user so at other times user can be redirected. Putting a ForwardAction in struts-config.xml which accepts and checks a single parameter(Home) is possible ? Or set the path of a global forward at runtime. I am new to Struts. Other options are 1. Write another action class which takes this parameter and based on the user dept got from session invoke corresponding ForwardAction. This action is reached through a global forward. 2. Use modules. I dont know what is it. Is it possible to have same named ForwardAction in different modules ?. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When HashMap will replace ActionForm ?
I know that but one have to define 10 to 30 elements in struts-config.xml for that. With a hash map one have to say whether it is needed ot not. It could be accessed like DynaValidator form. And my requirement is to store simple text field values. rgds Antony Paul. - Original Message - From: Kalra, Ashwani [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 4:05 PM Subject: RE: When HashMap will replace ActionForm ? DynaValidator forms stores data in Hashmap internally if you dont want to define norma action forms. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tag for adding no-cache header.
Hi, Does any Struts tag generate the headers necessary to say browser not to cache a JSP page. It still exists as a scriptlet in my JSP. If one is added it will be useful. I think every dynamic page need this. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
session.invalidate() throws exception.
Hi, Calling session.invalidate() in index.jsp throws this exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a:954) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java:171) at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) How to change this behavior. Better if possible to do some house keeping before invalidating session like if a valid session and data is present in session then go to a certain page. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session.invalidate() throws exception.
one should either *catch* Exception OR use errorPage attribute of [EMAIL PROTECTED] ... directive to handle error HTH Navjot Singh -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:08 PM To: struts Subject: session.invalidate() throws exception. Hi, Calling session.invalidate() in index.jsp throws this exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSe ssion.jav a:954) at org.apache.catalina.session.StandardSessionFacade.getAttribute(Stan dardSessi onFacade.java:171) at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) How to change this behavior. Better if possible to do some house keeping before invalidating session like if a valid session and data is present in session then go to a certain page. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session.invalidate() throws exception.
Hello Antony Here is a sample of code, hopes this solves your problem... public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes and/or parameters we will need Locale locale = getLocale(request); MessageResources messages = getResources(request); HttpSession session = request.getSession(); // Get already logged user info from session scope // We have a Customer Bean in session Customer customer = (Customer)session.getAttribute(USER_KEY); // If customer has not logged in, return control to User Login view with // that reason. if (customer == null) { return new ActionForward(/Login.do?reason= + LOGIN_REASON_NOT_LOGGED_IN, true); } } -- Raman - Original Message - From: Antony Paul [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:08 PM Subject: session.invalidate() throws exception. Hi, Calling session.invalidate() in index.jsp throws this exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a:954) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java:171) at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) How to change this behavior. Better if possible to do some house keeping before invalidating session like if a valid session and data is present in session then go to a certain page. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session.invalidate() throws exception.
Then index.jsp is to be mapped to an action in web.xml. My situation is user goes to another site then returns to home page of our application. rgds Antony Paul. - Original Message - From: Raman Garg [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:05 PM Subject: Re: session.invalidate() throws exception. Hello Antony Here is a sample of code, hopes this solves your problem... public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes and/or parameters we will need Locale locale = getLocale(request); MessageResources messages = getResources(request); HttpSession session = request.getSession(); // Get already logged user info from session scope // We have a Customer Bean in session Customer customer = (Customer)session.getAttribute(USER_KEY); // If customer has not logged in, return control to User Login view with // that reason. if (customer == null) { return new ActionForward(/Login.do?reason= + LOGIN_REASON_NOT_LOGGED_IN, true); } } -- Raman - Original Message - From: Antony Paul [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:08 PM Subject: session.invalidate() throws exception. Hi, Calling session.invalidate() in index.jsp throws this exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a:954) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java:171) at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) How to change this behavior. Better if possible to do some house keeping before invalidating session like if a valid session and data is present in session then go to a certain page. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tag for adding no-cache header.
On 12/10/2003 12:16 PM Antony Paul wrote: Hi, Does any Struts tag generate the headers necessary to say browser not to cache a JSP page. It still exists as a scriptlet in my JSP. If one is added it will be useful. I think every dynamic page need this. rgds Antony Paul. Put this tag inside the controller tag in your struts-config: set-property property=nocache value=true/ Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session.invalidate() throws exception.
hi Antony Can you please briefly explaing the scope and the error Thanks Gary - Original Message - From: Antony Paul [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:30 PM Subject: Re: session.invalidate() throws exception. Then index.jsp is to be mapped to an action in web.xml. My situation is user goes to another site then returns to home page of our application. rgds Antony Paul. - Original Message - From: Raman Garg [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:05 PM Subject: Re: session.invalidate() throws exception. Hello Antony Here is a sample of code, hopes this solves your problem... public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes and/or parameters we will need Locale locale = getLocale(request); MessageResources messages = getResources(request); HttpSession session = request.getSession(); // Get already logged user info from session scope // We have a Customer Bean in session Customer customer = (Customer)session.getAttribute(USER_KEY); // If customer has not logged in, return control to User Login view with // that reason. if (customer == null) { return new ActionForward(/Login.do?reason= + LOGIN_REASON_NOT_LOGGED_IN, true); } } -- Raman - Original Message - From: Antony Paul [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:08 PM Subject: session.invalidate() throws exception. Hi, Calling session.invalidate() in index.jsp throws this exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a:954) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java:171) at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) How to change this behavior. Better if possible to do some house keeping before invalidating session like if a valid session and data is present in session then go to a certain page. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session.invalidate() throws exception.
It seems that your session is getting killed when you navigate to another site and subsequently when you try to invalidate the session it is giving an error since session is already killed. May be you should check for the existence of session and then if the session exists then only try to invalidate the session. Milind -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:31 PM To: Struts Users Mailing List Subject: Re: session.invalidate() throws exception. Then index.jsp is to be mapped to an action in web.xml. My situation is user goes to another site then returns to home page of our application. rgds Antony Paul. - Original Message - From: Raman Garg [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:05 PM Subject: Re: session.invalidate() throws exception. Hello Antony Here is a sample of code, hopes this solves your problem... public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes and/or parameters we will need Locale locale = getLocale(request); MessageResources messages = getResources(request); HttpSession session = request.getSession(); // Get already logged user info from session scope // We have a Customer Bean in session Customer customer = (Customer)session.getAttribute(USER_KEY); // If customer has not logged in, return control to User Login view with // that reason. if (customer == null) { return new ActionForward(/Login.do?reason= + LOGIN_REASON_NOT_LOGGED_IN, true); } } -- Raman - Original Message - From: Antony Paul [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:08 PM Subject: session.invalidate() throws exception. Hi, Calling session.invalidate() in index.jsp throws this exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a:954) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java:171) at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) How to change this behavior. Better if possible to do some house keeping before invalidating session like if a valid session and data is present in session then go to a certain page. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session.invalidate() throws exception.
A sample code is given. Using Tomcat 4.1.27. Struts 1.1 I think downloaded on june 03. %@ taglib uri=/WEB-INF/struts-html.tld prefix=html% %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean% %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic% % session.invalidate(); % html:form action=/LoginAction onsubmit=return validateLoginForm(this) /html:form The error statck is given in first message. rgds Antony Paul. - Original Message - From: Gurpreet Dhanoa [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:36 PM Subject: Re: session.invalidate() throws exception. hi Antony Can you please briefly explaing the scope and the error Thanks Gary - Original Message - From: Antony Paul [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:30 PM Subject: Re: session.invalidate() throws exception. Then index.jsp is to be mapped to an action in web.xml. My situation is user goes to another site then returns to home page of our application. rgds Antony Paul. - Original Message - From: Raman Garg [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:05 PM Subject: Re: session.invalidate() throws exception. Hello Antony Here is a sample of code, hopes this solves your problem... public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes and/or parameters we will need Locale locale = getLocale(request); MessageResources messages = getResources(request); HttpSession session = request.getSession(); // Get already logged user info from session scope // We have a Customer Bean in session Customer customer = (Customer)session.getAttribute(USER_KEY); // If customer has not logged in, return control to User Login view with // that reason. if (customer == null) { return new ActionForward(/Login.do?reason= + LOGIN_REASON_NOT_LOGGED_IN, true); } } -- Raman - Original Message - From: Antony Paul [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:08 PM Subject: session.invalidate() throws exception. Hi, Calling session.invalidate() in index.jsp throws this exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a:954) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java:171) at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) How to change this behavior. Better if possible to do some house keeping before invalidating session like if a valid session and data is present in session then go to a certain page. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tag for adding no-cache header.
pls explain. I want to put header in JSP's. The values are //to prevent page-caching in client response.addHeader(pragma,No-cache); response.addHeader(Cache-Control,no-cache); response.addDateHeader(Expires,0); rgds Antony Paul. - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:33 PM Subject: Re: Tag for adding no-cache header. On 12/10/2003 12:16 PM Antony Paul wrote: Hi, Does any Struts tag generate the headers necessary to say browser not to cache a JSP page. It still exists as a scriptlet in my JSP. If one is added it will be useful. I think every dynamic page need this. rgds Antony Paul. Put this tag inside the controller tag in your struts-config: set-property property=nocache value=true/ Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tag for adding no-cache header.
That xml config tells the struts servlet to put those headers in all responses. If you want to control the headers differently per page, then I guess it won't help. There is no struts taglib to do it, but there may be a jakarta commons-taglib taglib. I'm not sure. Adam On 12/10/2003 01:38 PM Antony Paul wrote: pls explain. I want to put header in JSP's. The values are //to prevent page-caching in client response.addHeader(pragma,No-cache); response.addHeader(Cache-Control,no-cache); response.addDateHeader(Expires,0); rgds Antony Paul. - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:33 PM Subject: Re: Tag for adding no-cache header. On 12/10/2003 12:16 PM Antony Paul wrote: Hi, Does any Struts tag generate the headers necessary to say browser not to cache a JSP page. It still exists as a scriptlet in my JSP. If one is added it will be useful. I think every dynamic page need this. rgds Antony Paul. Put this tag inside the controller tag in your struts-config: set-property property=nocache value=true/ Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with Tomcat and nested:iterate + jsp:include
Hi there, hope someone has a clue, why this doesn't work with Tomcat, but works with Resin : I have a tile, where i want to show a treelike menu based on the monkey example for the struts-nested taglibs, see my code at the bottom. On the Resin and WSAD server, the tree is shown correctly, but with tomcat (4.1.? 5.0.?), only the first children of each node is shown, and i don't know why, i assume that somehow tomcat only includes the treenode.jsp once, like on PHP where i can you have include include_once. But where can i change this behavior of Tomcat ??? Thanx in advance Rouven submenu.jsp : %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-nested.tld prefix=nested % nested:form action=/treechange.do nested:nest property=rootNode jsp:include page=treenode.jsp / /nested:nest /nested:form --- treenode.jsp : --- [EMAIL PROTECTED] contentType=text/html% %@ taglib uri=/WEB-INF/struts-nested.tld prefix=nested % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %-- monkey magic goes here --% nested:root img src=%=request.getContextPath()%/pix/spacer.gif width=nested:write property=nodeIndent / height=1 nested:equal property=showChildren value=true nested:notEqual property=level value=0 nested:image src=pix/km_minus.gif property=toggle / nested:equal property=active value=true nested:link styleClass=active page=/goneu.do paramId=method paramProperty=method nested:write filter=false property=nodeName / /nested:link /nested:equal nested:equal property=active value=false nested:link styleClass=notactive page=/goneu.do paramId=method paramProperty=method nested:write filter=false property=nodeName / /nested:link /nested:equal /nested:notEqual br nested:iterate property=children jsp:include page=treenode.jsp / /nested:iterate /nested:equal nested:equal property=showChildren value=false nested:equal property=hasChildren value=true nested:image src=pix/km_plus.gif property=toggle / /nested:equal nested:equal property=hasChildren value=false img src=%=request.getContextPath()%/pix/km_empty.gif /nested:equal nested:equal property=active value=true nested:link styleClass=active page=/goneu.do paramId=method paramProperty=method nested:write filter=false property=nodeName / /nested:link /nested:equal nested:equal property=active value=false nested:link styleClass=notactive page=/goneu.do paramId=method paramProperty=method nested:write filter=false property=nodeName / /nested:link /nested:equal br /nested:equal /nested:root - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When HashMap will replace ActionForm ?
That's where a map-backed Hashmap is useful. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 6:02 AM To: Struts Users Mailing List Subject: Re: When HashMap will replace ActionForm ? I know that but one have to define 10 to 30 elements in struts-config.xml for that. With a hash map one have to say whether it is needed ot not. It could be accessed like DynaValidator form. And my requirement is to store simple text field values. rgds Antony Paul. - Original Message - From: Kalra, Ashwani [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 4:05 PM Subject: RE: When HashMap will replace ActionForm ? DynaValidator forms stores data in Hashmap internally if you dont want to define norma action forms. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic tag using locale
All, I'm trying to do a bean:write based on the user's current language. Before you ask, this isn't just internationalization using the properties files. I'm displaying item attributes stored in a database, where there are german and english descriptions. I know I can set a bean in my action and access the tag like so: request.setAttribute(currentLanguage, getLocale(request).getLanguage()); logic:equal name=currentLanguage value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal logic:equal name=currentLanguage value=de bean:write name=product property=specialFeaturesDE ignore=true / /logic:equal is there a bean for locale by default which removes the need to set the currentLanguage bean I have above? something like: logic:equal name=userlocale value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal Are there any special beans which have default names? Any help is appreciated. cheers, Fred _ This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing. If this email contains an offer, that should be considered as an invitation to treat. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When HashMap will replace ActionForm ?
but it prints the form field name like this map(username). I want to get the key as name of form field. here username. possible ? rgds Antony Paul. - Original Message - From: Fullam, Jonathan [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 7:30 PM Subject: RE: When HashMap will replace ActionForm ? That's where a map-backed Hashmap is useful. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 6:02 AM To: Struts Users Mailing List Subject: Re: When HashMap will replace ActionForm ? I know that but one have to define 10 to 30 elements in struts-config.xml for that. With a hash map one have to say whether it is needed ot not. It could be accessed like DynaValidator form. And my requirement is to store simple text field values. rgds Antony Paul. - Original Message - From: Kalra, Ashwani [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 4:05 PM Subject: RE: When HashMap will replace ActionForm ? DynaValidator forms stores data in Hashmap internally if you dont want to define norma action forms. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionErrors without resource bundle.
Hi, I want to display error messages saved in Action class using saveErrors without looking at resource bundle. Instead of the key provide message. Possible ? Our app does not need internatilisation support and putting all errors related to business logic in resource bundle is unnecessary. There will be lot of entries int it. One have to use searching tools to find the error message in bundle. rgds Antony Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
token pattern
hi, Can any one point me to the above pattern documentation/usage used in struts. Thanks Regds Ashwani Kalra This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: token pattern
http://jakarta.apache.org/struts/api/org/apache/struts/action/Action.html From: Kalra, Ashwani [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts (E-mail) [EMAIL PROTECTED] Subject: token pattern Date: Wed, 10 Dec 2003 22:12:52 +0800 hi, Can any one point me to the above pattern documentation/usage used in struts. Thanks Regds Ashwani Kalra This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Shop online for kids toys by age group, price range, and toy category at MSN Shopping. No waiting for a clerk to help you! http://shopping.msn.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] using tld inside jar
Hi all, I would like to use the jakarta String-1.0.1 taglib in my app, but tld is packaged inside jar. I use tomcat 4.1.27, that is servlet 2.3 compliant so taht should be able to use this taglib as is, but I don't know what to set in web.xml as taglib element (especially for taglib-location) Could you help me please ? Nico. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles setup question
IMHO, the documentation is somewhat misleading. I struggled with this for some time before I realized what it was really saying. To clarify: You can use a tiles name as a forward in your struts-config.xml file either as a global-forward or a local forward for an action. (You've got this part) *Actions* can then use that forward via mapping.findForward because--and this is the key part--the request processor (which is now the TilesRequestProcessor) knows about tiles and understands how to render it. *Links* must still point to a tangible (if you will) target such as a file that can be served by the server (i.e. a .jsp or .html), a servlet, or an action (i.e. *.do). A simple rule is that if you can put it in the browser location bar, you can link to it, right? =) When the html:link tag tries to render the link, it doesn't know about plugins such as tiles. The taglibs are independent, so it simply encodes the path attribute of the given forward and renders it back. Remember the rule here; if you put it in the browser location bar, can you get to it? Nope. So, you need to specify a controller component of some sort such as the DefinitionDispatchAction or a generic action that simply forwards to a specific definition. Another option is to create a default action that uses its path to define a tile definition name and dispatches to the tile def. I've done this (prior to knowing about DefinitionDispatchAction) and it's pretty slick for sites that constantly have new pages added. The only problem with this is that you get no help from your editor in validating your links, because ones that are valid will show up as broken. At least DefinitionDispatchAction has the reverse problem--all the links look valid. =) David Hibbs, ACS Staff Programmer / Analyst Distributed Applications Development and Support American National Insurance Company -Original Message- From: Richard Hill [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 4:41 PM To: 'Struts Users Mailing List' Subject: RE: Tiles setup question Tim, I tried what suggested, but still get the The requested resource (/myapp/myapp.index) is not available. error. Somethings missing...the Factory gets initialized from file '/WEB-INF/tiles-defs.xml' but it looks like the strut-config can't find or map to the tiles definitions. Any other suggestions? Do I need to specify a controller, or am I missing something in my config files? Thanks, Richard -Original Message- From: Tim Lucia [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 5:42 PM To: 'Struts Users Mailing List' Subject: RE: Tiles setup question The global forwards work for struts taglib tags, generally as the value of the name= attribute. They do not export to the web server (servlet mapping, *.jsp, etc.) level. Thus, to access the forward you defined: global-forwards forward name=index path=/myapp.index/ /global-forwards You would say: html:link forward=index[Return to main menu]/html:link However, the target of path cannot be a tile, it must be an action which forwards to the tile. [Is this true? I have never seen a tile as a global forward target] Here is an example: Your.jsp: %@ taglib uri=/tags/struts-html prefix=html % html:link forward=tileTest[return to main menu]/html:link Your-struts-config.xml: forward name=tileTest path=/tileTest.do/ action path=/tileTest type=org.apache.struts.actions.ForwardAction parameter=.tileTest/ Your-tiles-def.xml: definition name=.tileTest extends=layout/ Tim Lucia -Original Message- From: Richard Hill [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 7:59 PM To: '[EMAIL PROTECTED]' Subject: Tiles setup question I'm setting up tiles with an example application and I'm getting blocked when trying to use Tiles layout names instead of the JSP filenames in the struts-config.xml. I'm hoping that someone on this list can point out what I'm doing wrong. I can access the application by explicitly typing in index.jsp in the url, but when I try a page with a link defined in my struts-config.xml global-forwards name=index I get an error message: The requested resource (/myapp/myapp.index) is not available. My tomcat localhost.log file show that the Tiles definition factory gets loaded...what am I missing? Thanks, Richard --- localhost.log --- action: Tiles definition factory loaded for processor ''. factory loaded : {myapp.default={name=myapp.default, path=/layouts/myappLayout.jsp, role=null, controller=null, controllerType=null, controllerInstance=null, attributes={header=/tiles/common/header.jsp, footer=/tiles/common/footer.jsp}} ,
logic tag using locale
All, I'm trying to do a bean:write based on the user's current language. Before you ask, this isn't just internationalization using the properties files. I'm displaying item attributes stored in a database, where there are german and english descriptions. I know I can set a bean in my action and access the tag like so: request.setAttribute(currentLanguage, getLocale(request).getLanguage()); logic:equal name=currentLanguage value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal logic:equal name=currentLanguage value=de bean:write name=product property=specialFeaturesDE ignore=true / /logic:equal is there a bean for locale by default which removes the need to set the currentLanguage bean I have above? something like: logic:equal name=userlocale value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal Are there any special beans which have default names? Any help is appreciated. cheers, Fred _ This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing. If this email contains an offer, that should be considered as an invitation to treat. _
Re: [OT] using tld inside jar
Don't put anything in web.xml. Just do this in your JSP: %@ taglib prefix=string uri=http://jakarta.apache.org/taglibs/string-1.0.1; % Quoting Nicolas De Loof [EMAIL PROTECTED]: Hi all, I would like to use the jakarta String-1.0.1 taglib in my app, but tld is packaged inside jar. I use tomcat 4.1.27, that is servlet 2.3 compliant so taht should be able to use this taglib as is, but I don't know what to set in web.xml as taglib element (especially for taglib-location) Could you help me please ? Nico. -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] using tld inside jar
So simple I didn't thik about it ! Thanks. - Original Message - From: Kris Schneider [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 4:06 PM Subject: Re: [OT] using tld inside jar Don't put anything in web.xml. Just do this in your JSP: %@ taglib prefix=string uri=http://jakarta.apache.org/taglibs/string-1.0.1; % Quoting Nicolas De Loof [EMAIL PROTECTED]: Hi all, I would like to use the jakarta String-1.0.1 taglib in my app, but tld is packaged inside jar. I use tomcat 4.1.27, that is servlet 2.3 compliant so taht should be able to use this taglib as is, but I don't know what to set in web.xml as taglib element (especially for taglib-location) Could you help me please ? Nico. -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
deployment environment
Hi, I have an intranet application created locally struts framework, tomcat/with a sybase database. I want to distribute to the intranet sites of other users. So basically I need to install tomcat, JDK, .war and the database engine. So my question... What is the best way to install this all at other places ? Install everything seperately ? Or using a Wise, or installshield program ? And what if there is allready a JDK installed ? or somebody has another idea... ? Thanks
Multiple Properties Files
I have searched the archive and could not resolve my issue. I have a struts-config.xml file where I would like to specify multiple properties files. A common properties file for the main application and an image properties file. I tried the following: struts-config.xml message-resources parameter=directorystuff.ApplicationResources null=false / message-resources parameter=directorystuff.ImgApplicationResources key=IMG_RESOURCE_KEY null=false / I see that both properties files are initialized when the server starts. List.jsp: html:img bundle=IMG_RESOURCE_KEY pageKey=image.searchbox.top border=0 / error when running jsp: [ServletException in:/WEB-INF/directorystuff/List.jsp] Cannot find message resources under key IMG_RESOURCE_KEY' I did see one comment in the archive that mentioned if you are using the validator (which I am) that you can't use multiple properties file, but I couldn't find any additional comments to substantiate this statement. Any thoughts? Thank you. Zach Curtis TSYS Technology Center [EMAIL PROTECTED] 208-424-2145 - The information contained in this communication (including any attachments hereto) is confidential and is intended solely for the personal and confidential use of the individual or entity to whom it is addressed. The information may also constitute a legally privileged confidential communication. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this communication in error and that any review, dissemination, copying, or unauthorized use of this information, or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. Thank you
RE: logic tag using locale
I've got a similar problem. You could write a scriptlet function that appended the correct languageCode onto your default property name and use the result of that string in the bean:write tag. Please let me know if you find a more elegant way around this. -Original Message- From: Tsang, F (Fred) [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 10:01 AM To: [EMAIL PROTECTED] Subject: logic tag using locale All, I'm trying to do a bean:write based on the user's current language. Before you ask, this isn't just internationalization using the properties files. I'm displaying item attributes stored in a database, where there are german and english descriptions. I know I can set a bean in my action and access the tag like so: request.setAttribute(currentLanguage, getLocale(request).getLanguage()); logic:equal name=currentLanguage value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal logic:equal name=currentLanguage value=de bean:write name=product property=specialFeaturesDE ignore=true / /logic:equal is there a bean for locale by default which removes the need to set the currentLanguage bean I have above? something like: logic:equal name=userlocale value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal Are there any special beans which have default names? Any help is appreciated. cheers, Fred _ This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing. If this email contains an offer, that should be considered as an invitation to treat. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: deployment environment
This gave me a crazy idea, and I don't know if it works, but I wonder if one could use JNLP/webstart to handle this since it has facilities for handling JDK requirements and such. I am not sure how you get the war file deployed that way, but it could possibly pull a pre-configured tomcat I don't know. The more I think about it, the more configuration issues seem to get in the way. Though perhaps you could have a small web app that collected the config information, created the config files and created a package for the site and then served a dynamically generated jnlp file to pull the user's package? This would have the advantage/drawback of making the tomcat instance nearly unconfigurable after the fact I think. Actually, it might not work at all. I don't know if webstart can create a directory tree for tomcat to work in... Starting to sound like too much work though... I suppose it depends on the savy of the admins at the sites and how many sites you have. Just a random thought, and I suspect it won't work now that I have actually finnished writing this, but I might as well hit send :) -Gus struts wrote: Hi, I have an intranet application created locally struts framework, tomcat/with a sybase database. I want to distribute to the intranet sites of other users. So basically I need to install tomcat, JDK, .war and the database engine. So my question... What is the best way to install this all at other places ? Install everything seperately ? Or using a Wise, or installshield program ? And what if there is allready a JDK installed ? or somebody has another idea... ? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
'Module scoped' variables
Hi, Hope this isn't too naïve a question Is there anyway of setting parameters in a module-level struts-config file and referencing those variables within an action? Effectively giving me a module scope. Regards Lawrence --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session.invalidate() throws exception.
Usually, it is a bad idea to do these thing inside a JSP(or View). Front Controller is where you want to do all these tuff. Sure, you can query the session object before you invalidate its or just try/catch IlligalStateException and ignore it. Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] (949) 509-4564 The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 3:38 AM To: struts Subject: session.invalidate() throws exception. Hi, Calling session.invalidate() in index.jsp throws this exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a:954) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java:171) at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) How to change this behavior. Better if possible to do some house keeping before invalidating session like if a valid session and data is present in session then go to a certain page. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: 'Module scoped' variables
Not sure if it's exactly what you want but I know you can use the parameter attribute of the action tags to specify a value that is accessible using mapping.getParameter() from withing you Action class. action ... ... parameter=someValue/ -Jonathan -Original Message- From: Lawrence Williams [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:20 AM To: [EMAIL PROTECTED] Subject: 'Module scoped' variables Hi, Hope this isn't too naïve a question Is there anyway of setting parameters in a module-level struts-config file and referencing those variables within an action? Effectively giving me a module scope. Regards Lawrence --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tag for adding no-cache header.
In your deployment descriptor, web.xml, you can can set the ActionServlet's parameter no-cache=true. The container will take care of this for you as long as all of your request go through the FrontController. Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] (949) 509-4564 The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 3:16 AM To: struts Subject: Tag for adding no-cache header. Hi, Does any Struts tag generate the headers necessary to say browser not to cache a JSP page. It still exists as a scriptlet in my JSP. If one is added it will be useful. I think every dynamic page need this. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: 'Module scoped' variables
Thanks Jonathan, That's kind of the half solution I have at present - the problem is I have to specify the parameter in all my actions as it is 'global to the module'. This makes changing the value a bit tedious. Does this make sense? Regards Lawrence -Original Message- From: Fullam, Jonathan [mailto:[EMAIL PROTECTED] Sent: 10 December 2003 16:23 To: 'Struts Users Mailing List' Subject: RE: 'Module scoped' variables Not sure if it's exactly what you want but I know you can use the parameter attribute of the action tags to specify a value that is accessible using mapping.getParameter() from withing you Action class. action ... ... parameter=someValue/ -Jonathan -Original Message- From: Lawrence Williams [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:20 AM To: [EMAIL PROTECTED] Subject: 'Module scoped' variables Hi, Hope this isn't too naïve a question Is there anyway of setting parameters in a module-level struts-config file and referencing those variables within an action? Effectively giving me a module scope. Regards Lawrence --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tag for adding no-cache header.
Setting the nocache in the web.xml has actually been deprecated. A better solution for you is to set the nocache header as an attribute inside the controller element of you struts-config file. -Jonathan -Original Message- From: Trieu, Danny [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:31 AM To: 'Struts Users Mailing List' Subject: RE: Tag for adding no-cache header. In your deployment descriptor, web.xml, you can can set the ActionServlet's parameter no-cache=true. The container will take care of this for you as long as all of your request go through the FrontController. Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] (949) 509-4564 The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 3:16 AM To: struts Subject: Tag for adding no-cache header. Hi, Does any Struts tag generate the headers necessary to say browser not to cache a JSP page. It still exists as a scriptlet in my JSP. If one is added it will be useful. I think every dynamic page need this. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When HashMap will replace ActionForm ?
I don't want to offense any one, and all though HashMap or DynaWhatever are convenience, but isn't it anti OO? Meaning there are no type checking, and you are just passing a bag of chunk around? Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:43 AM To: Struts Users Mailing List Subject: RE: When HashMap will replace ActionForm ? I can't say there will be any move or not. But MAP backed ActionForms are alreadt there, If you are not interested in using the actionforms and be contended with just hashmaps. Mostly, not always, I treat ActionForm as HashMap but with getter setter already classcasted and defined for properties. not more than that. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When HashMap will replace ActionForm ?
Anyone who's done major business application development knows that academic arguments on programming 'style' get thrown right out the window in favor of efficient progress ;-) -Original Message- From: Trieu, Danny [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 10:38 AM To: 'Struts Users Mailing List' Subject: RE: When HashMap will replace ActionForm ? I don't want to offense any one, and all though HashMap or DynaWhatever are convenience, but isn't it anti OO? Meaning there are no type checking, and you are just passing a bag of chunk around? Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:43 AM To: Struts Users Mailing List Subject: RE: When HashMap will replace ActionForm ? I can't say there will be any move or not. But MAP backed ActionForms are alreadt there, If you are not interested in using the actionforms and be contended with just hashmaps. Mostly, not always, I treat ActionForm as HashMap but with getter setter already classcasted and defined for properties. not more than that. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PlugIn Scheduler
Huh, I don't know if managing your own Thread is recommended by container. Is there another way around this? Like JMX or implement the service action and have a Demom periodically ping that service action to execute the intense action? -danny Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] (949) 509-4564 The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Gurpreet Dhanoa [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 10:32 PM To: Struts Users Mailing List Subject: Re: PlugIn Scheduler hi ALl It worked perfectly fine. Soon i will be posting the code for all of the buddies so that they can use it into there application. - Original Message - From: Gurpreet Dhanoa [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:24 AM Subject: PlugIn Scheduler hi I have created the following plug-in and using it into my application. The problem which I am facing is when I am running tomcat. The plug -in is not starting. The basic idea behind this plugin is to start a thread and peform some logic after some interval of time. ANy suggestions will be of great help. Following is the code for Plugin Class and the struts-config.xml PlugTest.java package efit; import java.io.PrintStream; import javax.servlet.ServletException; import org.apache.struts.action.ActionServlet; import org.apache.struts.action.PlugIn; import org.apache.struts.config.ApplicationConfig; public class PluginTest implements PlugIn, Runnable { public PluginTest() { t = null; } public void init(ActionServlet servlet, ApplicationConfig applicationConfig) throws ServletException { System.out.println(The Plugin is starting); t = new Thread(this); t.start(); } public void destroy() { System.err.println(\u2212\u2212\u2212\u2212The Plugin is stopping\u2212\u2212\u2212\u2212); } public void run() { do { System.out.println(Plugin is Running); try { Thread.sleep(1000L); } catch(Exception t) { System.out.println(Exception in Thread + t.getMessage()); } } while(true); } Thread t; } in the Struts-config.xml I m using the plugin usiong the following tag plug-in className=efit.PluginTest/ Thanks Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: 'Module scoped' variables
Yes. I actually thought of that issue after I replied to you. Another option you can look into is subclassing the ControllerConfig class and specify your new Config class in the className attribute of the controller element in each of your modules. You could then build in the functionality to configure extra module-scoped variable. -Jonathan -Original Message- From: Lawrence Williams [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:35 AM To: Struts Users Mailing List Subject: RE: 'Module scoped' variables Thanks Jonathan, That's kind of the half solution I have at present - the problem is I have to specify the parameter in all my actions as it is 'global to the module'. This makes changing the value a bit tedious. Does this make sense? Regards Lawrence -Original Message- From: Fullam, Jonathan [mailto:[EMAIL PROTECTED] Sent: 10 December 2003 16:23 To: 'Struts Users Mailing List' Subject: RE: 'Module scoped' variables Not sure if it's exactly what you want but I know you can use the parameter attribute of the action tags to specify a value that is accessible using mapping.getParameter() from withing you Action class. action ... ... parameter=someValue/ -Jonathan -Original Message- From: Lawrence Williams [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:20 AM To: [EMAIL PROTECTED] Subject: 'Module scoped' variables Hi, Hope this isn't too naïve a question Is there anyway of setting parameters in a module-level struts-config file and referencing those variables within an action? Effectively giving me a module scope. Regards Lawrence --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When HashMap will replace ActionForm ?
or philosophical purity should always yield to pragmatism Hookom, Jacob wrote: Anyone who's done major business application development knows that academic arguments on programming 'style' get thrown right out the window in favor of efficient progress ;-) -Original Message- From: Trieu, Danny [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 10:38 AM To: 'Struts Users Mailing List' Subject: RE: When HashMap will replace ActionForm ? I don't want to offense any one, and all though HashMap or DynaWhatever are convenience, but isn't it anti OO? Meaning there are no type checking, and you are just passing a bag of chunk around? Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:43 AM To: Struts Users Mailing List Subject: RE: When HashMap will replace ActionForm ? I can't say there will be any move or not. But MAP backed ActionForms are alreadt there, If you are not interested in using the actionforms and be contended with just hashmaps. Mostly, not always, I treat ActionForm as HashMap but with getter setter already classcasted and defined for properties. not more than that. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Incompatibility between STRUTS TAGS and JSTL TAGS
Hello everybody. I have a small problem that maybe someone has already had in the past. In a jsp page I try to retrive request parameters thus ( STRUTS + Jakarta TAGLIBS ) : req:parameters id=loop Name: bean:write name=loop property=name/ Value: bean:write name=loop property=value/ /req:parameters and this works fine... When I try JSTL c:out value=${requestScope.source}/ c:out value=${requestScope.animalId}/ c:out value=${requestScope.injId}/ doesn't work... The names of the the request parameters that should be there are correct... Is there any masking between JSTL vars and STRUTS vars that someone is aware of? Todor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question about logweb
Hi, I try to use the logweb application from codeczar and I have problem with the Jdk 1.3. Is there someone who knows how to get the source ? I try the web site but the information about the cvs access seems for me incorrect. Rgs -- Fabrice BLANQUART Banque COVEFI - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getServletContext() throws null pointer
Hi, I've put an object into the ServletContext with an init servlet started on load via web.xml. Accessing it with my main Action works fine, but when I try to use another servlet (extend HttpServlet) to getServletContext() it throws a null pointer exception (doesn't just return null - goes straight to the exception). From the javadoc on ServletContext I'm led to believe that all servlets in the app share the same ServletContext, so I'm confused. I'm attempting this lookup in the constructor of the servlet - does it have to happen in a doGet or such? Any ideas? Also, is there some way of accessing the ServletContext without being a Servlet? Thanks very much, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getServletContext() throws null pointer
Constructor is the answer to your problem. There are no guarantee that the servlet that set the data will be loaded before the servlet that accessing it. Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] (949) 509-4564 The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Oliver Meyn [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 9:08 AM To: [EMAIL PROTECTED] Subject: getServletContext() throws null pointer Hi, I've put an object into the ServletContext with an init servlet started on load via web.xml. Accessing it with my main Action works fine, but when I try to use another servlet (extend HttpServlet) to getServletContext() it throws a null pointer exception (doesn't just return null - goes straight to the exception). From the javadoc on ServletContext I'm led to believe that all servlets in the app share the same ServletContext, so I'm confused. I'm attempting this lookup in the constructor of the servlet - does it have to happen in a doGet or such? Any ideas? Also, is there some way of accessing the ServletContext without being a Servlet? Thanks very much, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getServletContext() throws null pointer
On Wed, 2003-12-10 at 12:12, Trieu, Danny wrote: Constructor is the answer to your problem. There are no guarantee that the servlet that set the data will be loaded before the servlet that accessing it. I'm attempting to make that guarantee but I can see how the servlets might not care. Further testing reveals that the contructor is not the problem, though, since putting the lookup in a separate function called after construction also fails. Other thoughts? Thanks, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getServletContext() throws null pointer
Oliver, Are you overriding init(ServletConfig config) in your init servlet? If so, did you call super.init(config) before you tried accessing the ServletContext? -Richard --- Oliver Meyn [EMAIL PROTECTED] wrote: Hi, I've put an object into the ServletContext with an init servlet started on load via web.xml. Accessing it with my main Action works fine, but when I try to use another servlet (extend HttpServlet) to getServletContext() it throws a null pointer exception (doesn't just return null - goes straight to the exception). From the javadoc on ServletContext I'm led to believe that all servlets in the app share the same ServletContext, so I'm confused. I'm attempting this lookup in the constructor of the servlet - does it have to happen in a doGet or such? Any ideas? Also, is there some way of accessing the ServletContext without being a Servlet? Thanks very much, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tag for adding no-cache header.
1- Does someone know precisely what headers are added to HTTP responses when adding the following to the controller element of the struts-config file ? set-property property=nocache value=true/ 2- I am currently using the following to disable user-agent cache inside of my Struts Actions. Does anyone know if the solution mentionned in (1) is better than the solution I am using ? // Set to expire far in the past. response.setHeader(Expires, -1); // Set standard HTTP/1.1 no-cache headers. response.setHeader(Cache-Control, no-store, no-cache, must-revalidate); // Set IE extended HTTP/1.1 no-cache headers (use addHeader). response.addHeader(Cache-Control, post-check=0, pre-check=0); // Set standard HTTP/1.0 no-cache header. response.setHeader(Pragma, no-cache); Sylvain - Original Message - From: Fullam, Jonathan [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:34 AM Subject: RE: Tag for adding no-cache header. Setting the nocache in the web.xml has actually been deprecated. A better solution for you is to set the nocache header as an attribute inside the controller element of you struts-config file. -Jonathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tag for adding no-cache header.
If I remember correctly, I think the request processor did exactly what you did on 2. And I think (1) approach is better and it consistent with MVC. Just make sure that all of your request will go through the FrontController then all of your response will have it header set with no-cache. --danny Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] (949) 509-4564 The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Sylvain Cliche [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 9:23 AM To: Struts Users Mailing List Subject: Re: Tag for adding no-cache header. 1- Does someone know precisely what headers are added to HTTP responses when adding the following to the controller element of the struts-config file ? set-property property=nocache value=true/ 2- I am currently using the following to disable user-agent cache inside of my Struts Actions. Does anyone know if the solution mentionned in (1) is better than the solution I am using ? // Set to expire far in the past. response.setHeader(Expires, -1); // Set standard HTTP/1.1 no-cache headers. response.setHeader(Cache-Control, no-store, no-cache, must-revalidate); // Set IE extended HTTP/1.1 no-cache headers (use addHeader). response.addHeader(Cache-Control, post-check=0, pre-check=0); // Set standard HTTP/1.0 no-cache header. response.setHeader(Pragma, no-cache); Sylvain - Original Message - From: Fullam, Jonathan [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 11:34 AM Subject: RE: Tag for adding no-cache header. Setting the nocache in the web.xml has actually been deprecated. A better solution for you is to set the nocache header as an attribute inside the controller element of you struts-config file. -Jonathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When HashMap will replace ActionForm ?
In my experience (with Ant mostly) the best way to get anything started in an apache project is with a patch submitted in the bugzilla :) Gus Antony Paul wrote: Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Drow-Down list HashMap???
How can I generate I dropDown List with a HashMap getting the key(HashMap) how value(HTML) and the value(HashMap) how name(HTML) With this HashMap: HashMap map = new HashMap(); map.put(1,test1); map.put(2,test2); map.put(3,test3); map.put(4,test4); And I want this output select name=teste option value=1teste1/option option value=2teste2/option option value=3teste3/option option value=4teste4/option /select
Re: getServletContext() throws null pointer
On Wed, 2003-12-10 at 12:18, Richard Yee wrote: Oliver, Are you overriding init(ServletConfig config) in your init servlet? If so, did you call super.init(config) before you tried accessing the ServletContext? I'm not overriding init(config) but I am overriding init(). I hadn't been calling super.init() but gave that a shot and no change. I am able to access the ServletContext (and the init-ed object) from both my controlling Action and from a jsp - just not from another servlet. I must be missing something simple yet fundamental... Thanks, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles setup question
Thanks David for explaining this so clearly. I now understand the problem and have been able to get my application working. Thanks Tim for your help too. - Richard -Original Message- From: Hibbs, David [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 6:43 AM To: Richard Hill; 'Struts Users Mailing List' Subject: RE: Tiles setup question IMHO, the documentation is somewhat misleading. I struggled with this for some time before I realized what it was really saying. To clarify: You can use a tiles name as a forward in your struts-config.xml file either as a global-forward or a local forward for an action. (You've got this part) *Actions* can then use that forward via mapping.findForward because--and this is the key part--the request processor (which is now the TilesRequestProcessor) knows about tiles and understands how to render it. *Links* must still point to a tangible (if you will) target such as a file that can be served by the server (i.e. a .jsp or .html), a servlet, or an action (i.e. *.do). A simple rule is that if you can put it in the browser location bar, you can link to it, right? =) When the html:link tag tries to render the link, it doesn't know about plugins such as tiles. The taglibs are independent, so it simply encodes the path attribute of the given forward and renders it back. Remember the rule here; if you put it in the browser location bar, can you get to it? Nope. So, you need to specify a controller component of some sort such as the DefinitionDispatchAction or a generic action that simply forwards to a specific definition. Another option is to create a default action that uses its path to define a tile definition name and dispatches to the tile def. I've done this (prior to knowing about DefinitionDispatchAction) and it's pretty slick for sites that constantly have new pages added. The only problem with this is that you get no help from your editor in validating your links, because ones that are valid will show up as broken. At least DefinitionDispatchAction has the reverse problem--all the links look valid. =) David Hibbs, ACS Staff Programmer / Analyst Distributed Applications Development and Support American National Insurance Company -Original Message- From: Richard Hill [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 4:41 PM To: 'Struts Users Mailing List' Subject: RE: Tiles setup question Tim, I tried what suggested, but still get the The requested resource (/myapp/myapp.index) is not available. error. Somethings missing...the Factory gets initialized from file '/WEB-INF/tiles-defs.xml' but it looks like the strut-config can't find or map to the tiles definitions. Any other suggestions? Do I need to specify a controller, or am I missing something in my config files? Thanks, Richard -Original Message- From: Tim Lucia [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 5:42 PM To: 'Struts Users Mailing List' Subject: RE: Tiles setup question The global forwards work for struts taglib tags, generally as the value of the name= attribute. They do not export to the web server (servlet mapping, *.jsp, etc.) level. Thus, to access the forward you defined: global-forwards forward name=index path=/myapp.index/ /global-forwards You would say: html:link forward=index[Return to main menu]/html:link However, the target of path cannot be a tile, it must be an action which forwards to the tile. [Is this true? I have never seen a tile as a global forward target] Here is an example: Your.jsp: %@ taglib uri=/tags/struts-html prefix=html % html:link forward=tileTest[return to main menu]/html:link Your-struts-config.xml: forward name=tileTest path=/tileTest.do/ action path=/tileTest type=org.apache.struts.actions.ForwardAction parameter=.tileTest/ Your-tiles-def.xml: definition name=.tileTest extends=layout/ Tim Lucia -Original Message- From: Richard Hill [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 7:59 PM To: '[EMAIL PROTECTED]' Subject: Tiles setup question I'm setting up tiles with an example application and I'm getting blocked when trying to use Tiles layout names instead of the JSP filenames in the struts-config.xml. I'm hoping that someone on this list can point out what I'm doing wrong. I can access the application by explicitly typing in index.jsp in the url, but when I try a page with a link defined in my struts-config.xml global-forwards name=index I get an error message: The requested resource (/myapp/myapp.index) is not available. My tomcat localhost.log file show that the Tiles definition factory gets loaded...what am I missing? Thanks, Richard
Re: Incompatibility between STRUTS TAGS and JSTL TAGS
You seem to be confusing request parameters and request attributes (or request-scoped variables). Try: c:out value=${param.source}/ JSTL gives you two ways (implicit objects) to get at request parameters: param a Map that maps parameter names to a single String parameter value (obtained by calling ServletRequest.getParameter(String name)) paramValues a Map that maps parameter names to a String[] of all values for that parameter (obtained by calling ServletRequest.getParameterValues(String name)) Quoting Todor Sergueev Petkov [EMAIL PROTECTED]: Hello everybody. I have a small problem that maybe someone has already had in the past. In a jsp page I try to retrive request parameters thus ( STRUTS + Jakarta TAGLIBS ) : req:parameters id=loop Name: bean:write name=loop property=name/ Value: bean:write name=loop property=value/ /req:parameters and this works fine... When I try JSTL c:out value=${requestScope.source}/ c:out value=${requestScope.animalId}/ c:out value=${requestScope.injId}/ doesn't work... The names of the the request parameters that should be there are correct... Is there any masking between JSTL vars and STRUTS vars that someone is aware of? Todor -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionErrors without resource bundle.
You can put a single entry in the bundle general.error={0} and use this with all your error messages. HTH, Ted. Antony Paul wrote: Hi, I want to display error messages saved in Action class using saveErrors without looking at resource bundle. Instead of the key provide message. Possible ? Our app does not need internatilisation support and putting all errors related to business logic in resource bundle is unnecessary. There will be lot of entries int it. One have to use searching tools to find the error message in bundle. rgds Antony Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to detect that session has expired ?
D'oh! That's the one I ment, not ServletContextListener. Kirk Must proofread before sending Wylie M7 Corporation Curtis Taylor wrote: HttpSessionListener is your friend...;-) http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html Kirk Wylie wrote: Ashish Kulkarni wrote: HI if u are using servelt 2.3 , then u can use servelt filter, in this filter u can have logic to check session before each request so u dont need to add any code in jsp or action class If he's using Servlet 2.3, then he can also use the ServletContextListener in conjunction, where is where the logic for whether the session has been restarted could likely belong. Kirk Wylie M7 Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- c dot tee at verizon dot net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getServletContext() throws null pointer
as i understand it, in order to retrieve the servlet context, you need to use the ServletConfig to retrieve it like so: config.getServletContext() this sounds similar to a problem that i had where i was trying to log something from a servlet, just used the log() method and it through an exception pretty much like the one you are experiencing. however, by putting config.getServletContext().log() it threw no exceptions... - Original Message - From: Oliver Meyn [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:41 PM Subject: Re: getServletContext() throws null pointer On Wed, 2003-12-10 at 12:18, Richard Yee wrote: Oliver, Are you overriding init(ServletConfig config) in your init servlet? If so, did you call super.init(config) before you tried accessing the ServletContext? I'm not overriding init(config) but I am overriding init(). I hadn't been calling super.init() but gave that a shot and no change. I am able to access the ServletContext (and the init-ed object) from both my controlling Action and from a jsp - just not from another servlet. I must be missing something simple yet fundamental... Thanks, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation: Problem with datePattern and JavaScript
Hi, Do u have an example of using validate-rules.xml in a JSP file. Thanks - Original Message - From: Rouven Gehm [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, December 04, 2003 1:53 PM Subject: Validation: Problem with datePattern and JavaScript I want to know if someone has updated the javascript code in the validate-rules.xml, for the datePattern option ? Because the code i have from the Struts 1.1 zip only work with datePatternStrict !!! I have searched the user mailing list, for this problem, but not found any solution. Thanx Rouven - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Log4J and Pre-Processor
Tim Lucia wrote: Would you rather have that 5ns, or the ace-in-the-hole where you can debug your app in an installed production environment by turning on (assuming you don't use the final static boolean method) the appropriate logger? This has been extremely helpful in debugging. It also catches lots of things you wouldn't ordinarily see, like when you add this to an ActionListener more then once and you see your actionPerformed() get called more then once. It's also useful for profiling. I think my original email should make it abundantly clear on which side _I_ fall on this issue. :-) In fact, I've been known to (gasp! horror!) deploy applications into production with -g enabled in order to be able to actually turn on with java debugging enabled and remote debug the application (on an unactive node, of course) in the production environment. I've heard of people who just start their app servers with JDWP enabled all the time for this reason, but I've never actually met one. :-) In short, I've found that trying to save micro-amounts of time here and there in an application at the expense of debuggability and maintainability usually end up with a bad application that's also slow. Java enterprise/web applications are so seldom, in my experience, performance limited by the actual Java bytecode execution speed, as to make optimizing for that virtually irrelevant. There are so many other places to start optimizing rather than worrying about 5ns here and 5ns there, particularly before you go into production and know that you aren't suitably performant. Kirk Wylie M7 Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getServletContext() throws null pointer
Oliver, In the last email I sent, I should have asked if you overrode the init(ServletConfig) method in the servlet that is having the null pointer exception, not your init servlet. -Richard --- Oliver Meyn [EMAIL PROTECTED] wrote: Hi, I've put an object into the ServletContext with an init servlet started on load via web.xml. Accessing it with my main Action works fine, but when I try to use another servlet (extend HttpServlet) to getServletContext() it throws a null pointer exception (doesn't just return null - goes straight to the exception). From the javadoc on ServletContext I'm led to believe that all servlets in the app share the same ServletContext, so I'm confused. I'm attempting this lookup in the constructor of the servlet - does it have to happen in a doGet or such? Any ideas? Also, is there some way of accessing the ServletContext without being a Servlet? Thanks very much, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JavaScript validation of indexed properties
Hello, I'm using Struts 1.1, and I have a jsp that is using indexed fields that I need to validate using javascript. It seems as though the struts validator just ignores javascript validations on my fields completely! For example, if it is the only field that uses a particular validator, say integer, an IntegerValidations() javascript initializer function is generated, but it has no content. Is there anyway to do javascript validation with the struts validator? Other javascript validations work properly. I can write a custom validator if that would work, but I'd rather not if I don't have to. Thanks, Andy Here's the relevant form definition from struts-config: form-bean name=SubscriptionForm type=org.apache.struts.action.DynaActionForm ... form-property name=subscriptionDetails type=java.util.Vector/ ... /form-bean And the jsp section: logic:iterate id=line name=SubscriptionForm property=subscriptionDetails tr align=left tdbean:write name=line property=location.locationName//td td/td td class=formDataRequiredhtml:text name=line property=safetyMinQty indexed=true size=6//td td /td td class=formDataRequiredhtml:text name=line property=safetyMaxQty indexed=true size=6//td td/td td class=formDataRequiredhtml:text name=line property=allocatedMinQty indexed=true size=6//td td/td td class=formDataRequiredhtml:text name=line property=allocatedMaxQty indexed=true size=6//td /tr /logic:iterate And the validation rules: form name=SubscriptionForm ... field property=safetyMinQty indexedListProperty=line depends=required arg0 key=SubscriptionForm.subscriptionDetails.displayname/ /field /form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: deployment environment
struts wrote: Hi, I have an intranet application created locally struts framework, tomcat/with a sybase database. I want to distribute to the intranet sites of other users. So basically I need to install tomcat, JDK, .war and the database engine. So my question... What is the best way to install this all at other places ? Install everything seperately ? Or using a Wise, or installshield program ? And what if there is allready a JDK installed ? or somebody has another idea... ? If you're willing to spend the time, effort, and money, InstallAnywhere has great facilities for dealing with all this, and is pretty easy to learn for a simple installation to boot: http://www.zerog.com/products_ia.html But if you already have administrators at the remote site who know what they're doing (or you have someone to be remote hands for you) it might just be easier to send them a WAR file with a list of requirements, and let them go to work. Kirk Wylie M7 Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When HashMap will replace ActionForm ?
As mentioned, you can use a map-backed ActionForm to store whatever fields you need without defining them elsewhere. http://tinyurl.com/ymkr You do need to code the forms a little differently, and your forms still need to know what properties/entries to ask for. Personally, I would strongly recommnend using DynaActionForms. The overhead of defining the elements in the configuration is negligable in practice, and it clearly defines which properties are used with which forms. In practice, what really costs projects time is miscommunication. For example, is the entry name in the Map userName or username? With DynaActionForms all the entry names are documented in the configuration. Otherwise, you will have to document them elsewhere and redo what has already been done. I *am* a big fan of using Maps for Contexts, especially between application layers, and with the Commons Chain influence, we're sure to see more of that. The thing about DynaActionForms is that you get the agility of a Map with the documentation of a JavaBean. HTH, Ted. Antony Paul wrote: but it prints the form field name like this map(username). I want to get the key as name of form field. here username. possible ? rgds Antony Paul. - Original Message - From: Fullam, Jonathan [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 7:30 PM Subject: RE: When HashMap will replace ActionForm ? That's where a map-backed Hashmap is useful. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 6:02 AM To: Struts Users Mailing List Subject: Re: When HashMap will replace ActionForm ? I know that but one have to define 10 to 30 elements in struts-config.xml for that. With a hash map one have to say whether it is needed ot not. It could be accessed like DynaValidator form. And my requirement is to store simple text field values. rgds Antony Paul. - Original Message - From: Kalra, Ashwani [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 4:05 PM Subject: RE: When HashMap will replace ActionForm ? DynaValidator forms stores data in Hashmap internally if you dont want to define norma action forms. -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:40 PM To: struts Subject: When HashMap will replace ActionForm ? Hi, Is there any move to support HashMap in place of ActionForm ?. I dont want to start any argument. I have read a lot on ActionForm in this archive. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorised to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic tag using locale
All, I'm trying to do a bean:write based on the user's current language. Before you ask, this isn't just internationalization using the properties files. I'm displaying item attributes stored in a database, where there are german and english descriptions. I know I can set a bean in my action and access the tag like so: request.setAttribute(currentLanguage, getLocale(request).getLanguage()); logic:equal name=currentLanguage value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal logic:equal name=currentLanguage value=de bean:write name=product property=specialFeaturesDE ignore=true / /logic:equal is there a bean for locale by default which removes the need to set the currentLanguage bean I have above? something like: logic:equal name=userlocale value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal Are there any special beans which have default names? Any help is appreciated. cheers, Fred _ This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing. If this email contains an offer, that should be considered as an invitation to treat. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation: Problem with datePattern and JavaScript
It looks like the following line of code (in the date validator rule in validator-rules.xml) loads the pattern: var datePattern = oDate[x][2](datePatternStrict); As far as I can tell, nothing is ever loaded for plain datePattern, and this matches up with my experiences of using datePattern (i.e. datePattern doesn't do any validation at all) I haven't tried this, but it should probably be an easy fix to check if oDate[x][2](datePattern) has a value and load that into datePattern. -Andy -Original Message- From: Zakaria khabot [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 10, 2002 12:00 PM To: Struts Users Mailing List Subject: Re: Validation: Problem with datePattern and JavaScript Hi, Do u have an example of using validate-rules.xml in a JSP file. Thanks - Original Message - From: Rouven Gehm [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, December 04, 2003 1:53 PM Subject: Validation: Problem with datePattern and JavaScript I want to know if someone has updated the javascript code in the validate-rules.xml, for the datePattern option ? Because the code i have from the Struts 1.1 zip only work with datePatternStrict !!! I have searched the user mailing list, for this problem, but not found any solution. Thanx Rouven - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamically sized form (mostly solved)
I apologize in advance if this comes through twice. Our email server was having issues this morning, so I'm resending it in case it didn't make it out the first time. Thanks! I am attempting to do something similar to what has been posted here in the current Struts application that I'm working on. I'm using a DynaValidatorForm in request scope, iterating through a dynamically generated ArrayList that I've put into the DynaValidatorForm, and then attempting to pass it through request scope using indexed properties. The page displays perfectly, but when I try to submit it, I get the following error: [Servlet Error]-[BeanUtils.populate]: java.lang.NullPointerException: No indexed value for 'inventoryList[0]' at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:293) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:474) Here are some snippets of code: From the ActionClass that populates the .JSP: ArrayList itemRanges = itemCDTO.getItemRanges(); //returns an ArrayList of ItemRange beans form.set(inventoryList, itemRanges); From struts-config.xml: form-bean name=inventoryModifyForm type=org.apache.struts.validator.DynaValidatorForm form-property name=page type=java.lang.Integer / form-property name=submit type=java.lang.String / form-property name=rangeStart type=java.lang.String / form-property name=rangeEnd type=java.lang.String / form-property name=inventoryList type=java.util.ArrayList / form-property name=description type=java.lang.String / /form-bean action path=/inventoryModify type=gov.dor.fastr.action.inventory.InventoryModifyAction name=inventoryModifyForm scope=request input=inventory.modify validate=false forward name=cancelled path=inventory.cancelled / forward name=page2 path=inventory.modify2 / /action From the JSP: logic:iterate id=inventoryList name=inventoryModifyForm property=inventoryList tr td html:text indexed=true name=inventoryList property=startNumber / html:text indexed=true name=inventoryList property=endNumber / /td /tr /logic:iterate An interesting thing I noticed when I change the code in the JSP like this: logic:iterate id=iList name=inventoryModifyForm property=inventoryList tr td html:text indexed=true name=iList property=startNumber / html:text indexed=true name=iList property=endNumber / /td /tr /logic:iterate then I don't get the error. But of course, when I do an (ArrayList) form.get(inventoryList), it returns an empty List to the Action class. I can, however, bypass the DynaValidatorForm and directly query the HttpServletRequest object and pull the individual components by doing a request.getParameter(iList[0].startNumber), which is extremely clunky. I'm sure I must be missing something stupid. If anyone can shed some light, it would be greatly appreciated. Thanks so much! Brent -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED]] Sent: Friday, November 21, 2003 4:23 PM To: 'Struts Users Mailing List' Subject: RE: dynamically sized form (mostly solved) Matt, You actually only need the form in the request. You don't need the property of the form at all in your JSP. In my JSP I use html:form action=/indexTestSubmitAction logic:iterate id=testBean name=dynaIndexTestForm property=tests indexId=ctr html:text name=testBean property=id /br html:text name=testBean property=amount /br html:text name=testBean property=name/ /logic:iterate html:submit value=Update/ /html:form In struts-config.xml I have this form-beans form-bean name=dynaIndexTestForm type=org.apache.struts.action.DynaActionForm form-property name=tests type=mil.osd.dmdc.deers.tests.beans.TestBean[]/ /form-bean /form-beans action-mappings action path=/indexTestSubmitAction type=mil.osd.dmdc.deers.apps.test.actions.TestAction name=dynaIndexTestForm scope=request input=/loginSucceeded.jsp forward name=success path=/succeeded.jsp redirect=false/ /action /action-mappings -Richard -Original Message- From: Matt Bathje [mailto:[EMAIL PROTECTED]] Sent: Friday, November 21, 2003 2:17 PM To: Struts Users Mailing List Subject: Re: dynamically sized form (mostly solved) I found out that using new DynaActionForm()inside of the PreLoaderAction.execute() doesn't work. It gives a null pointer exception when you try and call the set() method. You need to do this instead: FormBeanConfig cfg = mapping.getModuleConfig() .findFormBeanConfig(dynaIndexTestForm); DynaActionForm myForm; Richard - this was the last piece of the puzzle for me, now it works without having to supply the name=form on the preloader action...sweet. Mark - I have had it working both ways now, in session and request. If you want to do it in request you have to have 2 request objects in your preload. The first is the form itself, and the second is the property for the form (which is what you actually loop through in your jsp) I will probably use the request scope myself just because I try to stay
Re: 'Module scoped' variables
On Dec 10, 2003, at 10:47 AM, Fullam, Jonathan wrote: Yes. I actually thought of that issue after I replied to you. Another option you can look into is subclassing the ControllerConfig class and specify your new Config class in the className attribute of the controller element in each of your modules. You could then build in the functionality to configure extra module-scoped variable. I think you could do it more simply. In org.apache.struts.util.RequestUtils, there's this method: public static String getModuleName(HttpServletRequest request, ServletContext context) { return ModuleUtils.getInstance().getModuleName(request, context); } So now, in any situation where you have a request and a servlet context, you can look up the current module name. Using this, you can construct unique names for things stored in the application (servlet) context. This is what Struts does, of course. Depending on what's easiest for you, you can locate this expertise anyplace. The simplest would probably be in a method in a subclass of org.apache.struts.action.Action which you would then subclass for all of your application methods. Then write a couple of methods like public Object getModuleAttribute(HttpServletRequest request, String name) public void setModuleAttribute(HttpServletRequest request, String name, Object attr) and inside those methods, use RequestUtils to lookup the module name, and then lookup a java.util.Map under a well-known name like {module}/MODULE_CONTEXT_MAP and... there you have it. It's a little bit oblique, but then Modules were kind of retrofitted into the Struts structure. This could probably be made easier in future releases if people had ideas, or even better, patches to the source code! Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com We want beef in dessert if we can get it there. -- Betty Hogan, Director of New Product Development, National Cattlemen's Beef Association smime.p7s Description: S/MIME cryptographic signature
RE: .do's come back as 404 file not found
I have concluded that it is not a struts problem.. My application server is doing some wrong. 404 is being sent my Apache, and not my Application Server. Apache sits in front of the application server. So my application server is not notifying apache that requests for *.do should come to the app server also... Just wanted to let everyone know. My app server is resin-2.1.11 I will go to resin mailing list and see what they gotta say... Thanks.. Pritpal Dhaliwal -Original Message- From: Dhaliwal, Pritpal (HQP) [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 9:48 AM To: [EMAIL PROTECTED] Subject: RE: .do's come back as 404 file not found All ritey... Time to bring up my good ol eclipse debugger.. It would be verrryyy nice if others can tell me about SUCH experiences with struts.. And what they tried to resolve.. It would help me out in debugging this.. Thanks for the responses guys.. Paul Dhaliwal -Original Message- From: ajay brar [mailto:[EMAIL PROTECTED] Sent: Saturday, December 06, 2003 1:29 AM To: [EMAIL PROTECTED] Subject: RE: .do's come back as 404 file not found hi! i had the same problem with my tomcat, and this happened only on my online account and not on my home pc. The app worked fine earlier and then suddenly stopped working for all the .do actions. And then again sometimes it would work fine. However i could never find the problem. so post up if you do find the problem. Ajay From: Dhaliwal, Pritpal (HQP) [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: .do's come back as 404 file not found Date: Fri, 5 Dec 2003 14:15:24 -0800 Hello Joe, Its maps to *.do Remember that same conf worked like a charm two days ago :) Same conf is also working in another setting. TIA, Paul -Original Message- From: Joe Hertz [mailto:[EMAIL PROTECTED] Sent: Friday, December 05, 2003 11:46 AM To: 'Struts Users Mailing List' Subject: RE: .do's come back as 404 file not found What's the url pattern for your action servlet defined in web.xml? -Original Message- From: Dhaliwal, Pritpal (HQP) [mailto:[EMAIL PROTECTED] Sent: Friday, December 05, 2003 1:48 PM To: Struts Users Mailing List Subject: .do's come back as 404 file not found Hello Everyone, I am using: Struts and Resin 2.1.11 All of sudden my index.do, or any other .do is not being recognized by resin anymore. It was working fine two days ago, all of sudden I am getting 404s In the logs I see that its picking up the correct struts-config.xml and it is that ActionServlet runs its init function.. So has anyone seen it before, is it generally app server problem or I could have messed something up in struts also? TIA, Paul Dhaliwal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getServletContext() throws null pointer
On Wed, 2003-12-10 at 12:50, Claire Wall wrote: as i understand it, in order to retrieve the servlet context, you need to use the ServletConfig to retrieve it like so: config.getServletContext() this sounds similar to a problem that i had where i was trying to log something from a servlet, just used the log() method and it through an exception pretty much like the one you are experiencing. however, by putting config.getServletContext().log() it threw no exceptions... Hmm. It appears that the ServletConfig is only accessible to the init() of a given servlet. Within the init() I can getServletConfig() and it appears not to be null, and I can getServletConfig.getServletContext() but that IS null. So no exception but a null context that leaves me in about the same boat. Calling getServletContext() directly within the init() also gives me null. This happens with and without a call to super.init(). This can't be that hard. Is there some extra step to tying an arbitrary servlet to a webapp context apart from calling it from within that context (eg Action within context calls the new servlet)? Thanks, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getServletContext() throws null pointer
On Wed, 2003-12-10 at 12:55, Richard Yee wrote: Oliver, In the last email I sent, I should have asked if you overrode the init(ServletConfig) method in the servlet that is having the null pointer exception, not your init servlet. Oh I see - sorry but before testing Claire's hypothesis I hadn't touched the init() methods. Thanks, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Incompatibility between STRUTS TAGS and JSTL TAGS
Am Mittwoch, 10. Dezember 2003 17:57 schrieb Todor Sergueev Petkov: When I try JSTL c:out value=${requestScope.source}/ c:out value=${requestScope.animalId}/ c:out value=${requestScope.injId}/ doesn't work... The above code looks for *attributes* in request scope, not parameters. To access parameters via JSTL, you have to make use of the implicit EL variable (actually a java.util.Map) named 'param', like this: c:out value=${param.source}/ c:out value=${param.animalId}/ c:out value=${param.injId}/ HTH, -- Chris. The names of the the request parameters that should be there are correct... Is there any masking between JSTL vars and STRUTS vars that someone is aware of? Todor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session.invalidate() throws exception.
so you call invalidate() Causes this representation of the session to be invalidated and removed from its context. then you call get on the invalidated session.. Reminds me of the construction worker who said no matter how many times I cut this it's still too short.. Think about it.. -Martin - Original Message - From: Antony Paul [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 7:35 AM Subject: Re: session.invalidate() throws exception. A sample code is given. Using Tomcat 4.1.27. Struts 1.1 I think downloaded on june 03. %@ taglib uri=/WEB-INF/struts-html.tld prefix=html% %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean% %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic% % session.invalidate(); % html:form action=/LoginAction onsubmit=return validateLoginForm(this) /html:form The error statck is given in first message. rgds Antony Paul. - Original Message - From: Gurpreet Dhanoa [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:36 PM Subject: Re: session.invalidate() throws exception. hi Antony Can you please briefly explaing the scope and the error Thanks Gary - Original Message - From: Antony Paul [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:30 PM Subject: Re: session.invalidate() throws exception. Then index.jsp is to be mapped to an action in web.xml. My situation is user goes to another site then returns to home page of our application. rgds Antony Paul. - Original Message - From: Raman Garg [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:05 PM Subject: Re: session.invalidate() throws exception. Hello Antony Here is a sample of code, hopes this solves your problem... public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes and/or parameters we will need Locale locale = getLocale(request); MessageResources messages = getResources(request); HttpSession session = request.getSession(); // Get already logged user info from session scope // We have a Customer Bean in session Customer customer = (Customer)session.getAttribute(USER_KEY); // If customer has not logged in, return control to User Login view with // that reason. if (customer == null) { return new ActionForward(/Login.do?reason= + LOGIN_REASON_NOT_LOGGED_IN, true); } } -- Raman - Original Message - From: Antony Paul [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:08 PM Subject: session.invalidate() throws exception. Hi, Calling session.invalidate() in index.jsp throws this exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a:954) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java:171) at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) How to change this behavior. Better if possible to do some house keeping before invalidating session like if a valid session and data is present in session then go to a certain page. rgds Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: logic tag using locale
I'd suggest resolving this type of language choice in the Action. For example, there could be one product bean that is populated with whatever language is preferred by the client. The page could then just write whatever has been placed into the bean. HTH, Ted. Tsang, F (Fred) wrote: All, I'm trying to do a bean:write based on the user's current language. Before you ask, this isn't just internationalization using the properties files. I'm displaying item attributes stored in a database, where there are german and english descriptions. I know I can set a bean in my action and access the tag like so: request.setAttribute(currentLanguage, getLocale(request).getLanguage()); logic:equal name=currentLanguage value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal logic:equal name=currentLanguage value=de bean:write name=product property=specialFeaturesDE ignore=true / /logic:equal is there a bean for locale by default which removes the need to set the currentLanguage bean I have above? something like: logic:equal name=userlocale value=en bean:write name=product property=specialFeatures ignore=true / /logic:equal Are there any special beans which have default names? Any help is appreciated. cheers, Fred _ This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing. If this email contains an offer, that should be considered as an invitation to treat. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamically sized form (mostly solved)
The reason you get the null pointer exception is that the inventoryList property in your DynaActionForm is created empty. The exception occurs when Struts tries to populate inventoryList[0].startNumber or inventoryList[0].endNumber. Even though I haven't used the DynaActionForm, I know that it will have the same limitations/requirements for populating indexed properties as an ActionForm. I know that some folks use a LazyList for processing their indexed properties. Perhaps that will help you. The reason you don't get the exception with the name iList is that struts makes no attempt to populate the ArrayList in your DynaActionForm. Can't provide an answer...but I can see the why to your problem Nick Nifty Music [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: 12/10/2003 01:33 Subject: RE: dynamically sized form (mostly solved) PM Please respond to Struts Users Mailing List I apologize in advance if this comes through twice. Our email server was having issues this morning, so I'm resending it in case it didn't make it out the first time. Thanks! I am attempting to do something similar to what has been posted here in the current Struts application that I'm working on. I'm using a DynaValidatorForm in request scope, iterating through a dynamically generated ArrayList that I've put into the DynaValidatorForm, and then attempting to pass it through request scope using indexed properties. The page displays perfectly, but when I try to submit it, I get the following error: [Servlet Error]-[BeanUtils.populate]: java.lang.NullPointerException: No indexed value for 'inventoryList[0]' at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:293) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:474) Here are some snippets of code: From the ActionClass that populates the .JSP: ArrayList itemRanges = itemCDTO.getItemRanges(); //returns an ArrayList of ItemRange beans form.set(inventoryList, itemRanges); From struts-config.xml: form-bean name=inventoryModifyForm type =org.apache.struts.validator.DynaValidatorForm form-property name=page type=java.lang.Integer / form-property name=submit type=java.lang.String / form-property name=rangeStart type=java.lang.String / form-property name=rangeEnd type=java.lang.String / form-property name=inventoryList type=java.util.ArrayList / form-property name=description type=java.lang.String / /form-bean action path=/inventoryModify type=gov.dor.fastr.action.inventory.InventoryModifyAction name=inventoryModifyForm scope=request input=inventory.modify validate=false forward name=cancelled path=inventory.cancelled / forward name=page2 path=inventory.modify2 / /action From the JSP: logic:iterate id=inventoryList name=inventoryModifyForm property =inventoryList tr td html:text indexed=true name=inventoryList property=startNumber / html:text indexed=true name=inventoryList property=endNumber / /td /tr /logic:iterate An interesting thing I noticed when I change the code in the JSP like this: logic:iterate id=iList name=inventoryModifyForm property =inventoryList tr td html:text indexed=true name=iList property=startNumber / html:text indexed=true name=iList property=endNumber / /td /tr /logic:iterate then I don't get the error. But of course, when I do an (ArrayList) form.get(inventoryList), it returns an empty List to the Action class. I can, however, bypass the DynaValidatorForm and directly query the HttpServletRequest object and pull the individual components by doing a request.getParameter(iList[0].startNumber), which is extremely clunky. I'm sure I must be missing something stupid. If anyone can shed some light, it would
Re: Tag for adding no-cache header.
Am Mittwoch, 10. Dezember 2003 18:30 schrieb Trieu, Danny: If I remember correctly, I think the request processor did exactly what you did on 2. And I think (1) approach is better and it consistent with MVC. Just make sure that all of your request will go through the FrontController then all of your response will have it header set with no-cache. --danny AFAIK Struts issues only the 'standard three' set of NoCache directions, so the IE extensions are not there. The same is true for the endless list of cache control headers when proxies come into play. The details are laid out in RFC 2616 (Section 13, p. 108ff.), if you're after some pretty dry reading stuff. Don't know if this is really necessary, but just to make sure, I also have a 'proxy-revalidate' attribute in my Cache-control headers and usually use a custom tag for such things. The reason behind is not so much because Struts doesn't work (it works fine, actually), but because of the fact that setting the nocache attribute is an all-or-nothing solution, and not all 'dynamic' pages, in particular the ones consisting of more or less static text, really change that often and therefore may safely be cached for performance reasons. Then, I somewhat suspect that cache control headers *might* confuse caching web spiders like the GoogleBot. Using Tiles anyway, I usually put the tag in the master template for the non-cachable parts and then just forget about it. YMMV. -- Chris. NB. Another option is using a filter for cache control, enabling one to forbid caching only for certain paths. Recent Resin versions have some interesting options in this direction, but I never actually tried them out yet. Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] (949) 509-4564 -- CLIP! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tabbed menus using Tiles
Hi All, I am presently designing a web application, and curious to learn whether there is any way we can create and use the tabbed menus using Struts libraries. We have chosen tiles for the layout design already. I appreciate any help. cheers gopal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tabbed menus using Tiles
Look into using the struts-menu libraries. It contains tabbed menus. http://raibledesigns.com/wiki/Wiki.jsp?page=StrutsMenu -Jonathan -Original Message- From: Gopal Venkata Achi [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 3:36 PM To: Struts Users Mailing List Subject: Tabbed menus using Tiles Hi All, I am presently designing a web application, and curious to learn whether there is any way we can create and use the tabbed menus using Struts libraries. We have chosen tiles for the layout design already. I appreciate any help. cheers gopal
Re: Tabbed menus using Tiles
Here is a simple code to create tabbed menus. I guess it's easy to convert it to Tiles. Just create a new JSP page and drop this code on it. html head titleDaily Data Survey/title style .tab{ color: navy; background-color: white; border-top: 1px solid navy; border-bottom: 0px solid navy; border-left: 1px solid navy; border-right: 1px solid navy; position: absolute; top: 12; width: 140; text-align: center; font: 9pt Verdana,sans-serif; z-index: 1; padding: 3; cursor: pointer; cursor: hand; } .panel{ position: absolute; background: ff; top: 32; left: 10; width: 600; z-index: 2; height: 85%; visibility: hidden; font: 12pt Verdana,sans-serif; color: navy; border: 1px solid navy; padding: 10; overflow: auto; } /style script language=_javascript_ var currentPanel; function showPanel(panelNum){ //hide visible panel, show selected panel, set tab if (currentPanel != null) { hidePanel(); } document.getElementById('panel'+panelNum).style.visibility = 'visible'; currentPanel = panelNum; setState(panelNum); } function hidePanel(){ //hide visible panel, unhilite tab document.getElementById('panel'+currentPanel).style.visibility = 'hidden'; document.getElementById('tab'+currentPanel).style.backgroundColor = '#ff'; document.getElementById('tab'+currentPanel).style.color = 'navy'; document.getElementById('tab'+currentPanel).style.zIndex = '1'; } function setState(tabNum){ if(tabNum==currentPanel){ document.getElementById('tab'+tabNum).style.backgroundColor = '#ff'; document.getElementById('tab'+tabNum).style.color = 'red'; /* document.getElementById('tab'+tabNum).style.BorderBottomStyle = 'solid'; document.getElementById('tab'+tabNum).style.BorderBottomWidth = '0px'; document.getElementById('tab'+tabNum).style.BorderBottomColor = 'Navy'; */ document.getElementById('tab'+tabNum).style.zIndex = '3'; }else{ document.getElementById('tab'+tabNum).style.backgroundColor = '#ff'; document.getElementById('tab'+tabNum).style.color = 'navy'; document.getElementById('tab'+tabNum).style.zIndex = '1'; } } function hover(tab){ tab.style.backgroundColor = 'ff'; } /script /head body > div id=tab1 class=tab style=left: 10; > Tab One/div div id=tab2 class=tab style=left: 149; > Tab Two/div div id=tab3 class=tab style=left: 288; > Tab Three/div div id=panel1 class=panelPanel 1/div div id=panel2 class=panelPanel 2/div div id=panel3 class=panelPanel 3/div /body /html ---BeginMessage--- Hi All, I am presently designing a web application, and curious to learn whether there is any way we can create and use the tabbed menus using Struts libraries. We have chosen tiles for the layout design already. I appreciate any help. cheers gopal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]---End Message--- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamically sized form (mostly solved)
Nicholas, What you said definitely makes sense to me. Richard graciously replied off-list with a similar response. I remember reading documentation which stated that when using dynamic arrays with DynaForms, it is necessary to place the DynaForm in session scope. However, I 'm almost positive that someone (Matt? Mark?) mentioned on this list that they were able to pass an ArrayList through a DynaForm in request scope. For a variety of reasons, I'm not too eager to put the entire formbean in the session for the sake of propogating one ArrayList attribute. If Matt or Mark or anyone else has some insights to share regarding how they were able to get this to work in request scope, I'd be very grateful to hear. Thanks again, Brent - Original Message - From: Nicholas L Mohler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:07 PM Subject: RE: dynamically sized form (mostly solved) The reason you get the null pointer exception is that the inventoryList property in your DynaActionForm is created empty. The exception occurs when Struts tries to populate inventoryList[0].startNumber or inventoryList[0].endNumber. Even though I haven't used the DynaActionForm, I know that it will have the same limitations/requirements for populating indexed properties as an ActionForm. I know that some folks use a LazyList for processing their indexed properties. Perhaps that will help you. The reason you don't get the exception with the name iList is that struts makes no attempt to populate the ArrayList in your DynaActionForm. Can't provide an answer...but I can see the why to your problem Nick Nifty Music [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: 12/10/2003 01:33 Subject: RE: dynamically sized form (mostly solved) PM Please respond to Struts Users Mailing List I apologize in advance if this comes through twice. Our email server was having issues this morning, so I'm resending it in case it didn't make it out the first time. Thanks! I am attempting to do something similar to what has been posted here in the current Struts application that I'm working on. I'm using a DynaValidatorForm in request scope, iterating through a dynamically generated ArrayList that I've put into the DynaValidatorForm, and then attempting to pass it through request scope using indexed properties. The page displays perfectly, but when I try to submit it, I get the following error: [Servlet Error]-[BeanUtils.populate]: java.lang.NullPointerException: No indexed value for 'inventoryList[0]' at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:293) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:474) Here are some snippets of code: From the ActionClass that populates the .JSP: ArrayList itemRanges = itemCDTO.getItemRanges(); //returns an ArrayList of ItemRange beans form.set(inventoryList, itemRanges); From struts-config.xml: form-bean name=inventoryModifyForm type =org.apache.struts.validator.DynaValidatorForm form-property name=page type=java.lang.Integer / form-property name=submit type=java.lang.String / form-property name=rangeStart type=java.lang.String / form-property name=rangeEnd type=java.lang.String / form-property name=inventoryList type=java.util.ArrayList / form-property name=description type=java.lang.String / /form-bean action path=/inventoryModify type=gov.dor.fastr.action.inventory.InventoryModifyAction name=inventoryModifyForm scope=request input=inventory.modify validate=false forward name=cancelled path=inventory.cancelled / forward name=page2 path=inventory.modify2 / /action From the JSP:
Re: Tag for adding no-cache header.
On 12/10/2003 09:18 PM Christian Bollmeyer wrote: AFAIK Struts issues only the 'standard three' set of NoCache directions, so the IE extensions are not there. The same is true from wget -S 3 Pragma: No-cache 4 Cache-Control: no-cache 5 Expires: Thu, 01 Jan 1970 00:00:00 GMT Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamically sized form (mostly solved)
I thought it worked, but it didn't. -Richard -Original Message- From: Nifty Music [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 1:02 PM To: [EMAIL PROTECTED] Subject: RE: dynamically sized form (mostly solved) Nicholas, What you said definitely makes sense to me. Richard graciously replied off-list with a similar response. I remember reading documentation which stated that when using dynamic arrays with DynaForms, it is necessary to place the DynaForm in session scope. However, I 'm almost positive that someone (Matt? Mark?) mentioned on this list that they were able to pass an ArrayList through a DynaForm in request scope. For a variety of reasons, I'm not too eager to put the entire formbean in the session for the sake of propogating one ArrayList attribute. If Matt or Mark or anyone else has some insights to share regarding how they were able to get this to work in request scope, I'd be very grateful to hear. Thanks again, Brent - Original Message - From: Nicholas L Mohler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 2:07 PM Subject: RE: dynamically sized form (mostly solved) The reason you get the null pointer exception is that the inventoryList property in your DynaActionForm is created empty. The exception occurs when Struts tries to populate inventoryList[0].startNumber or inventoryList[0].endNumber. Even though I haven't used the DynaActionForm, I know that it will have the same limitations/requirements for populating indexed properties as an ActionForm. I know that some folks use a LazyList for processing their indexed properties. Perhaps that will help you. The reason you don't get the exception with the name iList is that struts makes no attempt to populate the ArrayList in your DynaActionForm. Can't provide an answer...but I can see the why to your problem Nick Nifty Music [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: 12/10/2003 01:33 Subject: RE: dynamically sized form (mostly solved) PM Please respond to Struts Users Mailing List I apologize in advance if this comes through twice. Our email server was having issues this morning, so I'm resending it in case it didn't make it out the first time. Thanks! I am attempting to do something similar to what has been posted here in the current Struts application that I'm working on. I'm using a DynaValidatorForm in request scope, iterating through a dynamically generated ArrayList that I've put into the DynaValidatorForm, and then attempting to pass it through request scope using indexed properties. The page displays perfectly, but when I try to submit it, I get the following error: [Servlet Error]-[BeanUtils.populate]: java.lang.NullPointerException: No indexed value for 'inventoryList[0]' at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:293) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils. java:474) Here are some snippets of code: From the ActionClass that populates the .JSP: ArrayList itemRanges = itemCDTO.getItemRanges(); //returns an ArrayList of ItemRange beans form.set(inventoryList, itemRanges); From struts-config.xml: form-bean name=inventoryModifyForm type =org.apache.struts.validator.DynaValidatorForm form-property name=page type=java.lang.Integer / form-property name=submit type=java.lang.String / form-property name=rangeStart type=java.lang.String / form-property name=rangeEnd type=java.lang.String / form-property name=inventoryList type=java.util.ArrayList / form-property name=description type=java.lang.String / /form-bean action path=/inventoryModify type=gov.dor.fastr.action.inventory.InventoryModifyAction name=inventoryModifyForm scope=request input=inventory.modify validate=false forward name=cancelled path=inventory.cancelled / forward name=page2 path=inventory.modify2 / /action From the JSP: logic:iterate id=inventoryList name=inventoryModifyForm property =inventoryList tr td html:text indexed=true name=inventoryList property=startNumber / html:text indexed=true name=inventoryList property=endNumber / /td /tr /logic:iterate An interesting thing I noticed when I change the code in the JSP like this: