Re: Dropdown and a text box
Hi Anubhav for this you have to play along with both textfield and select show Select first and then provide a button for new entry very immediate to select and when he clicks it hide select and show text field.. i hope this must be in ur mind previously ... or may help you. abhijeet - Original Message - From: Gupta, Anubhav [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 3:46 AM Subject: Dropdown and a text box Hi, I wish to have an input filed in a form which is a drop down box, but the user can also type in a value if they do not want to select from the drop down box. I know I can use html:select for dropdown and html:text for text box. But I cannot figure out how to have an input text field in which you can type in (text box), or select a value from the drop down list. Thanks, Anubhav This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Declarative Security and Struts
On 11/18/2003 12:47 AM Michael Blair wrote: I have been able to get a MemoryRealm in Tomcat to work using BASIC authentication. If I try to do this with FORM based authentication it seems to think the ACTION=j_security_check in my login.jsp seems to make struts think this is an action that should be in the struts-config. I admit, I know very little about security. Any links for MemoryRealm and JDBCRealm using struts would be great! The goal is Memory first, then get it to work with JDBC. Mike, don't use an html:form taglib for the login page. Just use pure html and then struts won't try to get involved. Adam -- struts 1.1 + tomcat 5.0.12 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dropdown and a text box
hi anubhav Continuing previous mail rather than having Buttong along with select field add Doubleclick Event to both text field and select and hide each other on double click by checking the tpe of Object it is... abhijeet - Original Message - From: Abhijeet Mahalkar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 1:45 PM Subject: Re: Dropdown and a text box Hi Anubhav for this you have to play along with both textfield and select show Select first and then provide a button for new entry very immediate to select and when he clicks it hide select and show text field.. i hope this must be in ur mind previously ... or may help you. abhijeet - Original Message - From: Gupta, Anubhav [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 3:46 AM Subject: Dropdown and a text box Hi, I wish to have an input filed in a form which is a drop down box, but the user can also type in a value if they do not want to select from the drop down box. I know I can use html:select for dropdown and html:text for text box. But I cannot figure out how to have an input text field in which you can type in (text box), or select a value from the drop down list. Thanks, Anubhav This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - 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 problem...
I have this in my code: errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.key.invalid-value.dummy,keyname,value,expected); I have this in application.properties: error.key.invalid-value.dummy=DUMMY: key:{0} Value:{1} expected:{2} However, using html:errors/ in my page, the only thing that gets displayed is: DUMMY: key: Value: expected: i.e. the replacement values I give are swallowed. Any idea on what I am doing wrong? I tried calling new ActionError(..,a) where a is an Object[] with the values I want. This did not work either. I imagine I must be missing something obvious... Thanks for any hint... D. -- Dominique de Waleffe Email: [EMAIL PROTECTED] [No HTML please] Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium Phone: +32 2 757 10 15 Fax: +32 2 759 27 60 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionErrors problem...
This may be a copy/paste issue, but this shouldn't even compile as it looks here. You are missing a ) at the end. Dominique de Waleffe wrote: I have this in my code: errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.key.invalid-value.dummy,keyname,value,expected); I have this in application.properties: error.key.invalid-value.dummy=DUMMY: key:{0} Value:{1} expected:{2} However, using html:errors/ in my page, the only thing that gets displayed is: DUMMY: key: Value: expected: i.e. the replacement values I give are swallowed. Any idea on what I am doing wrong? I tried calling new ActionError(..,a) where a is an Object[] with the values I want. This did not work either. I imagine I must be missing something obvious... Thanks for any hint... D. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with modules and message resources
I have an application that has used bean:message for quite some time. I have had multiple struts-config files and each one defined message-resources that it needed. This all worked correctly I just changed my application to use Struts Modules. I confirmed that I have everything working correctly with tiles and my navigation, but when I use a bean:message tag that references a message-resource definition in one of the module config-files, I get an error stating that Cannot find message resources under key managementMessages Where managementMessages is the name of the key in the message-resources declaration The page being rendered is in the same Struts Module that the message-resource being requested is defined Also, If the bean:message tag references a message-resources in the default module, then it works correctly Anyone come across this before? I am ready to ditch modules if I cannot get this working. Thanks __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation occuring before form is loaded, why?
On 11/17/2003 08:04:21 PM Janice wrote: Hi Gang, I was having problems getting validation to work at all. I've read every post on getting it to work, followed all step-by-steps, and nothing would ever do it. Today I yanked all the .jar files out of my lib directory and updated it with the .jar files from the latest release version of struts (1.1). Well... something started to happen all right, just not what I expected. What it looks like its doing is validating my form before its even loaded (execute() does not get called, and my print statements in validate() show that super.validate() is returning errors.) What my code is trying to do is: 1) a list of widgets are displayed. Each widget has a link to an edit page. There is also an add widget option. Both the edit and the add call the same action with a request parameter like addEdit=add or addEdit=edit. Just keeping it simple, you've got something like this? displayWigetsAction (mapping validate=false) -- displayWigets.jsp user clicks add button or edit link -- setupAddEditAction (mapping validate=false) -- addEdit.jsp user submits form -- saveAddEditAction (mapping validate=true) Susan Currently, when either of these links are clicked, I get a 'page cannot be displayed' and my log tells me that there was a validation error. I don't know why validate() is being called in the first place, I have no explicit calls to it, and didn't expect it to get run until the next form was submitted and my struts-config.xml said validate=true. 2) the next step should be that the action builds the form object with either the reset() values for an add, or a database-retrieved set of values for an edit. Ideally, when this form is submitted, the form should be validated. If I change my validate() method on my form object to return a new ActionErrors(), then things work better, but still don't validate. I hope this is enough information. I can post a bunch of code if its not. I really appreciate any and all help, this validation stuff is taking s long to get working! Thanks in advance, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionErrors problem...
Brad Balmer wrote: This may be a copy/paste issue, but this shouldn't even compile as it looks here. You are missing a ) at the end. Cut-n-paste error. The code compiles. Only the replacements do not appear. When I put an extra placeholder {3} and give 3 args only, the {3} appears in the message. The {0} to {2} are swallowed... D. -- Dominique de Waleffe Email: [EMAIL PROTECTED] [No HTML please] Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium Phone: +32 2 757 10 15 Fax: +32 2 759 27 60 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionErrors problem...
On 11/18/2003 07:29:41 AM Dominique de Waleffe wrote: I have this in my code: errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.key.invalid-value.dummy,keyname,value,expected); Are keyname, value, expected evaluated or literal values? Do you mean to have the quotes around them? Can you print out the values in statements to make sure they are not blank values? Susan I have this in application.properties: error.key.invalid-value.dummy=DUMMY: key:{0} Value:{1} expected:{2} However, using html:errors/ in my page, the only thing that gets displayed is: DUMMY: key: Value: expected: i.e. the replacement values I give are swallowed. Any idea on what I am doing wrong? I tried calling new ActionError(..,a) where a is an Object[] with the values I want. This did not work either. I imagine I must be missing something obvious... Thanks for any hint... D. -- Dominique de Waleffe Email: [EMAIL PROTECTED] [No HTML please] Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium Phone: +32 2 757 10 15 Fax: +32 2 759 27 60 - 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: ActionErrors problem...
Susan Bradeen wrote: On 11/18/2003 07:29:41 AM Dominique de Waleffe wrote: I have this in my code: errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.key.invalid-value.dummy,keyname,value,expected); Are keyname, value, expected evaluated or literal values? Do you mean to have the quotes around them? Can you print out the values in statements to make sure they are not blank values? They are just String values I want to be included in my message... This was just a test to see if the thing works, I expect: DUMMY: key:keyname Value:value expected:expected Of course in the rest of the code I have other strings to put D. -- Dominique de Waleffe Email: [EMAIL PROTECTED] [No HTML please] Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium Phone: +32 2 757 10 15 Fax: +32 2 759 27 60 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
datavision and struts
Does anyone use datavision as reporting tool together with struts? any examples? thank you. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the Bank). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = =
Re: ActionErrors problem...
I've just made a little test writing DUMMY: key:keyname Value:value expected:expected in an html document.. and i got DUMMY: key: Value: expected: the problem is that is a special html symbol explorer thinks its an unknown tag and outputs nothing. if you look in the HTML source of your document, i think you'll see what you were expecting. to output , use lt; hope it helps Caroline Caroline LAUFERON Cap Gemini Telecom Media Networks France Skill Center VASN - RENNES 02 99 27 61 92 [EMAIL PROTECTED] - Original Message - From: Dominique de Waleffe [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 1:29 PM Subject: ActionErrors problem... I have this in my code: errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.key.invalid-value.dummy,keyname,value,expected ); I have this in application.properties: error.key.invalid-value.dummy=DUMMY: key:{0} Value:{1} expected:{2} However, using html:errors/ in my page, the only thing that gets displayed is: DUMMY: key: Value: expected: i.e. the replacement values I give are swallowed. Any idea on what I am doing wrong? I tried calling new ActionError(..,a) where a is an Object[] with the values I want. This did not work either. I imagine I must be missing something obvious... Thanks for any hint... D. -- Dominique de Waleffe Email: [EMAIL PROTECTED] [No HTML please] Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium Phone: +32 2 757 10 15 Fax: +32 2 759 27 60 - 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]
ModuleConfig Question
Hello all, I have been asked to create an Action that would dynamically modify struts-config.xml and ModuleConfig in order to avoid restarting the app server to read the new struts.config.xml. I did some research and looking at the code in the ModuleConfig implementation, it always checks the value of the configured flag, if it is set to true, no modification is allowed. My first question: is what I am trying to do possible?? if the answer is yes, how would I go about accomplishing it?? Here are my thoughts. First, I have to create my own implementation of ModuleConfig that allows modification after the initial setup. Next, I have to let struts use that implementation. That can probably be done by using the ModuleConfigFactory class. However, how do I make struts pass my class instead ofthe default implementation to the Factory?? I came across a message that mentioned something about adding a parameter to web.xml which specifies the implementation class for ModuleConfig but that is not in the current release. Any help/advice/insight into this will be greatly appreciated. Thanx. - Marwan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Different session handling between websphere and tomcat
Hi, I´m running Struts 1.1 with Tomcat 4.1.24 and also with Websphere (wsad) 5. I have a tiny application developed under wsad running fine under tomcat. When I try to deploy the same app to websphere I´m constantly getting nullpointer exception for the objects I try to pass from my action class to a jsp via the session (session.setAttibute()). After a search at google and list archives I found out that lots of guys seem to have kind a problem like this. It seems that in websphere I get a new session (I checked it with session.geId()) every time I call my jsp. The session I added my object to as a session attribute is not reachable anymore. I also detected that tomcat is passig the session id via the url like this: http://myserver:8080/myJsp.jsp;jsessionid=DSFSD98DFSDF... Websphere just calls: http://myserver:8080/myJsp.jsp I didn´t find a workaround for this problem yet! What is the recommended way of passing an object (not necessarily a bean, in my case a collection) from an action class to a jsp? Is this a configuration or an programming issue? Thanks and Regards, Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionErrors problem...
Caroline Lauferon wrote: I've just made a little test writing DUMMY: key:keyname Value:value expected:expected in an html document.. and i got DUMMY: key: Value: expected: the problem is that is a special html symbol explorer thinks its an unknown tag and outputs nothing. if you look in the HTML source of your document, i think you'll see what you were expecting. to output , use lt; Of course. Completely missed that one... I was really looking for something else..l Thanks a lot, D. -- Dominique de Waleffe Email: [EMAIL PROTECTED] [No HTML please] Mission Critical, Drève Richelle 161 Bât N, B-1410 Waterloo, Belgium Phone: +32 2 757 10 15 Fax: +32 2 759 27 60 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
running Struts with no network connection
Hi, I'm trying to run with no network connection, and I've set the init param validation to false. Yet Struts is looking for the Validator's DTD. Thanks for any help. -- Nick 95 [main] INFO validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validation.xml' 3130 [main] ERROR validator.ValidatorPlugIn - jakarta.apache.org java.net.UnknownHostException: jakarta.apache.org at java.net.InetAddress.getAllByName0(InetAddress.java:566) at java.net.InetAddress.getAllByName0(InetAddress.java:535) at java.net.InetAddress.getByName(InetAddress.java:444) at java.net.Socket.init(Socket.java:95) at sun.net.NetworkClient.doConnect(NetworkClient.java:45) at sun.net.www.http.HttpClient.openServer(HttpClient.java:330) at sun.net.www.http.HttpClient.openServer(HttpClient.java:516) at sun.net.www.http.HttpClient.init(HttpClient.java:266) at sun.net.www.http.HttpClient.init(HttpClient.java:276) at sun.net.www.http.HttpClient.New(HttpClient.java:288) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection .java:417) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java:510) at java.net.URL.openStream(URL.java:793) at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source) at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch( Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1302) at org.apache.commons.validator.ValidatorResourcesInitializer.initialize (ValidatorResourcesInitializer.java:256) at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl ugIn.java:222) at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java :161) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle t.java:1158) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper. java:935) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:82 3) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex t.java:3420) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3 608) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase .java:821) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:80 7) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep loyer.java:307) at org.apache.catalina.core.StandardHost.install(StandardHost.java:772) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j ava:559) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:401 ) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java :358) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:166) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196) at org.apache.catalina.core.StandardHost.start(StandardHost.java:738) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347 ) at org.apache.catalina.core.StandardService.start(StandardService.java:4 97) at org.apache.catalina.core.StandardServer.start(StandardServer.java:219 0) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=1/111 config=/Users/afshar/local/ jakarta-tomcat-4.1.24/conf/jk2.properties --
RE: Dropdown and a text box
Abhijeet, This kind of thing will work but we will have to tell the users to double click to enter the values. I have seen many dropdown lists in which when you click on the display area, you can write new values or click on arrow to the right to select a values from the list. I am not sure how to do that. Thanks, -Original Message- From: Abhijeet Mahalkar [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 4:14 AM To: Struts Users Mailing List; Abhijeet Mahalkar Subject: Re: Dropdown and a text box hi anubhav Continuing previous mail rather than having Buttong along with select field add Doubleclick Event to both text field and select and hide each other on double click by checking the tpe of Object it is... abhijeet - Original Message - From: Abhijeet Mahalkar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 1:45 PM Subject: Re: Dropdown and a text box Hi Anubhav for this you have to play along with both textfield and select show Select first and then provide a button for new entry very immediate to select and when he clicks it hide select and show text field.. i hope this must be in ur mind previously ... or may help you. abhijeet - Original Message - From: Gupta, Anubhav [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 3:46 AM Subject: Dropdown and a text box Hi, I wish to have an input filed in a form which is a drop down box, but the user can also type in a value if they do not want to select from the drop down box. I know I can use html:select for dropdown and html:text for text box. But I cannot figure out how to have an input text field in which you can type in (text box), or select a value from the drop down list. Thanks, Anubhav This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - 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 email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: datavision and struts
I use this: http://ireport.sourceforge.net .V [EMAIL PROTECTED] wrote: Does anyone use datavision as reporting tool together with struts? any examples? thank you. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the Bank). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Accessing a static final constant from Class in JSP
which tag do u use to access the constants from the class as I don't want to use JSP Scriplets??? Thanks, S! [EMAIL PROTECTED] 11/17/03 05:41PM Import the class in your jsp, then you can directly access it. %@ page import=GSOPConstants% -Original Message- From: Srinivas Kusunam [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 2:17 PM To: [EMAIL PROTECTED] Subject: Accessing a static final constant from Class in JSP Hi, I have a class called ProjConstants.java which is a static class with some static final constants here is the sample public class GSOPConstants{ public static final String LINK_EDIT = linkEdit; } How can I access this LINK_EDIT constant from JSP without using scriplets??? Any help appreciated. Regards, S! - 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]
jsp:include'd struts action closes stream, and thus breaks page
Hi, running Tomcat 4.1.27. I have the following JSP: jsp:include page=../database/list.do jsp:param name=dbid value=%=dbid%/ /jsp:include Whatever comes after the above, does not make it to the browser. Tomcat's log reports a closed stream: - Root Cause - java.io.IOException: Stream closed at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:239) at org.apache.jasper.runtime.JspWriterImpl.clearBuffer(JspWriterImpl.java:194) at org.apache.jsp.index_jsp._jspService(index_jsp.java:70) Any suggestions on why the stream gets closed? The action associated to list.do is trivial, and the page it forwards to, generates its output nicely, and thus makes it back to the original page via the include. But then things close. Any help greatly appreciated. Morten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using Tiles Definitions In Standard Links?
BDY.RTF Description: RTF file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Different session handling between websphere and tomcat
If you do not require the collection after the page is rendered, you could put it into request scope. This is what I do to populate listboxes, tables, etc.. That way they don't hang around any longer than they need to - they get used to render tha page, then get discarded. If you are using a DAO layer with caching (like iBATIS), the performance is great. Larry [EMAIL PROTECTED] 11/18/03 7:49 AM I didn´t find a workaround for this problem yet! What is the recommended way of passing an object (not necessarily a bean, in my case a collection) from an action class to a jsp? Is this a configuration or an programming issue? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Accessing a static final constant from Class in JSP
I don't think there is one, but maybe somone will educate me. ;-) Why not put this in ApplicationResources and then use the bean:message tag? Larry [EMAIL PROTECTED] 11/18/03 8:31 AM which tag do u use to access the constants from the class as I don't want to use JSP Scriplets??? Thanks, S! [EMAIL PROTECTED] 11/17/03 05:41PM Import the class in your jsp, then you can directly access it. %@ page import=GSOPConstants% -Original Message- From: Srinivas Kusunam [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 2:17 PM To: [EMAIL PROTECTED] Subject: Accessing a static final constant from Class in JSP Hi, I have a class called ProjConstants.java which is a static class with some static final constants here is the sample public class GSOPConstants{ public static final String LINK_EDIT = linkEdit; } How can I access this LINK_EDIT constant from JSP without using scriplets??? Any help appreciated. Regards, S! - 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: Does Struts-Menu work with J2EE 1.2 (servlet 2.2 and JSP 1.1) lev el container?
Nevermind. It's just a simple configuration issue. Got it resolved. -Original Message- From: Pingili, Madhupal Sent: Monday, November 17, 2003 1:51 PM To: 'Struts Users Mailing List' Subject: Does Struts-Menu work with J2EE 1.2 (servlet 2.2 and JSP 1.1) lev el container? Hi All, Can I use struts-menu on a J2EE 1.2 level container? I just saw on their website Dependencies section that it needs servletapi 2.3. I am getting following error while trying to use struts-menu (struts-menu.sourceforge.net) on WebSphere 4.0.4 AE (J2EE 1.2 level container): Servlet Error: The menu repository could not be found.: javax.servlet.jsp.JspException: The menu repository could not be found. at com.fgm.web.menu.displayer.taglib.UseMenuDisplayerTag.doStartTag(Unknown Source) If it works with J2EE 1.2 level conatiner, can you suggest a solution to the above problem? Thanks Reddy - 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]
html:link pass more then one paramater (no JSTL)
how can use this tag to pass more the one parameter, for example 4 parameter? With out use JSTL . Only Struts tag! How can I do?
Re: html:link pass more then one paramater (no JSTL)
This would be a fine place to look: http://jakarta.apache.org/struts/userGuide/struts-html.html#link Hint: If you prefer to specify a java.util.Map that contains all of the request parameters to be added to the hyperlink, ... Quoting Mauricio T. Ferraz [EMAIL PROTECTED]: how can use this tag to pass more the one parameter, for example 4 parameter? With out use JSTL . Only Struts tag! How can I do? -- 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: jsp:include'd struts action closes stream, and thus breaks page
I found that Tomcat bug 21440 regards this. Basically JSP included pages have direct access to the out stream, an naturally this is transparent to the included page, so the struts framework closes the out stream (prematurely seen in perspective of the including page). Any suggestions for alternative include mechanims? Any interesting taglibs out there that does this in a more predictable manner? Thanks, Morten Morten wrote: Hi, running Tomcat 4.1.27. I have the following JSP: jsp:include page=../database/list.do jsp:param name=dbid value=%=dbid%/ /jsp:include Whatever comes after the above, does not make it to the browser. Tomcat's log reports a closed stream: - Root Cause - java.io.IOException: Stream closed at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:239) at org.apache.jasper.runtime.JspWriterImpl.clearBuffer(JspWriterImpl.java:194) at org.apache.jsp.index_jsp._jspService(index_jsp.java:70) Any suggestions on why the stream gets closed? The action associated to list.do is trivial, and the page it forwards to, generates its output nicely, and thus makes it back to the original page via the include. But then things close. Any help greatly appreciated. Morten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Which framework to choose?
Hi all, Altough this might not be the right place to ask, but I'm just curious. Recently I see a lot of different frameworks which pretty much promise the same functionality as the Struts framework. For instance I found: struts webwork Spring etc... Which one is the best? I have been using Struts for some time now... But maybe some other framework has more future then Struts. I would like to hear your opionions... Thanks, Regards, Harm de Laat Informatiefabriek The Netherlands - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using Tiles Definitions In Standard Links?
I don't know if you can directly link to a tile, because the web container will still need a way to get to your tile from a URL. You might still need an action, but at least if you use the ForwardAction that comes with struts, you won't need to write one. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 9:36 AM To: [EMAIL PROTECTED] Subject: Using Tiles Definitions In Standard Links? Good morning, I am refactoring an application to use the Tiles interface. However, I do have one question: is it possible to create links in HTML/JSP pages to Tiles definitions without using an Action? I know that this is possible by using ActionForwards within an action, but what if I have a JSP made of one Tile definition that needs to have a link to a contact tile which is defined in the tiles-defs.xml? Do I need some sort of intermediary Action? Thanks, please let me know if my question is not very clear. John Pitchko Programmer/Analyst Downstream Marketing Systems - e-Business Group Shell Canada Limited (403)-691-2572 [EMAIL PROTECTED] __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link pass more then one paramater (no JSTL)
Kris, do you have any example to show me? How can I use this? I´d like to pass 3 parameter fixes and other parameter in a (java.util.Property) Is there a way to do it??? - Original Message - From: Kris Schneider [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:00 PM Subject: Re: html:link pass more then one paramater (no JSTL) This would be a fine place to look: http://jakarta.apache.org/struts/userGuide/struts-html.html#link Hint: If you prefer to specify a java.util.Map that contains all of the request parameters to be added to the hyperlink, ... Quoting Mauricio T. Ferraz [EMAIL PROTECTED]: how can use this tag to pass more the one parameter, for example 4 parameter? With out use JSTL . Only Struts tag! How can I do? -- 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]
RE: validation occuring before form is loaded, why?
Hi. 1.What version of struts are you working with ? 2.If the action map's validate attribute is set to true, the form.validate() method is called *before* the action is executed. If there are errors it will forward back to the input page (value of the input attribute). 3.To avoid having struts call validate for addEdit=add, you need to either (a) forward to a different action that has validate=false or (b) check the value of addEdit in your form and don't call the super unless its 'edit', or (c) use one action map for add and edit and another for submitting the changes (the latter is the one that should have validate=true). Note that you can have multiple actions can be mapped to the same action class. HTH, Rich -Original Message- From: Janice [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 8:04 PM To: [EMAIL PROTECTED] Subject: validation occuring before form is loaded, why? Hi Gang, I was having problems getting validation to work at all. I've read every post on getting it to work, followed all step-by-steps, and nothing would ever do it. Today I yanked all the .jar files out of my lib directory and updated it with the .jar files from the latest release version of struts (1.1). Well... something started to happen all right, just not what I expected. What it looks like its doing is validating my form before its even loaded (execute() does not get called, and my print statements in validate() show that super.validate() is returning errors.) What my code is trying to do is: 1) a list of widgets are displayed. Each widget has a link to an edit page. There is also an add widget option. Both the edit and the add call the same action with a request parameter like addEdit=add or addEdit=edit. Currently, when either of these links are clicked, I get a 'page cannot be displayed' and my log tells me that there was a validation error. I don't know why validate() is being called in the first place, I have no explicit calls to it, and didn't expect it to get run until the next form was submitted and my struts-config.xml said validate=true. 2) the next step should be that the action builds the form object with either the reset() values for an add, or a database-retrieved set of values for an edit. Ideally, when this form is submitted, the form should be validated. If I change my validate() method on my form object to return a new ActionErrors(), then things work better, but still don't validate. I hope this is enough information. I can post a bunch of code if its not. I really appreciate any and all help, this validation stuff is taking s long to get working! Thanks in advance, Janice
RE: Using Tiles Definitions In Standard Links?
BDY.RTF Description: RTF file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Which framework to choose?
Personally, I consider MVC frameworks to be commodities. It doesn't really matter which you use use. The real point of the exercise is to treat web applications like applications, rather than some throwaway hack. Which framework is best for a particular project is going to depend on the project, and more importantly, the people working on the project. Most any tool can do the job, so long as the people using the tool *want* to make it so. Right now, I'm using Struts on some projects and Maverick on others. It's all the same to me. I push as much of the work back to the business layer as possible, so the frameworks boil down to adapters. The question to ask is not am I using the 'right' framework now, but how easy would it be to switch to another framework later. No one can make tomorrow's decision today. All you can do is try and design applications that can adapt to tomorrow when it comes. Right now, wafer is tracking over twenty different Java frameworks. http://www.waferproject.org/index.html Each of which have their own special talents. JPublish, for example, is great for content management. Sofia has dynamite Dreamweaver support. And so forth. Of course, the best part is that these frameworks are not mutually exclusive. It all comes down to HTTP. You can have as many of these frameworks working in a web application as you like. It's not an election of remedies, it's an embarrassment of riches. -Ted. [EMAIL PROTECTED] wrote: Hi all, Altough this might not be the right place to ask, but I'm just curious. Recently I see a lot of different frameworks which pretty much promise the same functionality as the Struts framework. For instance I found: struts webwork Spring etc... Which one is the best? I have been using Struts for some time now... But maybe some other framework has more future then Struts. I would like to hear your opionions... Thanks, Regards, Harm de Laat Informatiefabriek The Netherlands - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Which framework to choose?
You are right. This is not the right forum. The reason you are asking on this forum (you will get a good answer quickly) is the reason you are using struts and the reason struts has a future. All the other frameworks except for JSF and Microsoft are of technical interest only. Edgar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 11:07 AM To: [EMAIL PROTECTED] Subject: Which framework to choose? Hi all, Altough this might not be the right place to ask, but I'm just curious. Recently I see a lot of different frameworks which pretty much promise the same functionality as the Struts framework. For instance I found: struts webwork Spring etc... Which one is the best? I have been using Struts for some time now... But maybe some other framework has more future then Struts. I would like to hear your opionions... Thanks, Regards, Harm de Laat Informatiefabriek The Netherlands - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Declarative Security and Struts
A few good things to know when using struts and jsp/servlet security: 1.the logic:present and logic:notPresent tags let you conditionalize your jsps based on the users role. 2.Your code can use javax.servlet.http.HttpServletRequest.isUserInRole 3.Since you are using tomcat 5x, think about using the DataSourceRelm in conjunction with something like commons dbcp. -Rich -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 3:16 AM To: Struts Users Mailing List Subject: Re: Declarative Security and Struts On 11/18/2003 12:47 AM Michael Blair wrote: I have been able to get a MemoryRealm in Tomcat to work using BASIC authentication. If I try to do this with FORM based authentication it seems to think the ACTION=j_security_check in my login.jsp seems to make struts think this is an action that should be in the struts-config. I admit, I know very little about security. Any links for MemoryRealm and JDBCRealm using struts would be great! The goal is Memory first, then get it to work with JDBC. Mike, don't use an html:form taglib for the login page. Just use pure html and then struts won't try to get involved. Adam -- struts 1.1 + tomcat 5.0.12 + java 1.4.2 Linux 2.4.20 RH9
Array of html:checkbox / html:multibox not retaining state after validation
Hi, I have a scenario where I have an array of checkboxes along with other data displayed in a table format on a JSP. I have to keep track of which checkbox is checked or unchecked when a user submits the form. I use the validate() method of my ActionForm to do validation. However, the values of the checkboxes are not retained when a validation error occurs. I have tried the following in vain: a. Array of html:checkbox I have used a boolean array for the form data type corresponding to the checkbox. Also, I set all the values of the boolean array to false in the reset() method. b. Array of html:multibox In this case, I have a String array for the form data type, and the array is not populated initially. The value of the html:multibox is obtained from a bean stored in the session, i.e html:multibox property=formProperty value=%=someValue% /html:multibox which is inside a logic:iterate loop. Also, in the reset method of the form, I set the value of the String array to null (this has worked for me in the past). I'm not sure how to set the array length to 0. Unfortunately, both of the above approaches don't help in retaining the states of the checkboxes when a validation error occurs. I also tried using Javascript to populate a hidden variable with the values of the checkboxes on form submission, and setting the checkbox array with the hidden variable array when a validation error occurs. This didn't work either. Could somebody tell me what I'm doing wrong? Any help/pointers will be greatly appreciated. Thanks, Shyam __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
reacting to changes on the checkbox
I wonder if there is a struts way for reacting to changes on the checkbox and making changes to other controls as a result. What I would like to happen is to disable a submit button when no checkbox is selected, and enable it when only one checkbox is selected, disable it again if more than one checkbox are selected. Can anybody show me a example code? Thanks a bunch! __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with bean:header
Hi, I am using the following in a JSP (Welcome.jsp) - trying to output the User-Agent header value. %@ page language=java % %@ taglib uri=/tags/struts-bean prefix=bean % %@ taglib uri=/tags/struts-html prefix=html % %@ taglib uri=/tags/struts-logic prefix=logic % ... logic:present header=User-Agent bean:header id=theheader name=User-Agent/ You are currently running bean:write name=theheader/ /logic:present However, Resin3 throws ... javax.servlet.jsp.JspException: Exception forwarding for name welcome: javax.servlet.ServletException: com.caucho.jsp.JspParseException: com.caucho.java.JavaCompileException: at org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:173) at _index__jsp._jspService(/index.jsp:2) at com.caucho.jsp.JavaPage.service(JavaPage.java:75) at com.caucho.jsp.Page.pageservice(Page.java:551) at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:184) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:165) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:253) at com.caucho.server.port.WorkerThread.run(WorkerThread.java:129) at java.lang.Thread.run(Thread.java:536) Are there any known issues with this tag? The logic:present seems fine - its just the header reference that causes problems. TIA Lawrence --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release Date: 10/11/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation occuring before form is loaded, why?
Thank you Richard and Susan, I feel silly, of course I didn't have validate=false on the mapping for displaying the form. But now I do and its finally validating!!! Janice (now if only I can figure out how to get the tiles to work, I can really get to work!) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Which framework to choose?
Ted Husted [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Personally, I consider MVC frameworks to be commodities. It doesn't really matter which you use use. The real point of the exercise is to treat web applications like applications, rather than some throwaway hack. Which framework is best for a particular project is going to depend on the project, and more importantly, the people working on the project. Most any tool can do the job, so long as the people using the tool *want* to make it so. Right now, I'm using Struts on some projects and Maverick on others. Could you say a little about how you would choose one of these over the other? (I do mean you and not one - I'm interested in your personal experience-based opinion. ;) -- Martin Cooper It's all the same to me. I push as much of the work back to the business layer as possible, so the frameworks boil down to adapters. The question to ask is not am I using the 'right' framework now, but how easy would it be to switch to another framework later. No one can make tomorrow's decision today. All you can do is try and design applications that can adapt to tomorrow when it comes. Right now, wafer is tracking over twenty different Java frameworks. http://www.waferproject.org/index.html Each of which have their own special talents. JPublish, for example, is great for content management. Sofia has dynamite Dreamweaver support. And so forth. Of course, the best part is that these frameworks are not mutually exclusive. It all comes down to HTTP. You can have as many of these frameworks working in a web application as you like. It's not an election of remedies, it's an embarrassment of riches. -Ted. [EMAIL PROTECTED] wrote: Hi all, Altough this might not be the right place to ask, but I'm just curious. Recently I see a lot of different frameworks which pretty much promise the same functionality as the Struts framework. For instance I found: struts webwork Spring etc... Which one is the best? I have been using Struts for some time now... But maybe some other framework has more future then Struts. I would like to hear your opionions... Thanks, Regards, Harm de Laat Informatiefabriek The Netherlands - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Disable URL-rewriting?
Is there any way to disable URL rewriting (with jsessionid) in Tomcat or via struts-config.xml or anything? I'm about at my wits end with this jsessionid thing - now our search engine which indexes by crawling the site (and doesn't support cookies) can't index properly because of the jsessionid property ... and frankly, I'm not really caring at this point if the 3-5% of visitors to our site can't use sessions (there's practically no functionality that depends on it anyway - mainly a performance improvement, where it is being used). I'd like to leave sessions via cookies enabled, but disable URL rewriting for sessions. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Email Validation Rules
Can any one correct me where I'm wrong using the following rule for validating email addressIt fails to validate against the valid email address..? [EMAIL PROTECTED],4}$ Tnx in advance :) -Ram - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Internationalization: Tiles vs MessageResources
BDY.RTF Description: RTF file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Email Validation Rules
I'd suggest calling: org.apache.commons.validator.GenericValidator.isEmail(String arg); -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 1:03 PM To: Struts Users Mailing List Subject: Email Validation Rules Can any one correct me where I'm wrong using the following rule for validating email addressIt fails to validate against the valid email address..? [EMAIL PROTECTED],4}$ Tnx in advance :) -Ram - 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]
using commons-pool
We want to use commons-pool package for instance pooling, where can I find a running complete example ,also we would be happy if somebody share their experinces with us ,, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ComponentContext tile attributes not being found in JSP
I have a Tiles Controller adding an attribute to the ComponentContext. This piece works fine and I can see the new attribute in the Controller class. The attribute is called message, which is a string. context.putAttribute(message, this is the message!); The problem is the JSP that uses the tiles. This is the entire page that is included as the tile with the above Controller as a preprocessor: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % font color=redtiles:getAsString name=message//font This doesn't work! The error I get is [ServletException in:/WEB-INF/web/tiles/TileMessage.jsp] Error - tag.getAsString : attribute 'message' not found in context. Check tag syntax' Any ideas why this wouldn't work? I am new to tiles and just learning my way around, but this seems like the easiest piece of the piece. the definitions work, the controlling class works, but not the jsp! thanks in advance... Mark Gregory Turansky Web Engineer [EMAIL PROTECTED] www.keymind.com 5111 Leesburg Pike, Suite 703 Falls Church, VA 22041 Tel. 703.379.2060 x450 Fax.703.379.6328 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Email Validation Rules
yeah...I tried that way but the problem I belive is it does accepting special character after the . part of email address. any other idea how to make it work??? -Original Message- From: David Friedman [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 1:16 PM To: Struts Users Mailing List Subject: RE: Email Validation Rules I'd suggest calling: org.apache.commons.validator.GenericValidator.isEmail(String arg); -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 1:03 PM To: Struts Users Mailing List Subject: Email Validation Rules Can any one correct me where I'm wrong using the following rule for validating email addressIt fails to validate against the valid email address..? [EMAIL PROTECTED],4}$ Tnx in advance :) -Ram - 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: struts and PHP
Am Montag, 17. November 2003 22:48 schrieb Daniel Blumenthal: Hi, i've been looking into adding blogging functionality to my website (which uses struts), and one which was suggested was pmachine (http://www.pmachine.com/index.php). however, this uses php, and this raised the question of how/if it was possible to use php with struts. (obviously, i can just specify a php page instead of a jsp, but how do i get dynamic data without relying on the jsp tags?) As soon as you leave the Java world, the only means of passing dynamic content is the 'traditional' way, i.e. parameters. You lose everything from page to application scopes and won't be able to use attributes (Objects) in particular, as those reside inside the VM's memory and thus are inaccessible from PHP. If you absolutely have to pass complex information between the PHP app and the Java part, one possible suggestion might be to use a database or other third-party serialization target both of them can access (in lack of a database, an XML file, perhaps). Generally, I won't recommend this, for there may be all kinds of synchronization and security issues involved. Don't know if PHP can handle this, but this also might be a situation where Web Services may be helpful. Anyway, the overhead involved in both cases is much too big for a private site. IMHO it's better to look for a Java-based blog solution. is this incredibly easy? impossible? is there some weird chaining process that i have to go through? or is there another blogging tool which doesn't use php which i should use instead? Admitting I kind of hate both blogs and PHP in general, I'm still pretty sure there are Java-based blog solutions around. The first thing I'd do is to check out Google and then sourceforge.net, as always. Or java.net, lately. daniel HTH, -- Chris. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ProcessAction and RESULT attribute
Hi, I really needed to know how ProcessAction acts. Struts In Action says The ProcessAction will than just save the ResultList collection in request scope, using the default RESULT attribute name, and forward control to success.. The problem is that i am not getting a RESULT attribute in my jsp. Please, anyone Tks Felipe --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release Date: 10/11/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
avoid proxy-caching by generating changing urls
Hi all ! My application is running behind a proxy which caches everything, if the url is the same. It's no use that I have this in each Jsp: meta http-equiv=pragma content=no-cache Therefore I used the Struts-property controller nocache=true/ But it was not that I expected: My Login-Site has this URL: http://localhost:8080/lager/Welcome.do;jsessionid=0146C3084A50F84EDEE81FE78E E56DAE?action=toLogin - is ok. But when I make login, the next URL has no jsessionid:and therefore it is always the same: http://localhost:8080/lager/Login.do?action=makeLogin Is it possible to avoid proxy-caching with Struts by changing each URL with appendig a random-number or such a thing ? Please give me a tip. Thanks in advance for your help. Best regards. Christine
Re: Disable URL-rewriting?
NAFAIK, but that's by no means definitive. I *do* know that you can configure a TC context (or default context) to do the opposite. In other words, turn off cookies and only use rewriting. Hm, what if you create a filter to wrap the response with an HttpServletResponseWrapper that no-ops encodeUrl and encodeURL? Quoting Brice Ruth [EMAIL PROTECTED]: Is there any way to disable URL rewriting (with jsessionid) in Tomcat or via struts-config.xml or anything? I'm about at my wits end with this jsessionid thing - now our search engine which indexes by crawling the site (and doesn't support cookies) can't index properly because of the jsessionid property ... and frankly, I'm not really caring at this point if the 3-5% of visitors to our site can't use sessions (there's practically no functionality that depends on it anyway - mainly a performance improvement, where it is being used). I'd like to leave sessions via cookies enabled, but disable URL rewriting for sessions. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- 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]
Complex Form Validation
We are trying to perform some complex form validaion with the new Validator plugin. Here is what we are trying to do: 1 -- validate a form field based on other form fields 2 -- validate a form field based on div style settings I know that I could solve the first problem with the old validation architecture, but is there a way to do that through the validator.xml? I'm not sure about the second problem. The code looks something like this div id=myDiv style=display: none //my form element here /div So is it possible to only validate the form element above only if the enclosing div display is block? I've looked, but couldn't find anything explaining how to go about this. Any ideas? Thanks in advance, George - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Complex Form Validation
George, I have done something similar to this. I haven't looked at browser compatability yet(we're currently using this with ie6), but the concept that I use is that I look at the parents of the form field, trying to find out if the element is hidden. If I find that a parent that is hidden, then I take appropriate action. My javascript loop looks like this: var hiddenParent = false; for(parent=formField.parentElement; parent != null hiddenParent == false; parent = parent.parentElement) { if(parent.currentStyle.display == none) { hiddenParent = true; } } if(hiddenParent) { etc, etc } Hope this helps a little. If there are better ways to do this, I'd love to get the feedback :-) Nick George Steimer [EMAIL PROTECTED]To: [EMAIL PROTECTED] m cc: Subject: Complex Form Validation 11/18/2003 02:18 PM Please respond to Struts Users Mailing List We are trying to perform some complex form validaion with the new Validator plugin. Here is what we are trying to do: 1 -- validate a form field based on other form fields 2 -- validate a form field based on div style settings I know that I could solve the first problem with the old validation architecture, but is there a way to do that through the validator.xml? I'm not sure about the second problem. The code looks something like this div id=myDiv style=display: none //my form element here /div So is it possible to only validate the form element above only if the enclosing div display is block? I've looked, but couldn't find anything explaining how to go about this. Any ideas? Thanks in advance, George - 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: Disable URL-rewriting?
Kris, Thanks for the response. I saw that I could do the opposite :) - no help there. I'd be really interested in pursuing your second suggestion. Ideally, I'd see setting up a filter that processes every incoming request and determines if its originating from our search engine, if so, then no-op those methods, otherwise leave everything as is ... How exactly would I go about doing what you suggest? I've only been doing Java/Servlet stuff for about a year or so, and that mostly via JSP/Struts/etc. - so I'm no expert when it comes to this. Kris Schneider wrote: NAFAIK, but that's by no means definitive. I *do* know that you can configure a TC context (or default context) to do the opposite. In other words, turn off cookies and only use rewriting. Hm, what if you create a filter to wrap the response with an HttpServletResponseWrapper that no-ops encodeUrl and encodeURL? Quoting Brice Ruth [EMAIL PROTECTED]: Is there any way to disable URL rewriting (with jsessionid) in Tomcat or via struts-config.xml or anything? I'm about at my wits end with this jsessionid thing - now our search engine which indexes by crawling the site (and doesn't support cookies) can't index properly because of the jsessionid property ... and frankly, I'm not really caring at this point if the 3-5% of visitors to our site can't use sessions (there's practically no functionality that depends on it anyway - mainly a performance improvement, where it is being used). I'd like to leave sessions via cookies enabled, but disable URL rewriting for sessions. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Complex Form Validation
Nick, Thanks for your response. I'm doing something similar with javascript. What would be better is if we could validate the form serverside with the validation framework... I think we would have to write a custom validator that somehow would get the div parent of the form field and check that before checking the actual field. Thanks, George George, I have done something similar to this. I haven't looked at browser compatability yet(we're currently using this with ie6), but the concept that I use is that I look at the parents of the form field, trying to find out if the element is hidden. If I find that a parent that is hidden, then I take appropriate action. My javascript loop looks like this: var hiddenParent = false; for(parent=formField.parentElement; parent != null hiddenParent == false; parent = parent.parentElement) { if(parent.currentStyle.display == none) { hiddenParent = true; } } if(hiddenParent) { etc, etc } Hope this helps a little. If there are better ways to do this, I'd love to get the feedback :-) Nick George Steimer [EMAIL PROTECTED]To: [EMAIL PROTECTED] m cc: Subject: Complex Form Validation 11/18/2003 02:18 PM Please respond to Struts Users Mailing List We are trying to perform some complex form validaion with the new Validator plugin. Here is what we are trying to do: 1 -- validate a form field based on other form fields 2 -- validate a form field based on div style settings I know that I could solve the first problem with the old validation architecture, but is there a way to do that through the validator.xml? I'm not sure about the second problem. The code looks something like this div id=myDiv style=display: none //my form element here /div So is it possible to only validate the form element above only if the enclosing div display is block? I've looked, but couldn't find anything explaining how to go about this. Any ideas? Thanks in advance, George - 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]
Server manged vs. struts managed db pools
Are there any pro/con 's for either? Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Complex Form Validation
George, You can't do the validation server-side as you proposed because the browser only sends HTML form elements. It will not send any information regarding the div tag. You would have to have a hidden form variable and use JavaScript to populate it with any values of interest when the form is submitted. Regards, Richard -Original Message- From: George Steimer [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 11:51 AM To: Struts Users Mailing List Subject: Re: Complex Form Validation Nick, Thanks for your response. I'm doing something similar with javascript. What would be better is if we could validate the form serverside with the validation framework... I think we would have to write a custom validator that somehow would get the div parent of the form field and check that before checking the actual field. Thanks, George George, I have done something similar to this. I haven't looked at browser compatability yet(we're currently using this with ie6), but the concept that I use is that I look at the parents of the form field, trying to find out if the element is hidden. If I find that a parent that is hidden, then I take appropriate action. My javascript loop looks like this: var hiddenParent = false; for(parent=formField.parentElement; parent != null hiddenParent == false; parent = parent.parentElement) { if(parent.currentStyle.display == none) { hiddenParent = true; } } if(hiddenParent) { etc, etc } Hope this helps a little. If there are better ways to do this, I'd love to get the feedback :-) Nick George Steimer [EMAIL PROTECTED]To: [EMAIL PROTECTED] m cc: Subject: Complex Form Validation 11/18/2003 02:18 PM Please respond to Struts Users Mailing List We are trying to perform some complex form validaion with the new Validator plugin. Here is what we are trying to do: 1 -- validate a form field based on other form fields 2 -- validate a form field based on div style settings I know that I could solve the first problem with the old validation architecture, but is there a way to do that through the validator.xml? I'm not sure about the second problem. The code looks something like this div id=myDiv style=display: none //my form element here /div So is it possible to only validate the form element above only if the enclosing div display is block? I've looked, but couldn't find anything explaining how to go about this. Any ideas? Thanks in advance, George - 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: Disable URL-rewriting?
First, check out a tutorial on Servlet 2.3 filters. One at: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets8.html Essentially, it'll boil down to creating two classes: a filter (implements javax.servlet.Filter) and a response wrapper (extends javax.servlet.http.HttpServletResponseWrapper). Then, you'll need to add filter and filter-mapping elements to web.xml. How would you determine if a request originated from your search engine? User-Agent header? Specific request parameter? Quoting Brice Ruth [EMAIL PROTECTED]: Kris, Thanks for the response. I saw that I could do the opposite :) - no help there. I'd be really interested in pursuing your second suggestion. Ideally, I'd see setting up a filter that processes every incoming request and determines if its originating from our search engine, if so, then no-op those methods, otherwise leave everything as is ... How exactly would I go about doing what you suggest? I've only been doing Java/Servlet stuff for about a year or so, and that mostly via JSP/Struts/etc. - so I'm no expert when it comes to this. Kris Schneider wrote: NAFAIK, but that's by no means definitive. I *do* know that you can configure a TC context (or default context) to do the opposite. In other words, turn off cookies and only use rewriting. Hm, what if you create a filter to wrap the response with an HttpServletResponseWrapper that no-ops encodeUrl and encodeURL? Quoting Brice Ruth [EMAIL PROTECTED]: Is there any way to disable URL rewriting (with jsessionid) in Tomcat or via struts-config.xml or anything? I'm about at my wits end with this jsessionid thing - now our search engine which indexes by crawling the site (and doesn't support cookies) can't index properly because of the jsessionid property ... and frankly, I'm not really caring at this point if the 3-5% of visitors to our site can't use sessions (there's practically no functionality that depends on it anyway - mainly a performance improvement, where it is being used). I'd like to leave sessions via cookies enabled, but disable URL rewriting for sessions. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- 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: Disable URL-rewriting?
Am Dienstag, 18. November 2003 18:29 schrieb Brice Ruth: If anyone knows a solution to this matter, I'm definitely interested in hearing about it, too. From all what I can tell, some search engines don't care (Altavista's Scooter, for example), while some do (Google, in particular) and go away when they detect a session. I experimented for quite some time, but to no real avail. One approach I tried is having a custom action explicitly killing all sessions when entering the main page and invoking that one from my index.jsp. This works, but I couldn't keep to this approach when porting (my private site) to Tiles some time ago, didn't look further into the possible reasons behind this. Plus, Struts also stores some info in session scope, the user's locale, for example. When I had to decide between sessions and Google (in fact, I only need sessions for pages 'beyond' authen- tication stage; my provider doesn't grant me access to resin.conf, so I had to write a filter for that task), I decided to better stick to the framework and have Google satisfied otherwise (ah, robots.txt doesn't make any difference in this direction, too). Gone bad already, I chose the cloaking approach (don't try this at home :-), so I changed my index.jsp to something like: %@ page contentType=text/html; charset=ISO-8859-1 session=false % % String userAgent = request.getHeader(User-Agent); if (userAgent.indexOf(oogle) == -1) { % jsp:forward page=/main.do / % } else { % jsp:forward page=/static/index.html / % } % and just saved a static snapshot of the main page in /static with Cookies enabled, so the jsessionid things are not appended to the links. Google won't be able to tell the difference because of the forward. Considering 'brute' means as disabling URL rewriting in general, I'd rather guess this is a server-specific thing. In Java, you don't have any means of telling the server how to maintain session state, the only thing you can say is 'request.getSession()' and check for an existing session if you give 'false' as a parameter to the overloaded version, and you can programmatically kill sessions via session.invalidate(). This is all Struts can do, too. So I think you have to check your server's manuals on this matter. If it's Tomcat, I can rather reliably tell that you can decide whether to use cookies or not, but the same is not true for the URL-rewriting approach as a 'fallback' means, and then, the server has to adhere the Servlet specification, after all. Now. As you can't determine *how* sessions are maintained, you can still determine to some degree *when* they're created. One thing I can tell from my experiences with Struts is that using the standard forward Action will auto- matically result in having a session around afterwards, but if you write a custom one that just says 'return mapping.findForward(success);, things are quite different. And so on. I really have to look further into this if my time allows. Note this is just telling from my experiences when developing my private site. On the job, the landing sites usually are static HTML pages, not so much because of session handling or search engines, but because of the general vulnerability of dynamic pages to DoS attacks and high traffic volumes in general. HTH, -- Chris. Is there any way to disable URL rewriting (with jsessionid) in Tomcat or via struts-config.xml or anything? I'm about at my wits end with this jsessionid thing - now our search engine which indexes by crawling the site (and doesn't support cookies) can't index properly because of the jsessionid property ... and frankly, I'm not really caring at this point if the 3-5% of visitors to our site can't use sessions (there's practically no functionality that depends on it anyway - mainly a performance improvement, where it is being used). I'd like to leave sessions via cookies enabled, but disable URL rewriting for sessions. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Trouble With Multiple Message Resources Bundles
I am having trouble accessing a message from my non-default message bundle. I have the following entries in my struts-config.xml file... message-resources parameter=com.it.rfr.resources.rfrresources /message-resources message-resources key=shared parameter=com.it.shared.resources.sharedresources /message-resources I then try to access a message in the shared bundle using this tag... bean:message bundle=shared name=com.it.label.error400Title/ When I do this, I get the following error... javax.servlet.jsp.JspException: Missing message for key com.it.label.error400Title I have researched the archives and have not found any sufficient reasons as to why this doesn't work. All of the Struts documentation reads like this should work. Does anyone have any ideas? = Best Regards, Cornellious Mann __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Server manged vs. struts managed db pools
I like struts managed db pools, however, the struts developers aren't too happy about the quality and the dependency on the commons-pooling library and are attempting to phase it out. Edgar -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:52 PM To: Struts Users Mailing List Subject: Server manged vs. struts managed db pools Are there any pro/con 's for either? Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disable URL-rewriting?
I'd probably do a User-Agent header check ... Now, I've got a Filter already doing some things for the site - so I know how to configure web.xml and such, what do I need to do to use HttpServletResponseWrapper? Brice Kris Schneider wrote: First, check out a tutorial on Servlet 2.3 filters. One at: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets8.html Essentially, it'll boil down to creating two classes: a filter (implements javax.servlet.Filter) and a response wrapper (extends javax.servlet.http.HttpServletResponseWrapper). Then, you'll need to add filter and filter-mapping elements to web.xml. How would you determine if a request originated from your search engine? User-Agent header? Specific request parameter? Quoting Brice Ruth [EMAIL PROTECTED]: Kris, Thanks for the response. I saw that I could do the opposite :) - no help there. I'd be really interested in pursuing your second suggestion. Ideally, I'd see setting up a filter that processes every incoming request and determines if its originating from our search engine, if so, then no-op those methods, otherwise leave everything as is ... How exactly would I go about doing what you suggest? I've only been doing Java/Servlet stuff for about a year or so, and that mostly via JSP/Struts/etc. - so I'm no expert when it comes to this. Kris Schneider wrote: NAFAIK, but that's by no means definitive. I *do* know that you can configure a TC context (or default context) to do the opposite. In other words, turn off cookies and only use rewriting. Hm, what if you create a filter to wrap the response with an HttpServletResponseWrapper that no-ops encodeUrl and encodeURL? Quoting Brice Ruth [EMAIL PROTECTED]: Is there any way to disable URL rewriting (with jsessionid) in Tomcat or via struts-config.xml or anything? I'm about at my wits end with this jsessionid thing - now our search engine which indexes by crawling the site (and doesn't support cookies) can't index properly because of the jsessionid property ... and frankly, I'm not really caring at this point if the 3-5% of visitors to our site can't use sessions (there's practically no functionality that depends on it anyway - mainly a performance improvement, where it is being used). I'd like to leave sessions via cookies enabled, but disable URL rewriting for sessions. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disable URL-rewriting?
Got it. Simple as pie, actually. Created the Wrapper class, no-op'd the encodeUrl/encodeURL and put it into the Filter that was already setup to handle all incoming requests ... piece of cake :) Sweet! Here's the wrapper code: public class StripSessionIdWrapper extends HttpServletResponseWrapper { public StripSessionIdWrapper(HttpServletResponse response) { super(response); } public String encodeUrl(String url) { return url; } public String encodeURL(String url) { return url; } } and here's the couple lines I have in my Filter: StripSessionIdWrapper wrapper = new StripSessionIdWrapper((HttpServletResponse)response); and then, instead of passing response to the chain.doFilter, I pass wrapper Nice ... clean, I like it. Kris Schneider wrote: First, check out a tutorial on Servlet 2.3 filters. One at: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets8.html Essentially, it'll boil down to creating two classes: a filter (implements javax.servlet.Filter) and a response wrapper (extends javax.servlet.http.HttpServletResponseWrapper). Then, you'll need to add filter and filter-mapping elements to web.xml. How would you determine if a request originated from your search engine? User-Agent header? Specific request parameter? Quoting Brice Ruth [EMAIL PROTECTED]: Kris, Thanks for the response. I saw that I could do the opposite :) - no help there. I'd be really interested in pursuing your second suggestion. Ideally, I'd see setting up a filter that processes every incoming request and determines if its originating from our search engine, if so, then no-op those methods, otherwise leave everything as is ... How exactly would I go about doing what you suggest? I've only been doing Java/Servlet stuff for about a year or so, and that mostly via JSP/Struts/etc. - so I'm no expert when it comes to this. Kris Schneider wrote: NAFAIK, but that's by no means definitive. I *do* know that you can configure a TC context (or default context) to do the opposite. In other words, turn off cookies and only use rewriting. Hm, what if you create a filter to wrap the response with an HttpServletResponseWrapper that no-ops encodeUrl and encodeURL? Quoting Brice Ruth [EMAIL PROTECTED]: Is there any way to disable URL rewriting (with jsessionid) in Tomcat or via struts-config.xml or anything? I'm about at my wits end with this jsessionid thing - now our search engine which indexes by crawling the site (and doesn't support cookies) can't index properly because of the jsessionid property ... and frankly, I'm not really caring at this point if the 3-5% of visitors to our site can't use sessions (there's practically no functionality that depends on it anyway - mainly a performance improvement, where it is being used). I'd like to leave sessions via cookies enabled, but disable URL rewriting for sessions. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disable URL-rewriting?
Am Dienstag, 18. November 2003 20:10 schrieb Kris Schneider: Oh, I see that I left that approach out, for I dropped it at an early stage in my design considerations. Of course, you can kill off session information via a filter that way, but what will happen if the user has disabled Cookies, and when it's not Google, but some John Doe user? OK, let's simulate the results. Request number #1 is made, resulting in session creation due to something in my code, but the filter intercepts and removes the session info from the response. So far, so good. Now the user clicks on a link. As the request contains no session info, the server handles it as a new session-related request and creates a new session. Returning, the filter kills the session again, of course. And so on. In the meantime, there may be 30+ stale sessions hanging around, waiting for timeout just because the filter suppressed some crucial infor- mation the server expected on return. Given it's possible to say session.invalidate() somewhere in time before committing the response via the filter, I still would feel like doing something very wrong somehow, for I would code against the machine and the specifications, and that's not how it's meant to be. It may work, even, but still I would feel just uneasy. Then, the preferable approach would be to avoid sessions if you don't want them (just as in RL) instead of killing them afterwards, If that's not possible, I tend to handle general things in a general fashion and handle the special conditions (possible scenario: the GoogleBot shows up again) in special ways, too. Considering a customized Google filter: well, the simple cloaking approach I described is easier to implement and just closer to my personal taste. YMMV. Thanks for an interesting idea I may have dropped too soon back then, but I think, even when reconsidering it, I would still stick to a different approach. It's my private site after all, and I just don't want to feel bad about it in some way :-) -- Chris. NB. One thing I still wonder about is whether it's really the jsessionid thing Google dislikes or the *.do ending in general. AFAI can tell, Google also indexes plain .jsps, but those run in a session anyway by default. Don't know. If it's really just the *.do ending, it's eas to map Struts to *.html (assigning a .htm ending to truly static pages), use mod_rewrite or the rewrite filter available in Resin 3.0. But didn't check all that yet. NAFAIK, but that's by no means definitive. I *do* know that you can configure a TC context (or default context) to do the opposite. In other words, turn off cookies and only use rewriting. Hm, what if you create a filter to wrap the response with an HttpServletResponseWrapper that no-ops encodeUrl and encodeURL? Quoting Brice Ruth [EMAIL PROTECTED]: Is there any way to disable URL rewriting (with jsessionid) in Tomcat or via struts-config.xml or anything? I'm about at my wits end with this jsessionid thing - now our search engine which indexes by crawling the site (and doesn't support cookies) can't index properly because of the jsessionid property ... and frankly, I'm not really caring at this point if the 3-5% of visitors to our site can't use sessions (there's practically no functionality that depends on it anyway - mainly a performance improvement, where it is being used). I'd like to leave sessions via cookies enabled, but disable URL rewriting for sessions. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disable URL-rewriting?
I'm going to handle this by specifically looking at the User-Agent header that gets sent ... if I can detect that it is a search engine (particularly *our search engine crawler), then I'll disable the encodeURL/Url methods ... otherwise, I'll leave things as is. This takes care of your considerations, I think. Brice Christian Bollmeyer wrote: Am Dienstag, 18. November 2003 20:10 schrieb Kris Schneider: Oh, I see that I left that approach out, for I dropped it at an early stage in my design considerations. Of course, you can kill off session information via a filter that way, but what will happen if the user has disabled Cookies, and when it's not Google, but some John Doe user? OK, let's simulate the results. Request number #1 is made, resulting in session creation due to something in my code, but the filter intercepts and removes the session info from the response. So far, so good. Now the user clicks on a link. As the request contains no session info, the server handles it as a new session-related request and creates a new session. Returning, the filter kills the session again, of course. And so on. In the meantime, there may be 30+ stale sessions hanging around, waiting for timeout just because the filter suppressed some crucial infor- mation the server expected on return. Given it's possible to say session.invalidate() somewhere in time before committing the response via the filter, I still would feel like doing something very wrong somehow, for I would code against the machine and the specifications, and that's not how it's meant to be. It may work, even, but still I would feel just uneasy. Then, the preferable approach would be to avoid sessions if you don't want them (just as in RL) instead of killing them afterwards, If that's not possible, I tend to handle general things in a general fashion and handle the special conditions (possible scenario: the GoogleBot shows up again) in special ways, too. Considering a customized Google filter: well, the simple cloaking approach I described is easier to implement and just closer to my personal taste. YMMV. Thanks for an interesting idea I may have dropped too soon back then, but I think, even when reconsidering it, I would still stick to a different approach. It's my private site after all, and I just don't want to feel bad about it in some way :-) -- Chris. NB. One thing I still wonder about is whether it's really the jsessionid thing Google dislikes or the *.do ending in general. AFAI can tell, Google also indexes plain .jsps, but those run in a session anyway by default. Don't know. If it's really just the *.do ending, it's eas to map Struts to *.html (assigning a .htm ending to truly static pages), use mod_rewrite or the rewrite filter available in Resin 3.0. But didn't check all that yet. NAFAIK, but that's by no means definitive. I *do* know that you can configure a TC context (or default context) to do the opposite. In other words, turn off cookies and only use rewriting. Hm, what if you create a filter to wrap the response with an HttpServletResponseWrapper that no-ops encodeUrl and encodeURL? Quoting Brice Ruth [EMAIL PROTECTED]: Is there any way to disable URL rewriting (with jsessionid) in Tomcat or via struts-config.xml or anything? I'm about at my wits end with this jsessionid thing - now our search engine which indexes by crawling the site (and doesn't support cookies) can't index properly because of the jsessionid property ... and frankly, I'm not really caring at this point if the 3-5% of visitors to our site can't use sessions (there's practically no functionality that depends on it anyway - mainly a performance improvement, where it is being used). I'd like to leave sessions via cookies enabled, but disable URL rewriting for sessions. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: running Struts with no network connection
I think in struts-config.xml there is a section for enabling validator plugin, if i am not mistaken you have to comment that section out.. Khalid Quoting Afshartous, Nick [EMAIL PROTECTED]: Hi, I'm trying to run with no network connection, and I've set the init param validation to false. Yet Struts is looking for the Validator's DTD. Thanks for any help. -- Nick 95 [main] INFO validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validation.xml' 3130 [main] ERROR validator.ValidatorPlugIn - jakarta.apache.org java.net.UnknownHostException: jakarta.apache.org at java.net.InetAddress.getAllByName0(InetAddress.java:566) at java.net.InetAddress.getAllByName0(InetAddress.java:535) at java.net.InetAddress.getByName(InetAddress.java:444) at java.net.Socket.init(Socket.java:95) at sun.net.NetworkClient.doConnect(NetworkClient.java:45) at sun.net.www.http.HttpClient.openServer(HttpClient.java:330) at sun.net.www.http.HttpClient.openServer(HttpClient.java:516) at sun.net.www.http.HttpClient.init(HttpClient.java:266) at sun.net.www.http.HttpClient.init(HttpClient.java:276) at sun.net.www.http.HttpClient.New(HttpClient.java:288) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection .java:417) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java:510) at java.net.URL.openStream(URL.java:793) at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source) at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch( Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1302) at org.apache.commons.validator.ValidatorResourcesInitializer.initialize (ValidatorResourcesInitializer.java:256) at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl ugIn.java:222) at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java :161) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle t.java:1158) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper. java:935) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:82 3) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex t.java:3420) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3 608) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase .java:821) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:80 7) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep loyer.java:307) at org.apache.catalina.core.StandardHost.install(StandardHost.java:772) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j ava:559) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:401 ) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java :358) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:166) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196) at org.apache.catalina.core.StandardHost.start(StandardHost.java:738) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347 ) at org.apache.catalina.core.StandardService.start(StandardService.java:4 97) at org.apache.catalina.core.StandardServer.start(StandardServer.java:219 0) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=1/111 config=/Users/afshar/local/
ExceptionHandler
Hi, I have the following defined in my config: action path=/buildCRAction type=com.hnw.apps.ml.clients.action.BuildContentReleaseAction validate=false name=contentReleaseForm input=/build_content_release.jsp scope=request exception key=error.content.release.contentmanager.exception path=/systemError type=com.hnw.services.content.exception.ContentManagerException / exception key=error.content.release.create.fail path=/build_content_release.jsp type=com.hnw.services.content.exception.CreateContentReleaseException / forward name=success path=/viewCRAction.do / /action My action class complains that I am not catching these exceptions. Should I extend the ExceptionHandler for this to work? s P - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ExceptionHandler
Felipe, How is '/componentes/mensagens.jsp' related to the Action or to 'tiles.erro'? When do you get this message vs. the blank white page? Have you viewed the source of the 'white page' to see if it contains any html? -Richard -Original Message- From: Felipe Nascimento [mailto:[EMAIL PROTECTED] Sent: Sunday, November 16, 2003 9:09 PM To: Struts Users Mailing List Subject: Re: ExceptionHandler Yes it is. I am from Brazil. It is in portuguese. Tks. - Original Message - From: Rick Reumann [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, November 17, 2003 2:39 AM Subject: Re: ExceptionHandler Felipe Nascimento wrote: key=tatilJ.exception.faseJaExisteException path=tiles.erro / Is the tiles definition really called tiles.erro and not tiles.error ? -- Rick - 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]
Turn off javascript validation generation
Is there a way to turn off all (750 lines!) of the JavaScript that gets generated for form validation? Thanks, -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: avoid proxy-caching by generating changing urls
Hi, I'm using Struts with Tomcat 4.1. If you disable cookies in your tomcat context, all your ULR will be rewritten with a jsessionid. So the proxy issue should be solve. However I don't know If there is a way to enable cookies AND be sure that the proxy's cache is disable. In my project I use this in all jsp I won't be in any cache : % response.setHeader(pragma, no-cache); response.setHeader(Cache-control, no-cache, no-store); response.setHeader(Expires, 0); % head meta http-equiv=pragma content=no-cache meta http-equiv=cache-control content=no-cache /head It seems to work for me but I'm sure there are more élégant solutions. Using Struts, you see on the bean:header tag. I still haven't found time to explore it. Let me know if it's work for you. Carl Christine Gerstenmayer wrote: Hi all ! My application is running behind a proxy which caches everything, if the url is the same. It's no use that I have this in each Jsp: meta http-equiv=pragma content=no-cache Therefore I used the Struts-property controller nocache=true/ But it was not that I expected: My Login-Site has this URL: http://localhost:8080/lager/Welcome.do;jsessionid=0146C3084A50F84EDEE81FE78E E56DAE?action=toLogin - is ok. But when I make login, the next URL has no jsessionid:and therefore it is always the same: http://localhost:8080/lager/Login.do?action=makeLogin Is it possible to avoid proxy-caching with Struts by changing each URL with appendig a random-number or such a thing ? Please give me a tip. Thanks in advance for your help. Best regards. Christine - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
initializing properties for Actions
Hi, I'm trying to pass some initialization parameters to an Action and I'm having some trouble. What I want is to be able to tell my LoginAction not to validate passwords for development systems. Here is what I have right now followed by the error I get on startup: struts-config.xml: action path=/login type=action.LoginAction scope=request name=loginForm validate=false input=/login/login.jsp set-property property=passwordDisabled value=true / /action LoginAction.java: public boolean passwordDisabled = false; public boolean getPasswordDisabled() { return passwordDisabled; } public void setPasswordDisabled(boolean aValue) { passwordDisabled = aValue; } error log: Nov 18, 2003 2:06:14 PM org.apache.commons.digester.SetPropertyRule begin FINE: [SetPropertyRule]{struts-config/action-mappings/action/set-property} Set org.apache.struts.action.ActionMapping property passwordDisabled to true Nov 18, 2003 2:06:14 PM org.apache.commons.digester.Digester startElement SEVERE: Begin event threw exception java.lang.NoSuchMethodException: Bean has no property named passwordDisabled at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:192) at org.apache.commons.digester.Rule.begin(Rule.java:200) at org.apache.commons.digester.Digester.startElement(Digester.java:1273) at weblogic.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:459) at weblogic.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.jav a:221) It looks like it is trying to set the passwordDisabled property in the ActionMapping class instead of the LoginAction class. wtf? I can't find any examples anywhere that set parameters on actions, but according to the dtd, it is valid. Any help is appreciated. -- Frank Maritato - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: initializing properties for Actions
I'm not sure that this will solve your pb, but I think you should use public boolean isPasswordDisabled() { return passwordDisabled; } instead of getPasswordDisabled. Carl Frank Maritato wrote: Hi, I'm trying to pass some initialization parameters to an Action and I'm having some trouble. What I want is to be able to tell my LoginAction not to validate passwords for development systems. Here is what I have right now followed by the error I get on startup: struts-config.xml: action path=/login type=action.LoginAction scope=request name=loginForm validate=false input=/login/login.jsp set-property property=passwordDisabled value=true / /action LoginAction.java: public boolean passwordDisabled = false; public boolean getPasswordDisabled() { return passwordDisabled; } public void setPasswordDisabled(boolean aValue) { passwordDisabled = aValue; } error log: Nov 18, 2003 2:06:14 PM org.apache.commons.digester.SetPropertyRule begin FINE: [SetPropertyRule]{struts-config/action-mappings/action/set-property} Set org.apache.struts.action.ActionMapping property passwordDisabled to true Nov 18, 2003 2:06:14 PM org.apache.commons.digester.Digester startElement SEVERE: Begin event threw exception java.lang.NoSuchMethodException: Bean has no property named passwordDisabled at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:192) at org.apache.commons.digester.Rule.begin(Rule.java:200) at org.apache.commons.digester.Digester.startElement(Digester.java:1273) at weblogic.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:459) at weblogic.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.jav a:221) It looks like it is trying to set the passwordDisabled property in the ActionMapping class instead of the LoginAction class. wtf? I can't find any examples anywhere that set parameters on actions, but according to the dtd, it is valid. Any help is appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Form data vs request attributes
I've been fiddling around with Struts for a while now and am still a little puzzled as to whether JSPs should be getting their data from my DynaActionForm or from the session/request context. For example, if my JSP contains: html:select property=selectedCustomer size=5 html:options collection=customers property=id/ /html:select html:text property=suburb size=16 maxlength=18/ The way I have this working currently is by adding customers to the request context and by having suburb declared in my DynaActionForm. I don't appear to have to declare customers in the form, but if I don't declare suburb, I get an error... what is the difference? P.S. If it helps clarify things, the JSP I have displays a list of customers and some input fields. The user can update the input fields, press submit and they see the same page (with the new details displayed in the list). Many thanks. -- Craig Edwards Sydney, Australia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: MySql BasicDataSource Connection
Gede, Thanks so much for your help! The problem was that I had the property listed as driverClass instead of driverClassName, so the BasicDataSource couldn never locate my driver. When I fixed that, it fired right up. Thanks again!! Brent -Original Message- From: Gede Indrawan [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 10:11 PM To: Struts Users Mailing List Subject: Re: MySql BasicDataSource Connection I use data-source defintion below and no problem with it data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=org.gjt.mm.mysql.Driver/ set-property property=url value=jdbc:mysql://localhost/telkomsel/ set-property property=maxCount value=5/ set-property property=minCount value=1/ set-property property=username value=root/ set-property property=password value=blahblah/ /data-source - Original Message - From: Pacheco, Brent [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Saturday, November 15, 2003 12:31 AM Subject: MySql BasicDataSource Connection Howdy! I'm using Struts 1.1 in WebSphere and I'm attempting to replace the GenericDataSource connection pool in my struts-config.xml file with a BasicDataSource connection pool to hit a mySQL database, but I keep getting an error. The data-source defintion in my struts-config.xml file is as follows: data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=autoCommit value=false/ set-property property=key value=1 / set-property property=description value=1 / set-property property=driverClass value=org.gjt.mm.mysql.Driver / set-property property=maxWait value=10 / set-property property=maxCount value=10 / set-property property=minCount value=2 / set-property property=url value=jdbc:mysql://localhost:3306/NOL / set-property property=user value=** / set-property property=password value=** / /data-source /data-sources I have placed the commons-dbcp.jar and commons-pool.jar in my classpath, as well as the native mySql driver. There's no problem when using the GenericDataSource, but as soon as I change to the BasicDataSource, I get the following error when starting up the server: [11/14/03 11:30:04:702 CST] 66ad7043 ActionServlet E org.apache.struts.action.ActionServlet TRAS0014I: The following exception was logged org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://localhost:3306/NOL', cause: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getDriver(DriverManager.java:266) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:743) at org.apache.commons.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:57 6) at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j ava:1087) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletIn stance.java:82) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycle Servlet.java:147) at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecy cleServlet.java:270) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleS ervlet.java:113) at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:17 5) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServlet Manager.java:761) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServle tManager.java:257) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(Web AppServletManager.java:453) at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233) at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273) at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317) at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194) at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:950 ) at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java: 133) at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:36 0) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav a:401) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart (DeployedApplicationImpl.java:743) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.jav a:337) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicati onImpl.java:531) at
Re: initializing properties for Actions
Carl, That didn't work, but thanks anyway. I also tried changing the data type for passwordDisabled to a String and have the normal get/set methods but that didn't seem to change the outcome either. I think the real problem is that it is trying to call setPasswordDisabled on org.apache.struts.action.ActionMapping instead of my LoginAction class. Not sure if this is a known you can't do that or a known bug or whatever (I'm using struts 1.1.0). I was unable to find any info on this topic either in the archives or on jakarta.apache.org. Carl wrote: I'm not sure that this will solve your pb, but I think you should use public boolean isPasswordDisabled() { return passwordDisabled; } instead of getPasswordDisabled. Carl Frank Maritato wrote: Hi, I'm trying to pass some initialization parameters to an Action and I'm having some trouble. What I want is to be able to tell my LoginAction not to validate passwords for development systems. Here is what I have right now followed by the error I get on startup: struts-config.xml: action path=/login type=action.LoginAction scope=request name=loginForm validate=false input=/login/login.jsp set-property property=passwordDisabled value=true / /action LoginAction.java: public boolean passwordDisabled = false; public boolean getPasswordDisabled() { return passwordDisabled; } public void setPasswordDisabled(boolean aValue) { passwordDisabled = aValue; } error log: Nov 18, 2003 2:06:14 PM org.apache.commons.digester.SetPropertyRule begin FINE: [SetPropertyRule]{struts-config/action-mappings/action/set-property} Set org.apache.struts.action.ActionMapping property passwordDisabled to true Nov 18, 2003 2:06:14 PM org.apache.commons.digester.Digester startElement SEVERE: Begin event threw exception java.lang.NoSuchMethodException: Bean has no property named passwordDisabled at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:192) at org.apache.commons.digester.Rule.begin(Rule.java:200) at org.apache.commons.digester.Digester.startElement(Digester.java:1273) at weblogic.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:459) at weblogic.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.jav a:221) It looks like it is trying to set the passwordDisabled property in the ActionMapping class instead of the LoginAction class. wtf? I can't find any examples anywhere that set parameters on actions, but according to the dtd, it is valid. Any help is appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Frank Maritato - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem with html:text bean throwing exception
So I have been stuck for a day or so on this exception: org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) etc... caused by: javax.servlet.ServletException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) at org.apache.jsp.enter_0002dlocation_jsp._jspService(enter_0002dlocation_jsp.java:132) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) etc... I think have determined that it happens when attempting to process this tag: % System.out.println (got here);% tdhtml:text property=city maxlength=50 size= 20//td % System.out.println (got here2);% (only the first print statement appears in catalina.out) I am definately able to find the struts-html taglib (as I am already inside an html:form tag by this point). I think I really have a situation where html:form can be found but not html:text for the following reasons: Here is the jasper generated code: 67out.write(hr\n\n); 68if (_jspx_meth_html_form_0(pageContext)) 69 return; 70out.write(\n); 71out.write(table border=\0\\n); 72out.write(tr\n); 73out.write(tdCity:); 74out.write(/td\n); 75 System.out.println (got here); 76out.write(\n); 77out.write(td); 78if (_jspx_meth_html_text_0(pageContext)) 79 return; 80out.write(/td\n); 81 System.out.println (got here2); snip . 127out.write(/html\n); 128 } catch (Throwable t) { 129out = _jspx_out; 130if (out != null out.getBufferSize() != 0) 131 out.clearBuffer(); 132if (pageContext != null) pageContext.handlePageException(t); 133 } finally { 134if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); 135 } snip . 154private boolean _jspx_meth_html_text_0(javax.servlet.jsp.PageContext pageContext) 155throws Throwable { 156 JspWriter out = pageContext.getOut(); 157 /* html:text */ 158 org.apache.struts.taglib.html.TextTag _jspx_th_html_text_0 = (org.apache.struts.taglib.html.TextTag) _jspx_tagPool_html_text_size_property_maxlength.get(org.apache.struts.taglib.html.TextTag.class); 159 _jspx_th_html_text_0.setPageContext(pageContext); 160 _jspx_th_html_text_0.setParent(null); 161 _jspx_th_html_text_0.setProperty(city); 162 _jspx_th_html_text_0.setMaxlength(50); 163 _jspx_th_html_text_0.setSize(20); 164 int _jspx_eval_html_text_0 = _jspx_th_html_text_0.doStartTag(); 165 if (_jspx_th_html_text_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) 166return true; 167 _jspx_tagPool_html_text_size_property_maxlength.reuse(_jspx_th_html_text_0); 168 return false; 169} So I am willing to suppose that out.write() isn't throwing the exception, which leaves only _jspx_meth_html_text_0(pageContext). Looking into that method, I see 3 candidtates: _jspx_tagPool_html_text_size_property_maxlength.get(org.apache.struts.taglib.html.TextTag.class); _jspx_th_html_text_0.doStartTag(); _jspx_th_html_text_0.doEndTag() _jspx_tagPool_html_text_size_property_maxlength.reuse(_jspx_th_html_text_0); The question is why does one of these throw a Servlet exception when form doesnt? Though the form tag hasn't closed yet so it could still be the form tag, when I misname the taglibrary in the JSP I get a different error. I am using Struts 1.1 (downloaded a couple days ago) in Tomcat 4.1.27 with Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28) on a (redhat 9) linux platform. After spending hours tweaking my settings nothing I do seems to effect it and I am begining to suspect a bug, but I find it extremely hard to beleive that there would be a bug relating to html:text since it is one of the most used tags. Can any1 help me out here? -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with html:text bean throwing exception
Have you a vaild formBean define for this html:form in your struts config file ? form-bean name=myForm type=org.myForm/ Is this bean called in your action mapping ? action path=/htmlForm type=org.myAction name=myForm scope=request validate=true input=/page.jsp forward name=success path=/succes.do redirect=true/ /action I've faced a similar issue for these reasons. Carl Gus Heck wrote: So I have been stuck for a day or so on this exception: org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) etc... caused by: javax.servlet.ServletException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) at org.apache.jsp.enter_0002dlocation_jsp._jspService(enter_0002dlocation_jsp.java:132) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) etc... I think have determined that it happens when attempting to process this tag: % System.out.println (got here);% tdhtml:text property=city maxlength=50 size= 20//td % System.out.println (got here2);% (only the first print statement appears in catalina.out) I am definately able to find the struts-html taglib (as I am already inside an html:form tag by this point). I think I really have a situation where html:form can be found but not html:text for the following reasons: Here is the jasper generated code: 67out.write(hr\n\n); 68if (_jspx_meth_html_form_0(pageContext)) 69 return; 70out.write(\n); 71out.write(table border=\0\\n); 72out.write(tr\n); 73out.write(tdCity:); 74out.write(/td\n); 75 System.out.println (got here); 76out.write(\n); 77out.write(td); 78if (_jspx_meth_html_text_0(pageContext)) 79 return; 80out.write(/td\n); 81 System.out.println (got here2); snip . 127out.write(/html\n); 128 } catch (Throwable t) { 129out = _jspx_out; 130if (out != null out.getBufferSize() != 0) 131 out.clearBuffer(); 132if (pageContext != null) pageContext.handlePageException(t); 133 } finally { 134if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); 135 } snip . 154private boolean _jspx_meth_html_text_0(javax.servlet.jsp.PageContext pageContext) 155throws Throwable { 156 JspWriter out = pageContext.getOut(); 157 /* html:text */ 158 org.apache.struts.taglib.html.TextTag _jspx_th_html_text_0 = (org.apache.struts.taglib.html.TextTag) _jspx_tagPool_html_text_size_property_maxlength.get(org.apache.struts.taglib.html.TextTag.class); 159 _jspx_th_html_text_0.setPageContext(pageContext); 160 _jspx_th_html_text_0.setParent(null); 161 _jspx_th_html_text_0.setProperty(city); 162 _jspx_th_html_text_0.setMaxlength(50); 163 _jspx_th_html_text_0.setSize(20); 164 int _jspx_eval_html_text_0 = _jspx_th_html_text_0.doStartTag(); 165 if (_jspx_th_html_text_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) 166return true; 167 _jspx_tagPool_html_text_size_property_maxlength.reuse(_jspx_th_html_text_0); 168 return false; 169} So I am willing to suppose that out.write() isn't throwing the exception, which leaves only _jspx_meth_html_text_0(pageContext). Looking into that method, I see 3 candidtates: _jspx_tagPool_html_text_size_property_maxlength.get(org.apache.struts.taglib.html.TextTag.class); _jspx_th_html_text_0.doStartTag(); _jspx_th_html_text_0.doEndTag() _jspx_tagPool_html_text_size_property_maxlength.reuse(_jspx_th_html_text_0); The question is why does one of these throw a Servlet exception when form doesnt? Though the form tag hasn't closed yet so it could still be the form tag, when I misname the taglibrary in the JSP I get a different error. I am using Struts 1.1 (downloaded a couple days ago) in Tomcat 4.1.27 with Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28) on a (redhat 9) linux platform. After spending hours tweaking my settings nothing I do seems to effect it and I am begining to suspect a bug, but I find it extremely hard to beleive that there would be a bug relating to html:text since it is one of the most used tags. Can any1 help me out here? -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Form data vs request attributes
I don't appear to have to declare customers in the form, but if I don't declare suburb, I get an error... what is the difference? 'suburb' is a form property, Struts will call get/setSuburb as it populates the Form Bean and generates the HTML. 'customers' is a collection of things to be used to populate a select list. It may or may not be a property of this particular form. It can live anywhere-- request scope, application scope, session scope. I don't consider the contents of a select list to be a property of the form, so I don't put it in the form bean. The way you're doing it is fine. If 'customers' never changes, consider using Application scope (a Context attribute). If it varies by user, session scope might work for you. That way you don't have to put it in request scope repeatedly. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: initializing properties for Actions
Frank, I think you are on to something here. Why don't you subclass ActionMapping and in your subclass put your member variable and getter and setter. You can then access the value from your action class's excecute method's mapping parameter after you cast it to your ActionMapping subclass? -Richard -Original Message- From: Frank Maritato [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:47 PM To: Struts Users Mailing List Subject: Re: initializing properties for Actions Carl, That didn't work, but thanks anyway. I also tried changing the data type for passwordDisabled to a String and have the normal get/set methods but that didn't seem to change the outcome either. I think the real problem is that it is trying to call setPasswordDisabled on org.apache.struts.action.ActionMapping instead of my LoginAction class. Not sure if this is a known you can't do that or a known bug or whatever (I'm using struts 1.1.0). I was unable to find any info on this topic either in the archives or on jakarta.apache.org. Carl wrote: I'm not sure that this will solve your pb, but I think you should use public boolean isPasswordDisabled() { return passwordDisabled; } instead of getPasswordDisabled. Carl Frank Maritato wrote: Hi, I'm trying to pass some initialization parameters to an Action and I'm having some trouble. What I want is to be able to tell my LoginAction not to validate passwords for development systems. Here is what I have right now followed by the error I get on startup: struts-config.xml: action path=/login type=action.LoginAction scope=request name=loginForm validate=false input=/login/login.jsp set-property property=passwordDisabled value=true / /action LoginAction.java: public boolean passwordDisabled = false; public boolean getPasswordDisabled() { return passwordDisabled; } public void setPasswordDisabled(boolean aValue) { passwordDisabled = aValue; } error log: Nov 18, 2003 2:06:14 PM org.apache.commons.digester.SetPropertyRule begin FINE: [SetPropertyRule]{struts-config/action-mappings/action/set-property} Set org.apache.struts.action.ActionMapping property passwordDisabled to true Nov 18, 2003 2:06:14 PM org.apache.commons.digester.Digester startElement SEVERE: Begin event threw exception java.lang.NoSuchMethodException: Bean has no property named passwordDisabled at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:192) at org.apache.commons.digester.Rule.begin(Rule.java:200) at org.apache.commons.digester.Digester.startElement(Digester.java:1273) at weblogic.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXPar ser.java:459) at weblogic.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Abstra ctXMLDocumentParser.jav a:221) It looks like it is trying to set the passwordDisabled property in the ActionMapping class instead of the LoginAction class. wtf? I can't find any examples anywhere that set parameters on actions, but according to the dtd, it is valid. Any help is appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Frank Maritato - 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: Form data vs request attributes
ActionForm objects are representation of a form and the data in the form. It holds the values of your INPUT, SELECT, TEXTAREA and other form controls. The options of a SELECT control are only used to help the user choose a value; its only purpose is to give the SELECT control a value and isn't itself a value of the form. Think of it this way: the form doesn't lose any data by changing your SELECT into an INPUT type=text. Confused? Think of it another way: The OPTION values don't get submitted, only the value of the SELECT. So: 1) The ActionForm helps you get to the values submitted with the form, and so suburb is required there because it's part of the form. 2) The ActionForm doesn't hold OPTION values, only the value of the SELECT. 3) You need a way to tell html:options what to show, and you can do it by specifying a collection that's in scope (doesn't have to be the request scope). Hope all that didn't confuse you further. --- Craig Edwards [EMAIL PROTECTED] wrote: I've been fiddling around with Struts for a while now and am still a little puzzled as to whether JSPs should be getting their data from my DynaActionForm or from the session/request context. For example, if my JSP contains: html:select property=selectedCustomer size=5 html:options collection=customers property=id/ /html:select html:text property=suburb size=16 maxlength=18/ The way I have this working currently is by adding customers to the request context and by having suburb declared in my DynaActionForm. I don't appear to have to declare customers in the form, but if I don't declare suburb, I get an error... what is the difference? P.S. If it helps clarify things, the JSP I have displays a list of customers and some input fields. The user can update the input fields, press submit and they see the same page (with the new details displayed in the list). Many thanks. -- Craig Edwards Sydney, Australia __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Form data vs request attributes
Although, I don't really see a major problem with storing the options in the form itself (just to make things simple). Anybody have a compelling reason NOT to do this? i.e. I put my statesCollection as a property on my ActionForm with a List datatype. Then I can just use the form property to populate my options. worse is better -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 6:10 PM To: Struts Users Mailing List Subject: Re: Form data vs request attributes ActionForm objects are representation of a form and the data in the form. It holds the values of your INPUT, SELECT, TEXTAREA and other form controls. The options of a SELECT control are only used to help the user choose a value; its only purpose is to give the SELECT control a value and isn't itself a value of the form. Think of it this way: the form doesn't lose any data by changing your SELECT into an INPUT type=text. Confused? Think of it another way: The OPTION values don't get submitted, only the value of the SELECT. So: 1) The ActionForm helps you get to the values submitted with the form, and so suburb is required there because it's part of the form. 2) The ActionForm doesn't hold OPTION values, only the value of the SELECT. 3) You need a way to tell html:options what to show, and you can do it by specifying a collection that's in scope (doesn't have to be the request scope). Hope all that didn't confuse you further. --- Craig Edwards [EMAIL PROTECTED] wrote: I've been fiddling around with Struts for a while now and am still a little puzzled as to whether JSPs should be getting their data from my DynaActionForm or from the session/request context. For example, if my JSP contains: html:select property=selectedCustomer size=5 html:options collection=customers property=id/ /html:select html:text property=suburb size=16 maxlength=18/ The way I have this working currently is by adding customers to the request context and by having suburb declared in my DynaActionForm. I don't appear to have to declare customers in the form, but if I don't declare suburb, I get an error... what is the difference? P.S. If it helps clarify things, the JSP I have displays a list of customers and some input fields. The user can update the input fields, press submit and they see the same page (with the new details displayed in the list). Many thanks. -- Craig Edwards Sydney, Australia __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - This message and its contents (to include attachments) are the property of Kmart Corporation (Kmart) and may contain confidential and proprietary information. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on information contained herein is strictly prohibited. Unauthorized use of information contained herein may subject you to civil and criminal prosecution and penalties. If you are not the intended recipient, you should delete this message immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:message MessageFormat and number formating
Hi, I've recently switch to a resource.properties file to externalize all text from jsp (in the perspective of translation of the site) The site is a classic e-commerce web site, so I dsiplay a Cart and the amount of the products in the custumer's cart. In my old jsp I wrote : fmt:formatNumber value=${total} type=CURRENCY/ in order to format the price in a sentence like Total amount $ 150. Now I'm writting cart.amount=Total amount {0}. in the resource.properties. And in the JSP : bean-el:message key=cart.amount arg0=${user.amount}/ finally I loose the price formatting porvided by the fmt:formatNumber tag. Is there a way to use a MessageFormat and have the parameters formatted like fmt:formatNumber do ? Thanks for all suggestions, Carl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ExceptionHandler example
Hi, Can anyone please send me an example for ExceptionHandler? I need to to know what goes in teh config file, the action class and the other files. TX, S P - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ExceptionHandler example
Check this article out: http://javaboutique.internet.com/tutorials/excep_struts/index-7.html -Richard -Original Message- From: Sharmila Pandith [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 3:34 PM To: [EMAIL PROTECTED] Subject: ExceptionHandler example Hi, Can anyone please send me an example for ExceptionHandler? I need to to know what goes in teh config file, the action class and the other files. TX, S P - 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: initializing properties for Actions
From: Frank Maritato [mailto:[EMAIL PROTECTED] I think the real problem is that it is trying to call setPasswordDisabled on org.apache.struts.action.ActionMapping instead of my LoginAction class. I remember being confused about this, too. When struts-config.xml gets run through the Digester, an action tag causes the creation of an ActionMapping object. So any properties you specify in action are part of an ActionMapping object. An ActionMapping has a 'type' property that is the class name of the Action that will be created. (Type actually comes from ActionConfig.) Later, some other part of Struts will call getType() on the ActionMapping object and will instantiate your Action class. How do you create your own ActionMappings? I know I read it somewhere... It's covered in chapter 7 of Struts in Action but I can't find more than this in the Struts docs: http://jakarta.apache.org/struts/userGuide/building_controller.html I generally just use context-param (in web.xml) and context.getInitParameter(). -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Form data vs request attributes
From: Mainguy, Mike [mailto:[EMAIL PROTECTED] Although, I don't really see a major problem with storing the options in the form itself (just to make things simple). Anybody have a compelling reason NOT to do this? i.e. I put my statesCollection as a property on my ActionForm with a List datatype. Then I can just use the form property to populate my options. Every time Struts instantiates your Form object, it also creates that list of states. If you have 'state' on more than one form, there's another list, times how ever many users have forms going at any one time. Since the list of states is unlikely to change, I think it makes more sense to put the list in application scope (as a context parameter) and have only one instance of it. However, memory is cheap, so it's probably not going to matter where you put it as long as you're happy with your decision. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSTL DynaValidatorForm
Hi, For x and y reasons I've to create my own version of the c:out tag. Everything is working great for everything BUT DynaValidatorForm where I get Unable to find a value for value in object of class org.apache.struts.validator.DynaValidatorForm using operator . I'm using the evaluate method part of org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager to obtain the EL values. I tried the jars part of the Jakarta TagLib, and the ones provided within the Struts EL. Both with the same result. I bet it's a stupid thing I overlooked. Now here is the funny part: the c:out tag, which is supposedly using the same code, doesn't seem to have the same issue... Here is the exception stack: javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute value with value ${manageForm.value}: Unable to find a value for value in object of class org.apache.struts.validator.DynaValidatorForm using operator . (null) at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:146) at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:166) at org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:112) This is the call crashing: value = ExpressionEvaluatorManager.evaluate(value, value_, Object.class, this, pageContext); Thanks the help, Yann
RE: Form data vs request attributes
The reason I don't do this is because if the form is in session scope, it hangs around consuming memory until the session goes away. As a caching mechanism, this bites rocks, because it is cached for each user. :-/ By putting this type of stuff in request scope instead of on the form, it becomes transient regardless of where the form resides. But if you use a DAO layer with caching (like iBATIS), one copy of this stuff can be cached (globally) so you are not hitting the database all the time. Larry [EMAIL PROTECTED] 11/18/03 4:41 PM From: Mainguy, Mike [mailto:[EMAIL PROTECTED] Although, I don't really see a major problem with storing the options in the form itself (just to make things simple). Anybody have a compelling reason NOT to do this? i.e. I put my statesCollection as a property on my ActionForm with a List datatype. Then I can just use the form property to populate my options. Every time Struts instantiates your Form object, it also creates that list of states. If you have 'state' on more than one form, there's another list, times how ever many users have forms going at any one time. Since the list of states is unlikely to change, I think it makes more sense to put the list in application scope (as a context parameter) and have only one instance of it. However, memory is cheap, so it's probably not going to matter where you put it as long as you're happy with your decision. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - 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: Including multiple servlets from a jsp page.[Now: Tiles Help]
Thank you very much! That was exactly what I needed. Now I just need a little advice on working with Tiles. Do I need to have a tiles definition for every single different view? I will give a small example. definition name=page.default path=/templates/index.jsp put name=head value=/common/head.jsp / put name=centersection value=center.section / put name=bottomtable value=/common/bottomtable.jsp / /definition definition name=center.section path=/templates/centersection.jsp put name=leftbar value=left.bar / put name=mainsection value=/common/mainsection.jsp / /definition definition name=left.bar path=/templates/leftbar.jsp put name=first value=/common/navigation.jsp / put name=second value=list.events / /definition This will give me the look for my front page. But lets say once you log in, you have a different 'left.bar'. So I would have to add: definition name=login.page.default extends=stinkytoe.default put name=centersection value=login.center.section / /definition definition name=login.center.section extends=center.section put name=leftbar value=login.left.bar / /definition definition name=login.left.bar extends=left.bar put name=second value=/common/userinfo.jsp / /definition That seems like a ton of work for each new view. If my 'mainsection' is my content area, that means I need to add 2 definitions for each new content page? Is there a way to dynamically insert a page as the 'mainsection' Am I missing something here? Thanks again, Chris Hubert Rabago wrote: Tiles is one way to do it. Take a look at the Tiles Controller. http://jakarta.apache.org/struts/api/org/apache/struts/tiles/Controller.html Check out http://www.theserverside.com/resources/article.jsp?l=Tiles101 for some explanation on it. --- Chris Blackburn [EMAIL PROTECTED] wrote: I am trying to build a web page that will have multiple dynamic content fed from multiple servlets. I thought I could just do something like: -- index.jsp -- c:import url=top.jsp/ c:import url=/servlet1.do/ c:import url=/servlet2.do/ c:import url=bottom.jsp/ -- end -- What I would like to happen is have the struts servlet be run, and have the resulting jsp page (defined in the forward section of my struts-config.xml) be imported into that spot. This works just fine if there is only one servlet being called, but fails if there are more. The error is Cannot forward after result has been committed. What do I need to do? Do I need to look at something like tiles? Any help, or references to some help would be great. Thanks, Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - 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: problem with html:text bean throwing exception
I believe so... Here is my config and some of the relevant directory tree... The action for NewLocation appears to successfully take me to the AddLocation page. (it only forwards right now). form-beans form-bean name=addLocationForm type=org.cs101.fdb.struts.form.AddLocationForm / form-bean name=blankForm type=org.cs101.fdb.struts.form.BlankForm / /form-beans !-- == Action Mapping Definitions == -- action-mappings action path=/prototypes/AddLocation type=org.cs101.fdb.struts.action.AddLocationAction name=addLocationForm scope=request validate=true input=/prototypes/enter-location.jsp forward name=error path=/prototypes/enter-location.jsp / /action action path=/prototypes/NewLocation type=org.cs101.fdb.struts.action.NewLocationAction name=blankForm scope=request validate=true input=/prototypes/index.jsp forward name=addLocation path=/prototypes/enter-location.jsp / /action /action-mappings [EMAIL PROTECTED] build]$ find . -name *ocation* ./WEB-INF/classes/org/cs101/fdb/model/Location.class ./WEB-INF/classes/org/cs101/fdb/struts/form/AddLocationForm.class ./WEB-INF/classes/org/cs101/fdb/struts/action/AddLocationAction.class ./WEB-INF/classes/org/cs101/fdb/struts/action/NewLocationAction.class ./prototypes/enter-location.jsp [EMAIL PROTECTED] build]$ find . -name *lank* ./WEB-INF/classes/org/cs101/fdb/struts/form/BlankForm.class [EMAIL PROTECTED] build]$ Carl wrote: Have you a vaild formBean define for this html:form in your struts config file ? form-bean name=myForm type=org.myForm/ Is this bean called in your action mapping ? action path=/htmlForm type=org.myAction name=myForm scope=request validate=true input=/page.jsp forward name=success path=/succes.do redirect=true/ /action I've faced a similar issue for these reasons. Carl Gus Heck wrote: So I have been stuck for a day or so on this exception: org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) etc... caused by: javax.servlet.ServletException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) at org.apache.jsp.enter_0002dlocation_jsp._jspService(enter_0002dlocation_jsp.java:132) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) etc... I think have determined that it happens when attempting to process this tag: % System.out.println (got here);% tdhtml:text property=city maxlength=50 size= 20//td % System.out.println (got here2);% (only the first print statement appears in catalina.out) I am definately able to find the struts-html taglib (as I am already inside an html:form tag by this point). I think I really have a situation where html:form can be found but not html:text for the following reasons: Here is the jasper generated code: 67out.write(hr\n\n); 68if (_jspx_meth_html_form_0(pageContext)) 69 return; 70out.write(\n); 71out.write(table border=\0\\n); 72out.write(tr\n); 73out.write(tdCity:); 74out.write(/td\n); 75 System.out.println (got here); 76out.write(\n); 77out.write(td); 78if (_jspx_meth_html_text_0(pageContext)) 79 return; 80out.write(/td\n); 81 System.out.println (got here2); snip . 127out.write(/html\n); 128 } catch (Throwable t) { 129out = _jspx_out; 130if (out != null out.getBufferSize() != 0) 131 out.clearBuffer(); 132if (pageContext != null) pageContext.handlePageException(t); 133 } finally { 134if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); 135 } snip . 154private boolean _jspx_meth_html_text_0(javax.servlet.jsp.PageContext pageContext) 155throws Throwable { 156 JspWriter out = pageContext.getOut(); 157 /* html:text */ 158 org.apache.struts.taglib.html.TextTag _jspx_th_html_text_0 = (org.apache.struts.taglib.html.TextTag) _jspx_tagPool_html_text_size_property_maxlength.get(org.apache.struts.taglib.html.TextTag.class); 159 _jspx_th_html_text_0.setPageContext(pageContext); 160 _jspx_th_html_text_0.setParent(null); 161 _jspx_th_html_text_0.setProperty(city); 162 _jspx_th_html_text_0.setMaxlength(50); 163 _jspx_th_html_text_0.setSize(20); 164 int
RE: initializing properties for Actions
Frank, I tried subclassing ActionMapping and setting the type attribute in the struts config action-mappings tag. The runtime error goes away but the setter method never gets called. It could be a bug. -Richard -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 3:10 PM To: 'Struts Users Mailing List' Subject: RE: initializing properties for Actions Frank, I think you are on to something here. Why don't you subclass ActionMapping and in your subclass put your member variable and getter and setter. You can then access the value from your action class's excecute method's mapping parameter after you cast it to your ActionMapping subclass? -Richard -Original Message- From: Frank Maritato [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:47 PM To: Struts Users Mailing List Subject: Re: initializing properties for Actions Carl, That didn't work, but thanks anyway. I also tried changing the data type for passwordDisabled to a String and have the normal get/set methods but that didn't seem to change the outcome either. I think the real problem is that it is trying to call setPasswordDisabled on org.apache.struts.action.ActionMapping instead of my LoginAction class. Not sure if this is a known you can't do that or a known bug or whatever (I'm using struts 1.1.0). I was unable to find any info on this topic either in the archives or on jakarta.apache.org. Carl wrote: I'm not sure that this will solve your pb, but I think you should use public boolean isPasswordDisabled() { return passwordDisabled; } instead of getPasswordDisabled. Carl Frank Maritato wrote: Hi, I'm trying to pass some initialization parameters to an Action and I'm having some trouble. What I want is to be able to tell my LoginAction not to validate passwords for development systems. Here is what I have right now followed by the error I get on startup: struts-config.xml: action path=/login type=action.LoginAction scope=request name=loginForm validate=false input=/login/login.jsp set-property property=passwordDisabled value=true / /action LoginAction.java: public boolean passwordDisabled = false; public boolean getPasswordDisabled() { return passwordDisabled; } public void setPasswordDisabled(boolean aValue) { passwordDisabled = aValue; } error log: Nov 18, 2003 2:06:14 PM org.apache.commons.digester.SetPropertyRule begin FINE: [SetPropertyRule]{struts-config/action-mappings/action/set-property} Set org.apache.struts.action.ActionMapping property passwordDisabled to true Nov 18, 2003 2:06:14 PM org.apache.commons.digester.Digester startElement SEVERE: Begin event threw exception java.lang.NoSuchMethodException: Bean has no property named passwordDisabled at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:192) at org.apache.commons.digester.Rule.begin(Rule.java:200) at org.apache.commons.digester.Digester.startElement(Digester.java:1273) at weblogic.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXPar ser.java:459) at weblogic.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Abstra ctXMLDocumentParser.jav a:221) It looks like it is trying to set the passwordDisabled property in the ActionMapping class instead of the LoginAction class. wtf? I can't find any examples anywhere that set parameters on actions, but according to the dtd, it is valid. Any help is appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Frank Maritato - 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: Form data vs request attributes
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... The options of a SELECT control are only used to help the user choose a value; its only purpose is to give the SELECT control a value and isn't itself a value of the form. Think of it this way: the form doesn't lose any data by changing your SELECT into an INPUT type=text. Confused? Think of it another way: The OPTION values don't get submitted, only the value of the SELECT. Ahh, that make sense. Thanks. A followup question if I can... The ActionMapping that my XXXAction returns forwards to the same XXX.jsp that was used as the original input for XXXAction. I have noticed that, in XXXAction, if I change the value of one of the ActionForm variables, the JSP will plug the new value into the INPUT when it serves it back to the user. That's sort of neat, but it makes me wonder what will happen if an ActionMapping from another unrelated Action forwards to XXX.jsp. The other action may well have setup the customers variable in the context, but it is unlikely that it will have the same form as XXXAction. What happens in this case? Thanks again. -- Craig Edwards Sydney, Australia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: MySql BasicDataSource Connection
U r welcome :) That configuration I just adopt it from the information at struts-documentation.war from the binary distribution of struts. http://localhost:8080/struts-documentation/faqs/database.html I install it on Tomcat 4.1.29 using default port. best regards -GI. - Original Message - From: Pacheco, Brent [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 5:38 AM Subject: RE: MySql BasicDataSource Connection Gede, Thanks so much for your help! The problem was that I had the property listed as driverClass instead of driverClassName, so the BasicDataSource couldn never locate my driver. When I fixed that, it fired right up. Thanks again!! Brent -Original Message- From: Gede Indrawan [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 10:11 PM To: Struts Users Mailing List Subject: Re: MySql BasicDataSource Connection I use data-source defintion below and no problem with it data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=org.gjt.mm.mysql.Driver/ set-property property=url value=jdbc:mysql://localhost/telkomsel/ set-property property=maxCount value=5/ set-property property=minCount value=1/ set-property property=username value=root/ set-property property=password value=blahblah/ /data-source - Original Message - From: Pacheco, Brent [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Saturday, November 15, 2003 12:31 AM Subject: MySql BasicDataSource Connection Howdy! I'm using Struts 1.1 in WebSphere and I'm attempting to replace the GenericDataSource connection pool in my struts-config.xml file with a BasicDataSource connection pool to hit a mySQL database, but I keep getting an error. The data-source defintion in my struts-config.xml file is as follows: data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=autoCommit value=false/ set-property property=key value=1 / set-property property=description value=1 / set-property property=driverClass value=org.gjt.mm.mysql.Driver / set-property property=maxWait value=10 / set-property property=maxCount value=10 / set-property property=minCount value=2 / set-property property=url value=jdbc:mysql://localhost:3306/NOL / set-property property=user value=** / set-property property=password value=** / /data-source /data-sources I have placed the commons-dbcp.jar and commons-pool.jar in my classpath, as well as the native mySql driver. There's no problem when using the GenericDataSource, but as soon as I change to the BasicDataSource, I get the following error when starting up the server: [11/14/03 11:30:04:702 CST] 66ad7043 ActionServlet E org.apache.struts.action.ActionServlet TRAS0014I: The following exception was logged org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'jdbc:mysql://localhost:3306/NOL', cause: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getDriver(DriverManager.java:266) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:743) at org.apache.commons.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:57 6) at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j ava:1087) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletIn stance.java:82) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycle Servlet.java:147) at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecy cleServlet.java:270) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleS ervlet.java:113) at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:17 5) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServlet Manager.java:761) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServle tManager.java:257) at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadAutoLoadServlets(Web AppServletManager.java:453) at com.ibm.ws.webcontainer.webapp.WebApp.loadServletManager(WebApp.java:1233) at com.ibm.ws.webcontainer.webapp.WebApp.init(WebApp.java:273) at com.ibm.ws.webcontainer.srt.WebGroup.loadWebApp(WebGroup.java:317) at com.ibm.ws.webcontainer.srt.WebGroup.init(WebGroup.java:194) at
OO Struts
I am designing my first struts application, but I have been a java developer for about 5 years. I am actually refactoring a survey app. I wrote. The way struts was explained to me was my ActionForms were like my Transfer objects and my actions were just that, the action that was requested... storing in the database. With that said, how would I handle building a survey object (surveyForm) that had N number of question objects which in turn had N number of answer objects? I am really confused. Thanks for any insight. travis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
anyone using jstl side by side with the strut taglibs?
Hi, I'm nearing the end of a prototype for my first Struts application. At first, I used JSTL to handle most of my iteration, declarations, and conditional operations. Then, as I learnt more about the Struts taglibs, I decided to simply use the Struts libraries, for the sake of consistency with the framework. Does anyone regularly combine JSTL and Struts taglib usage? I'm curious as to whether or not it's an effective approach; I think it could perhaps lead to confusion when developers first begin working on an application using both libraries. Regards, Nick Faiz B2B e-Commerce Developer Corporate Express Australia Ltd. Phone: +61-2-9335-0495, Fax: 9335-0753, Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: anyone using jstl side by side with the strut taglibs?
Once you use EL, you don't have much of a choice than to use them side-by-side. Nick Faiz wrote: Hi, I'm nearing the end of a prototype for my first Struts application. At first, I used JSTL to handle most of my iteration, declarations, and conditional operations. Then, as I learnt more about the Struts taglibs, I decided to simply use the Struts libraries, for the sake of consistency with the framework. Does anyone regularly combine JSTL and Struts taglib usage? I'm curious as to whether or not it's an effective approach; I think it could perhaps lead to confusion when developers first begin working on an application using both libraries. Regards, Nick Faiz B2B e-Commerce Developer Corporate Express Australia Ltd. Phone: +61-2-9335-0495, Fax: 9335-0753, Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: anyone using jstl side by side with the strut taglibs?
Thanks Brice, I just checked out Struts-EL. I think I'll begin using it with JSTL. Nick -Original Message- From: Brice Ruth [mailto:[EMAIL PROTECTED] Sent: Wednesday, 19 November 2003 12:36 PM To: Struts Users Mailing List Subject: Re: anyone using jstl side by side with the strut taglibs? Once you use EL, you don't have much of a choice than to use them side-by-side. Nick Faiz wrote: Hi, I'm nearing the end of a prototype for my first Struts application. At first, I used JSTL to handle most of my iteration, declarations, and conditional operations. Then, as I learnt more about the Struts taglibs, I decided to simply use the Struts libraries, for the sake of consistency with the framework. Does anyone regularly combine JSTL and Struts taglib usage? I'm curious as to whether or not it's an effective approach; I think it could perhaps lead to confusion when developers first begin working on an application using both libraries. Regards, Nick Faiz B2B e-Commerce Developer Corporate Express Australia Ltd. Phone: +61-2-9335-0495, Fax: 9335-0753, Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - 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: anyone using jstl side by side with the strut taglibs?
Brice Ruth wrote: Once you use EL, you don't have much of a choice than to use them side-by-side. For the benefit of us noobs... what is EL? -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
what is the right way to test whether execute() is called after validate()?
I'm sorry if this is too basic, I'm still really green. I'm validating a form. This form is used for adding and editing widgets. I use the same actionHandler, where I test a request parameter and set up the form accordingly. It builds my form object and either resets it for an add, or retrieves a widget from the DB and sticks it in my object. What I found was, when my validation failed on add or edit, it was still going thru the execute() method of my actionHandler and was therefore reset()ing on add or re-building my form object on edit. So, I put in something like this instead: if ((request.getParameter(Submit) == null) || (!request.getParameter(Submit).equals(Submit))) { if (request.getParameter(addEdit).equals(edit)) { form = buildCompanyForm(request.getParameter(id), request); } else { form = new CompanyForm(); form.reset(mapping, request); } } And it works, but testing whether Submit has been pressed seems kinda nasty. I'd like to learn a better way. Thanks in advance, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: anyone using jstl side by side with the strut taglibs?
Gus, http://jakarta.apache.org/struts/userGuide/building_view.html#struts-el EL is an acronym for `Expression Language'. Nick -Original Message- From: Gus Heck [mailto:[EMAIL PROTECTED] Sent: Wednesday, 19 November 2003 12:37 PM To: Struts Users Mailing List Subject: Re: anyone using jstl side by side with the strut taglibs? Brice Ruth wrote: Once you use EL, you don't have much of a choice than to use them side-by-side. For the benefit of us noobs... what is EL? -Gus - 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]