RE: Using modules and actionforward to an action
BTW what is contextRelative=true all about .. ?? -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 10:54 AM To: Struts Users Mailing List Subject: RE: Using modules and actionforward to an action abhinav, the best solution is to keep /logout as global-forward in all of you module configs. then you can call mapping.findForward(/logout) from any modules's action. HTH Navjot Singh |-Original Message- |From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED] |Sent: Thursday, June 26, 2003 10:29 AM |To: Struts Users Mailing List |Subject: RE: Using modules and actionforward to an action | | |no ... | |-Original Message- |From: Sergey Smirnov [mailto:[EMAIL PROTECTED] |Sent: Thursday, June 26, 2003 10:27 AM |To: Struts Users Mailing List |Subject: Re: Using modules and actionforward to an action | | |Do you use contextRelative=true to switch between modules? | |- Original Message - |From: Abhinav (Cognizant) [EMAIL PROTECTED] |To: Struts Users Mailing List [EMAIL PROTECTED] |Sent: Wednesday, June 25, 2003 9:29 PM |Subject: Using modules and actionforward to an action | | | | |For logging out I use this piece of code : | |RequestUtils.selectModule(, req, |getServlet().getServletContext()); |return (new ActionForward(/AuthFail.jsp)); | |I don't want to hardcode /AuthFail.jsp |instead of that i want to forward to an action /logout defined in the |default servlet-config.xml |I tried this |return (new ActionForward(/logout)); |and in the servlet-config.xml |action |path=/logout |type=actions.LoginAction |--- |--- | |/action |but no success. | |Suggestions ... | | | | | |--- |- | | | | - | 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] ** Message from InterScan E-Mail VirusWall NT ** ** No virus found in attached file noname.htm No Virus detected in the attached file(s). * End of message *** This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using modules and actionforward to an action
say your context is /myapp you have module /modA and you have 2 files /myapp/login.jsp /myapp/modA/login.jsp if in modules' struts config, you say contextRelative=true, it will pick the first one. otherwsie, second one. RTM -navjot |-Original Message- |From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED] |Sent: Thursday, June 26, 2003 11:38 AM |To: Struts Users Mailing List |Subject: RE: Using modules and actionforward to an action | | |BTW | what is contextRelative=true all about .. ?? | |-Original Message- |From: Navjot Singh [mailto:[EMAIL PROTECTED] |Sent: Thursday, June 26, 2003 10:54 AM |To: Struts Users Mailing List |Subject: RE: Using modules and actionforward to an action | | |abhinav, the best solution is to keep /logout as global-forward in all of |you module configs. |then you can call mapping.findForward(/logout) from any |modules's action. | |HTH |Navjot Singh | ||-Original Message- ||From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED] ||Sent: Thursday, June 26, 2003 10:29 AM ||To: Struts Users Mailing List ||Subject: RE: Using modules and actionforward to an action || || ||no ... || ||-Original Message- ||From: Sergey Smirnov [mailto:[EMAIL PROTECTED] ||Sent: Thursday, June 26, 2003 10:27 AM ||To: Struts Users Mailing List ||Subject: Re: Using modules and actionforward to an action || || ||Do you use contextRelative=true to switch between modules? || ||- Original Message - ||From: Abhinav (Cognizant) [EMAIL PROTECTED] ||To: Struts Users Mailing List [EMAIL PROTECTED] ||Sent: Wednesday, June 25, 2003 9:29 PM ||Subject: Using modules and actionforward to an action || || || || ||For logging out I use this piece of code : || ||RequestUtils.selectModule(, req, ||getServlet().getServletContext()); ||return (new ActionForward(/AuthFail.jsp)); || ||I don't want to hardcode /AuthFail.jsp ||instead of that i want to forward to an action /logout defined in the ||default servlet-config.xml ||I tried this ||return (new ActionForward(/logout)); ||and in the servlet-config.xml ||action ||path=/logout ||type=actions.LoginAction ||--- ||--- || ||/action ||but no success. || ||Suggestions ... || || || || || ||--- ||- || || || || - || 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]
submitting back to opener page
hi, i have a jsp with a button which opens up a new pop-up window. when i say submit on the pop-up window , i want to close the pop-up window andgo to the action class(do the needful) and now i want to refresh the opener page(main jsp). can i do this, if yes how?? any ideas... --nagi Nagendra Kumar O V S Member Technical Staff Ikigo India Private Ltd. 470-B, Road No. 36, Jubilee Hills, Hyderabad 500033 Contact(O): 23544671 Cell: 98482-41789 IncrediMail - Email has finally evolved - Click Here
RE: submitting back to opener page
My app had a similar requirement so what I did was have the popup submit directly to the action and then the action returned a forward to a page (displayed in the popup) that had javascript to invoke a refresh method in the opener window and then to close its own (popup) window. -Original Message- From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 June 2003 14:13 To: [EMAIL PROTECTED] Subject: submitting back to opener page hi, i have a jsp with a button which opens up a new pop-up window. when i say submit on the pop-up window , i want to close the pop-up window and go to the action class(do the needful) and now i want to refresh the opener page(main jsp). can i do this, if yes how?? any ideas... --nagi Nagendra Kumar O V S Member Technical Staff Ikigo India Private Ltd. 470-B, Road No. 36, Jubilee Hills, Hyderabad 500033 Contact(O): 23544671 Cell: 98482-41789 IncrediMail - Email has finally evolved - Click Here
iteration to create dynamic form
I have a logic:iterate tag which is supposed to create a dynamic form, filled with a checkbox for every object in a collection. (The checkbox is an option to delete one of those records from the database.) The form itself is a Map-Backed Action form with two methods (public void setValue(String key, Object value) and public Object getValue(String key)). logic:iterate id=record name=user property=siteSection.newRecords % (dataobjects.Record) l = (dataobjects.Record)pageContext.findAttribute(record); String name= new String(value( + r.getID()+)); % tr height=30 td align=center html:checkbox value=off property=%=name% onclick=CheckMBRow(this)/ /td td ..other stuff describing the record../td /tr /logic:iterate Is there a way in Struts to do this without calling the record object from the pageContext? Can't I get the html:checkbox tag to recognize the 'record' bean directly without using that scriptlet and then creating a String to set the appropriate mapped value? Best, Piers
RE: submitting back to opener page
If you want to submit the form in the original page, you can try javascript like: window.opener.document.forms[0].submit(); If you need to first set some values from the child window: window.opener.document.forms[0].elements[field name].value = value from child HTH -jaafar ps: Matt will probably correct me to forms[0][field name] above. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 2:22 AM To: Struts Users Mailing List Subject: RE: submitting back to opener page My app had a similar requirement so what I did was have the popup submit directly to the action and then the action returned a forward to a page (displayed in the popup) that had javascript to invoke a refresh method in the opener window and then to close its own (popup) window. -Original Message- From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 June 2003 14:13 To: [EMAIL PROTECTED] Subject: submitting back to opener page hi, i have a jsp with a button which opens up a new pop-up window. when i say submit on the pop-up window , i want to close the pop-up window and go to the action class(do the needful) and now i want to refresh the opener page(main jsp). can i do this, if yes how?? any ideas... --nagi Nagendra Kumar O V S Member Technical Staff Ikigo India Private Ltd. 470-B, Road No. 36, Jubilee Hills, Hyderabad 500033 Contact(O): 23544671 Cell: 98482-41789 IncrediMail - Email has finally evolved - Click Here - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: iteration to create dynamic form
try with multibox instead of checkbox: http://jakarta.apache.org/struts/struts-html.html#multibox -jaafar -Original Message- From: Piers Dunleavy [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 2:32 AM To: Struts Users Mailing List Subject: iteration to create dynamic form I have a logic:iterate tag which is supposed to create a dynamic form, filled with a checkbox for every object in a collection. (The checkbox is an option to delete one of those records from the database.) The form itself is a Map-Backed Action form with two methods (public void setValue(String key, Object value) and public Object getValue(String key)). logic:iterate id=record name=user property=siteSection.newRecords % (dataobjects.Record) l = (dataobjects.Record)pageContext.findAttribute(record); String name= new String(value( + r.getID()+)); % tr height=30 td align=center html:checkbox value=off property=%=name% onclick=CheckMBRow(this)/ /td td ..other stuff describing the record../td /tr /logic:iterate Is there a way in Struts to do this without calling the record object from the pageContext? Can't I get the html:checkbox tag to recognize the 'record' bean directly without using that scriptlet and then creating a String to set the appropriate mapped value? Best, Piers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define and JSP 1.1 restriction
Hi all, I can read in struts-bean doc this usage note for bean:define tag : There is a restriction in the JSP 1.1 Specification that disallows using the same value for an id attribute more than once in a single JSP page. Therefore, you will not be able to use bean:define for the same bean name more than once in a single page. Some of my JSPs use bean:define to compute a boolean value from other datas that is use in a logic tag later in JSP. It looks like this : bean:define id=dolink value=false/ logic:equal bean:define id=dolink value=true/ /logic:equal This code works fine on tomcat 4.1.24 and weblogic 6.1 SP5. Reading the usage note, it should not work according to JSP 1.1 spec. Someone in my team uses tomcat 4.0.6 and got errors with this mutliple bean:define. - Does JSP 1.2 has this restriction to ? - Do you think I should upgrade my JSP to be JSP 1.1 compliant, assuming it works fine on target container (Weblogic) - How to avoid using multiple times the same id (Do I need to build a custiom tag ?) Nico. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question - how many of us?
Wow - average 70 to 100 thousand downloads per month according to those stats. Presume average 80,000 per month for the last 12 months, even if only 25% of the downloads lead to people using struts, that's 12 * 0.25 * 8 = 240,000 users. OK so there's some way to go yet before struts achieves the same market saturation as Windows ;) Craig R. McClanahan wrote: On Wed, 25 Jun 2003, Igor Shabalov wrote: Date: Wed, 25 Jun 2003 10:04:24 -0700 From: Igor Shabalov [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Question - how many of us? Do anybody have any idea how many Struts users exists or how many downloads of Struts runtime per month we have now? It's pretty hard to track stuff like this, but here's a few nuggets: * Currently there are 2744 subscribers to STRUTS-USER (plus an unknown number who read it through newsfeed mirrors). It's the largest user mailing list at Jakarta, exceeding TOMCAT-USER that has ~2400. * Download counts are really hard to accumulate now that we are using the mirroring system, but last summer Struts was averaging 8-9000 downloads per month. I expect that number is somewhat higher now. * The upcoming 1.1 final release will probably send that number through the roof, at least temporarily :-). * Vadim Gritsenko accumulates and posts some high level statistics for Apache web sites that can be interesting to peruse: http://www.apache.org/~vgritsenko/stats/index.html Struts definitely shows up as an active project there too. Craig - 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]
LookupDispatchAction question part2
i had posted a question i think 3 days ago about submitting a form to a LookupDispatchAction without hitting any button and still having a default value of the parameter handler. someone advised me (im sorry i forgot your name) that i should have a hidden property of my parameter name, so that eventhough i hit the enter button the submitted form will go to the method of the action corresponding to the default value of the parameter i specified. and it worked! but i have the same problem again with a little twistin my jsp i have a display of collection in a tabular form, and each record has a link going to an lookupdispatchaction that will edit its contents. i used html:link action=/holiday.do paramId=id paramName=holiday paramProperty=holidayId/, but everytime i click this link im having the same exception as before Request[/holiday] does not contain handler parameter named action. i put a hidden property of action eventhough i know that wont work coz link doesnt submit the form. how will i solve this? -- Frances Aleah Z. De Guzman SA/Programmer Ingenium Technology, Inc. http://www.ingenium.com.ph Disclaimer : This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Looking for ideas for action servlet checking for logged in user.
The drawback to using filters compared to security constraints is that you would have to roll your own login mechanism - which seems unnecessary when you could use the container's authentication method. Did you mention having to change Tomcat to get it to use your JDBC realm? I'm not sure quite what you mean, but yes I suppose if you have a complex realm module and you're not going to use container-managed security, I guess filters or constraints would be just as good. Adam Michael Remijan wrote: Filters have mapping patterns just like servlets have mapping patters (take a look at the web.xml DTD). So like you say servlet Foo is mapped to *.foo or /foo/* you can map a filter to urls as well. So if you have a directory in your webapp named secure. can protect all the jsp pages in that directory with the mapping /secure/*. similarly, you can add the mappings of servlets to protect them in the same way. Michael. -Original Message- From: Jing Zhou [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 11:54 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. This is an interesting use of Filters. Our action mappings have an attribute, 'privileged'. When the privileged attribute is set to true, users only with a true privileged mode in his/her action tracking (in the user's session) can execute the corresponding actions. Can a filter be easily bound to the dynamic security requirements as shown above? and in what ways, any ideas? Jing - Original Message - From: Michael Remijan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:49 AM Subject: RE: Looking for ideas for action servlet checking for logged in user. I've found using security constraints to be a little cumbersome, especially since it requires some moderate modification of tomcat to put in a jdbc realm that fits your needs. My preference is to use Filters. A filter set up on your secure directory (specifed as /secure-dir-name/*) can be run, check for an object in the session, and easily redirect if not found. Mike -Original Message- From: Jing Zhou [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:10 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 4:13 AM Subject: Re: Looking for ideas for action servlet checking for logged in user. I would use container-managed security. All the secured pages should go in a directory which is the target of a security constraint in the deployment descriptor. This forces the user to log in when trying to access any secured pages. In the actions where a user-object is required, this can be retrieved on demand using the user-name from the login, and then stored in the session. What I am doing is, yes, everything is under security constraints and when the user logins, an action tracking object is created to maintain the user related objects. The action tracking is stored in the user's session. When the user logout, the action tracking is cleared and removed from the user's session. The action tracking has a lot other responsibilities. hth Adam Jing Jing Zhou wrote: - Original Message - From: Larry Zappeterrini [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 4:13 PM Subject: RE: Looking for ideas for action servlet checking for logged in user. Check out http://marc.theaimsgroup.com/?t=10445485033r=1w=2 for a possible solution. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 4:59 PM To: [EMAIL PROTECTED] Subject: Looking for ideas for action servlet checking for logged in user. I have a webapp which have several pages which require the user to be logged in(have a httpSession with a usercontainer object stored) , and a few pages that doesn't require a log in(the log-in page, references, indexes...). All pages are fronted by actions. My current solution is to check for valid login in every action class that needs to protect its invocation. That seems tedious. I though about extending the action servlet to do it, but then it would check for all requests. And I do want to distinguish between if the user is authorized(isUSerInRole) and if he/she is even logged in, so I can't use the role parameter in the action element. My next idea is extending the action servlet pluss adding parameters that can go into the action element in the struts-config.xml file. (some thing like action path=/doImportantAction type=my.actionClass usersession=true ) This would require my action servlet to know about my userContainer stored in the httpsession. Pluss modifying the struts-config file. I haven't looked into how hard this is, figure I'd ask
installing examples
Hi all, I have downloaded struts 1.1 RC1 along with the source codes. I am trying to install the example under Tomcat using the ant, and the task install.example from the build file. Everything works well until the Tomcat task: install url=${catalina.url} username=${catalina.username} password=${catalina.password} path=/struts-example war=file://${build.home}/example/ is executed. Then I got a html in the output which contains (among other things) the following message: FAIL - Invalid application URL null was specified. I have to mention that catalina password and username are correct specified. The only problem may occur from catalina.url, which in my case I set to: property name=catalina.url value=http://localhost:8080/manager/html/ Any help or seggestion is welcome. Tony
RE: Question - how many of us?
240,000 eh? In other words, only about 1% of the users subscribe to the list, from which we can make the deduction that the other 99% do not need support for struts and have no trouble using it, so I guess that makes us list subscribers the intellectual bottom of the barrel? ;-) -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 June 2003 16:22 To: Struts Users Mailing List Subject: Re: Question - how many of us? Wow - average 70 to 100 thousand downloads per month according to those stats. Presume average 80,000 per month for the last 12 months, even if only 25% of the downloads lead to people using struts, that's 12 * 0.25 * 8 = 240,000 users. OK so there's some way to go yet before struts achieves the same market saturation as Windows ;) Craig R. McClanahan wrote: On Wed, 25 Jun 2003, Igor Shabalov wrote: Date: Wed, 25 Jun 2003 10:04:24 -0700 From: Igor Shabalov [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Question - how many of us? Do anybody have any idea how many Struts users exists or how many downloads of Struts runtime per month we have now? It's pretty hard to track stuff like this, but here's a few nuggets: * Currently there are 2744 subscribers to STRUTS-USER (plus an unknown number who read it through newsfeed mirrors). It's the largest user mailing list at Jakarta, exceeding TOMCAT-USER that has ~2400. * Download counts are really hard to accumulate now that we are using the mirroring system, but last summer Struts was averaging 8-9000 downloads per month. I expect that number is somewhat higher now. * The upcoming 1.1 final release will probably send that number through the roof, at least temporarily :-). * Vadim Gritsenko accumulates and posts some high level statistics for Apache web sites that can be interesting to peruse: http://www.apache.org/~vgritsenko/stats/index.html Struts definitely shows up as an active project there too. Craig - 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: Selecting a row in nested:iterate?
What do you mean - the user must select one? If so, with which HTML control? I did this with radio buttons that held a boolean indexed property that was in the bean along with all the other fields. When the user clicked one row's radio and did a submit (normally to select that row as the parent for the content of the next page) then the bean's radio property got set to true, which I could see in the Action. HTH Adam Bjørn T Johansen wrote: I display x rows from a table using nested:iterate and I need to select one row from these rows (and know which was selected in my Action), how can I do this? Regards, BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question - how many of us?
Andrew Hill wrote: 240,000 eh? In other words, only about 1% of the users subscribe to the list, from which we can make the deduction that the other 99% do not need support for struts and have no trouble using it, so I guess that makes us list subscribers the intellectual bottom of the barrel? ;-) LOL! Either that or the other 99% go out and buy the struts books. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question - how many of us?
-Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 10:38 AM To: Struts Users Mailing List Subject: Re: Question - how many of us? Andrew Hill wrote: 240,000 eh? In other words, only about 1% of the users subscribe to the list, from which we can make the deduction that the other 99% do not need support for struts and have no trouble using it, so I guess that makes us list subscribers the intellectual bottom of the barrel? ;-) LOL! Either that or the other 99% go out and buy the struts books. I also bought the o'reilly book. But still i wouldn't like to miss the list since many questions are too complicated to find the answer within the book. So at this point i'd like to say: thanks to you all for your valuable help Greetz, Filip - 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: submitting back to opener page
hi, window.opener.document.forms[0].submit();does't work for me, says "object does't support this property" i am using IE5.0 window.opener.document.location.href="" works for me ,but i want to submit the form to get the other form elements any clues? TIA -nagi ---Original Message--- From: Struts Users Mailing List Date: Thursday, June 26, 2003 12:22:34 PM To: 'Struts Users Mailing List' Subject: RE: submitting back to opener page If you want to submit the form in the original page, you can try _javascript_like:window.opener.document.forms[0].submit();If you need to first set some values from the child window:window.opener.document.forms[0].elements["field name"].value =value from childHTH-jaafarps: Matt will probably correct me to forms[0]["field name"] above.-Original Message-From: Andrew Hill [mailto:[EMAIL PROTECTED]]Sent: Thursday, June 26, 2003 2:22 AMTo: Struts Users Mailing ListSubject: RE: submitting back to opener pageMy app had a similar requirement so what I did was have the popup submitdirectly to the action and then the action returned a forward to a page(displayed in the popup) that had _javascript_ to invoke a refresh method inthe opener window and then to close its own (popup) window.-Original Message-From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED]]Sent: Thursday, 26 June 2003 14:13To: [EMAIL PROTECTED]Subject: submitting back to opener pagehi,i have a jsp with a button which opens up a new pop-up window. wheni say submit on the pop-up window , i want to close the pop-up window and goto the action class(do the needful) and now i want to refresh the openerpage(main jsp).can i do this, if yes how??any ideas...--nagiNagendra Kumar O V SMember Technical StaffIkigo India Private Ltd.470-B, Road No. 36,Jubilee Hills,Hyderabad 500033Contact(O): 23544671Cell: 98482-41789IncrediMail - Email has finally evolved - Click Here-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]. IncrediMail - Email has finally evolved - Click Here
Re: LookupDispatchAction question part2
Frances Aleah Z. de Guzman wrote: i had posted a question i think 3 days ago about submitting a form to a LookupDispatchAction without hitting any button and still having a default value of the parameter handler. someone advised me (im sorry i forgot your name) that i should have a hidden property of my parameter name, so that eventhough i hit the enter button the submitted form will go to the method of the action corresponding to the default value of the parameter i specified. and it worked! but i have the same problem again with a little twistin my jsp i have a display of collection in a tabular form, and each record has a link going to an lookupdispatchaction that will edit its contents. i used html:link action=/holiday.do paramId=id paramName=holiday paramProperty=holidayId/, but everytime i click this link im having the same exception as before Request[/holiday] does not contain handler parameter named action. i put a hidden property of action eventhough i know that wont work coz link doesnt submit the form. how will i solve this? You should be able to add the dispatch name to the action in the link tag: html:link action=/holiday.do?action=edit paramId=id paramName=holiday paramProperty=holidayId/ I don't think you need the '.do' on the action either (the tag can match the correct action without it) so this should work: html:link action=/holiday?action=edit paramId=id paramName=holiday paramProperty=holidayId/ Of course you might have trouble with this sort of link because the LookupDispatchAction will try to match the action parameter's value with a localised key. I define two keys for each method eg protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(global.action.internal.list, list); map.put(global.action.internal.edit, edit); map.put(button.list, list); map.put(button.edit, edit); return map; } The global.action.internal.* keys are only defined in my application.properties file so I can create standard links like the one above. The button.* keys are defined application.properties and also the other locales (eg application_ja.properties) so my buttons can show the localised name and still call the correct method. -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts-config and tiles configuration
Hi, Do you have the plugin as the last element in your configuration file? (after your message resource definitions)? The error occurs because your file fails validation according to the struts DTD. Regards, Trang -Original Message- From: Bob Byron [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 26. Juni 2003 06:54 To: Struts Users Mailing List Subject: Re: struts-config and tiles configuration Hmmm, I am not sure as to what you are asking. As a test, I am using the struts-config.xml file from the tiles-documentation.war file. It still comes up with this SAXParseException. I don't get it. Bob Sergey Smirnov wrote: Is plug-in a latest element of your strruts-config.xml? - Original Message - From: Bob Byron [EMAIL PROTECTED] To: Struts Users [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 9:38 PM Subject: struts-config and tiles configuration I am getting a strange error, and I can't figure out why. As I understand it, I can put a plug-in in the struts-config file, however, I am receiving the following error message when I do: 23:00:04,841 ERROR [Digester] Parse Error at line 54 column -1: Element struts-config does not allow plug-in here. org.xml.sax.SAXParseException: Element struts-config does not allow plug-in here. Did I put plug-in in the wrong place? Any suggestions? Thank You, Bob - 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: Looking for ideas for action servlet checking for logged in user.
In case no one has mentioned it yet: http://securityfilter.sourceforge.net/ This emulates the container managed security but uses filters. You can define the security contraints in security-filter.xml (looks similar in structure to web.xml) eg security-constraint web-resource-collection web-resource-nameAdministrator-only Area/web-resource-name url-pattern/admin/*/url-pattern /web-resource-collection auth-constraint role-nameadmin/role-name /auth-constraint /security-constraint You can even use the Tomcat's JDBC Realm with it. This means you can use the request.isUserInRole() and you can define access to Struts actions by role eg: action path=/admin/Admin type=org.apache.struts.actions.ForwardAction parameter=.main.admin roles=admin,someOtherRole,yetAnotherRole /action Or display tiles if they have the right role eg definition name=.secrets.tile path=/WEB-INF/jsp/tiles/secrets.jsp role=admin / The other problem you normally encounter is creating a few objects that you want in your session after a user logs in eg get user's name, email, phone number etc throw it into a User object and store it in the session so you can refer to it later. There are a couple of choices... 1. Create a BaseAction class that all of your other Actions extend 2. Use a Filter The process is the same for each: a. Check to see if request.getUserPrincipal() is not null. If null, the user has not been authenticated b. If the user has been authenticated check to see if you have defined a session variable eg session.getAttribute(USER_LOGGED_IN) c. If it hasn't been defined, then this is a newly logged in user and you can do your initialisation stuff, record the login etc and store something in our session variable session.setAttribute(USER_LOGGED_IN, Obj) If you want to log the user out you can use session.invalidate() --jason Adam Hardy wrote: The drawback to using filters compared to security constraints is that you would have to roll your own login mechanism - which seems unnecessary when you could use the container's authentication method. Did you mention having to change Tomcat to get it to use your JDBC realm? I'm not sure quite what you mean, but yes I suppose if you have a complex realm module and you're not going to use container-managed security, I guess filters or constraints would be just as good. Adam Michael Remijan wrote: Filters have mapping patterns just like servlets have mapping patters (take a look at the web.xml DTD). So like you say servlet Foo is mapped to *.foo or /foo/* you can map a filter to urls as well. So if you have a directory in your webapp named secure. can protect all the jsp pages in that directory with the mapping /secure/*. similarly, you can add the mappings of servlets to protect them in the same way. Michael. -Original Message- From: Jing Zhou [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 11:54 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. This is an interesting use of Filters. Our action mappings have an attribute, 'privileged'. When the privileged attribute is set to true, users only with a true privileged mode in his/her action tracking (in the user's session) can execute the corresponding actions. Can a filter be easily bound to the dynamic security requirements as shown above? and in what ways, any ideas? Jing - Original Message - From: Michael Remijan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:49 AM Subject: RE: Looking for ideas for action servlet checking for logged in user. I've found using security constraints to be a little cumbersome, especially since it requires some moderate modification of tomcat to put in a jdbc realm that fits your needs. My preference is to use Filters. A filter set up on your secure directory (specifed as /secure-dir-name/*) can be run, check for an object in the session, and easily redirect if not found. Mike -Original Message- From: Jing Zhou [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:10 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 4:13 AM Subject: Re: Looking for ideas for action servlet checking for logged in user. I would use container-managed security. All the secured pages should go in a directory which is the target of a security constraint in the deployment descriptor. This forces the user to log in when trying to access any secured pages. In the actions where a user-object is required, this can be retrieved on demand using the user-name from the login, and then stored in the session. What I am doing is, yes, everything is under security constraints and
Re: iteration to create dynamic form.
Dear Piers, Please try the following code. logic:iterate id=record name=user property=siteSection.newRecords html:checkbox name=record value=off property=selectedFlag / /logic:iterate In your Form Bean, - Implement following methods. public Boolean [] getSelectedFlag(); public getSelectedFlag(Boolean [] flags); In your Record class, - Implement the methods. public boolean getSelectedFlag(); public boolean setSelectedFlag(boolean flag). When the JSP is executed, the values for the checkboxes will be retrieved from the collection of Record objects. When the form is submitted, the setSelectedFlag method on Form bean will be called. Please let me know if this works for you. Ajay Ajay Patil Vertex Software Pvt. Ltd. [EMAIL PROTECTED] http://www.vertex.co.in I have a logic:iterate tag which is supposed to create a dynamic form, filled with a checkbox for every object in a collection. (The checkbox is an option to delete one of those records from the database.) The form itself is a Map-Backed Action form with two methods (public void setValue(String key, Object value) and public Object getValue(String key)). logic:iterate id=record name=user property=siteSection.newRecords % (dataobjects.Record) l = (dataobjects.Record)pageContext.findAttribute (record); String name= new String(value( + r.getID()+)); % tr height=30 td align=center html:checkbox value=off property=%=name% onclick=CheckMBRow (this)/ /td td ..other stuff describing the record../td /tr /logic:iterate Is there a way in Struts to do this without calling the record object from the pageContext? Can't I get the html:checkbox tag to recognize the 'record' bean directly without using that scriptlet and then creating a String to set the appropriate mapped value? Best, Piers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ActionForm DB validation
I think that kind of validation is better to be done in the business logic layer. --- Fedor Smirnoff [EMAIL PROTECTED] wrote: Hey, I wanted to find out if its acceptable to access database in the validation stage of SOMEActionForm. Basically when a user enters email address to subscribe, I need to check if it already exists in the database, should I do it in SOMEAction or SOMEActionForm? Thank you Fedor __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Send free SMS from your PC! http://sg.sms.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pool: JPetStore Database Layer
So maybe you can help me with the problem? I have posted the problem in Commons list and here, but have got no answer so far. Thanks. And to be precise, the error is not closed connection, but broken pipe. --- Adam Hardy [EMAIL PROTECTED] wrote: I just checked the Apache bugzilla and couldn't find any bugs on this (I queried using closed or connection and got 23 hits). There are 2 bugs about closed connections, but they are both resolved - http://issues.apache.org/bugzilla/show_bug.cgi?id=9073 http://issues.apache.org/bugzilla/show_bug.cgi?id=8620 I'm using version 1.0 too. Not had any problems with it. I see there was no reply to that message you quote either. Adam FrenzyGNX wrote: There is a bug in DBCP that will return closed connections, even if the validation query is set. http://www.mail-archive.com/[EMAIL PROTECTED]/msg66565.html Also due to the very fact that it is removed from Struts 1.1rc2, and there were some discussions regarding it in this list earlier on. --- Adam Hardy [EMAIL PROTECTED] wrote: FrenzyGNX wrote: My personal experience with DBCP is not good. I would avoid it in my next project. From what point of view were you disappointed? Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Send free SMS from your PC! http://sg.sms.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Send free SMS from your PC! http://sg.sms.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles Tab to Actions
I am using the Tiles Tab Layout and I need the links to go to an action rather than a jsp page? Does anyone know how I go about do that. Here is my Tiles Def for the layout !-- tabs page -- definition name=prtr.pr.tabs.page extends=prtr.default put name=body-content value=prtr.tabs.body/ /definition !-- body using tabs -- definition name=prtr.tabs.body path=/jsp/prtr/layouts/tabsLayout.jsp put name=selectedIndex value=0/ put name=parameterName value=selected/ putList name=tabList item value=Description link=/jsp/prtr/tabs/prDescription.jsp/ item value=Size link=/jsp/prtr/tabs/size.jsp/ item value=Checklists link=/jsp/prtr/tabs/checklists.jsp/ item value=Meetings link=/jsp/prtr/tabs/meetings.jsp/ item value=Defects link=/jsp/prtr/tabs/defects.jsp/ item value=Comments link=/jsp/prtr/tabs/comments.jsp/ item value=Distribution link=/jsp/prtr/tabs/distribution.jsp/ item value=Review link=/jsp/prtr/tabs/review.jsp/ item value=TestTab link=/promis/action/createPeerRecord/ /putList /definition Actually, I need it to go to a particular JSP (for example I need the Size tab to go to the Size JSP) but through an action rather than a link Can anyone help? Thanks, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction question part2
im sorry but im having the same exception On Thursday 26 June 2003 05:01 pm, Jason Lea wrote: Frances Aleah Z. de Guzman wrote: i had posted a question i think 3 days ago about submitting a form to a LookupDispatchAction without hitting any button and still having a default value of the parameter handler. someone advised me (im sorry i forgot your name) that i should have a hidden property of my parameter name, so that eventhough i hit the enter button the submitted form will go to the method of the action corresponding to the default value of the parameter i specified. and it worked! but i have the same problem again with a little twistin my jsp i have a display of collection in a tabular form, and each record has a link going to an lookupdispatchaction that will edit its contents. i used html:link action=/holiday.do paramId=id paramName=holiday paramProperty=holidayId/, but everytime i click this link im having the same exception as before Request[/holiday] does not contain handler parameter named action. i put a hidden property of action eventhough i know that wont work coz link doesnt submit the form. how will i solve this? You should be able to add the dispatch name to the action in the link tag: html:link action=/holiday.do?action=edit paramId=id paramName=holiday paramProperty=holidayId/ I don't think you need the '.do' on the action either (the tag can match the correct action without it) so this should work: html:link action=/holiday?action=edit paramId=id paramName=holiday paramProperty=holidayId/ Of course you might have trouble with this sort of link because the LookupDispatchAction will try to match the action parameter's value with a localised key. I define two keys for each method eg protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(global.action.internal.list, list); map.put(global.action.internal.edit, edit); map.put(button.list, list); map.put(button.edit, edit); return map; } The global.action.internal.* keys are only defined in my application.properties file so I can create standard links like the one above. The button.* keys are defined application.properties and also the other locales (eg application_ja.properties) so my buttons can show the localised name and still call the correct method. -- Frances Aleah Z. De Guzman SA/Programmer Ingenium Technology, Inc. http://www.ingenium.com.ph Disclaimer : This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction question part2
Hi Frances, Frances Aleah Z. de Guzman wrote: im sorry but im having the same exception What does your html:link tag look like? What was the HTML output it produced? What do you have in your getKeyMethodMap()? What are the matching entries in your application.properties file? If you post those things I might be able to help better... --jason On Thursday 26 June 2003 05:01 pm, Jason Lea wrote: Frances Aleah Z. de Guzman wrote: i had posted a question i think 3 days ago about submitting a form to a LookupDispatchAction without hitting any button and still having a default value of the parameter handler. someone advised me (im sorry i forgot your name) that i should have a hidden property of my parameter name, so that eventhough i hit the enter button the submitted form will go to the method of the action corresponding to the default value of the parameter i specified. and it worked! but i have the same problem again with a little twistin my jsp i have a display of collection in a tabular form, and each record has a link going to an lookupdispatchaction that will edit its contents. i used html:link action=/holiday.do paramId=id paramName=holiday paramProperty=holidayId/, but everytime i click this link im having the same exception as before Request[/holiday] does not contain handler parameter named action. i put a hidden property of action eventhough i know that wont work coz link doesnt submit the form. how will i solve this? You should be able to add the dispatch name to the action in the link tag: html:link action=/holiday.do?action=edit paramId=id paramName=holiday paramProperty=holidayId/ I don't think you need the '.do' on the action either (the tag can match the correct action without it) so this should work: html:link action=/holiday?action=edit paramId=id paramName=holiday paramProperty=holidayId/ Of course you might have trouble with this sort of link because the LookupDispatchAction will try to match the action parameter's value with a localised key. I define two keys for each method eg protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(global.action.internal.list, list); map.put(global.action.internal.edit, edit); map.put(button.list, list); map.put(button.edit, edit); return map; } The global.action.internal.* keys are only defined in my application.properties file so I can create standard links like the one above. The button.* keys are defined application.properties and also the other locales (eg application_ja.properties) so my buttons can show the localised name and still call the correct method. -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Calling different actions in a JSP on the click of different Buttons....
**Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help me to convince my boss to use Struts!!!
Hi Everyone I just have had a discussion with my boss with regards to why he prefers the way of using a push mechanism microsoft.xmlhttp to return data to client. (Client's browser doesn't reload when response is returned :) ) We are based in a very MS environment as you can see but he has been going the push mechanism way for some time now. (ASP functions are called up via send() request function of JavaScript MS xmlhttp comp.) I'm trying to convince him that framework such as Struts is the answer to many of our problems. The main issue to him is the extra overhead constraint on bandwidth. We are based in South Africa, Cape Town and the bandwidth here is quite poor hence he would like to lower the roundtrip cost. Example: We have a system that has a tree view of data. Now as a tree, he would like to keep the previously opened branches open while the new one is pushed into the clients browser by the server hence only the newly expanded branch will be returned as a response from the server. Also note that he as a MS slave doesn't give a dam about platform independency, not even multiple browser support. (Sad I know!) Also with regards to security, he implies that we run our applications in a very friendly environment, so people won't try to disable clientside JavaScript validation as an example. It doesn't seem like a major issue either. Development time-frame seems to be a big issue too. I just can seem to convince him of the actual benefits of using Struts even damn ASP.NET compared to his method of using a 2 tiered system with push mechanism. So anyone PLEASE help me get the benefit across to him!!! I would like to put it into a table format or something for him to be able to scan through. From some experience in Struts I have got the real feel for the benefit of using Struts / MVC based framework but I still can't seem to explain well to him the main reason why he should convert!!! :( Hope to hear from you guys soon. Best Regards --Alen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction question part2
thanks jason, i double checked my application.properties and i found out that the value of my action should be Edit with the capital E but what im putting a while ago is ehehehemy mistake! thanks again. On Thursday 26 June 2003 06:58 pm, Jason Lea wrote: Hi Frances, Frances Aleah Z. de Guzman wrote: im sorry but im having the same exception What does your html:link tag look like? What was the HTML output it produced? What do you have in your getKeyMethodMap()? What are the matching entries in your application.properties file? If you post those things I might be able to help better... --jason On Thursday 26 June 2003 05:01 pm, Jason Lea wrote: Frances Aleah Z. de Guzman wrote: i had posted a question i think 3 days ago about submitting a form to a LookupDispatchAction without hitting any button and still having a default value of the parameter handler. someone advised me (im sorry i forgot your name) that i should have a hidden property of my parameter name, so that eventhough i hit the enter button the submitted form will go to the method of the action corresponding to the default value of the parameter i specified. and it worked! but i have the same problem again with a little twistin my jsp i have a display of collection in a tabular form, and each record has a link going to an lookupdispatchaction that will edit its contents. i used html:link action=/holiday.do paramId=id paramName=holiday paramProperty=holidayId/, but everytime i click this link im having the same exception as before Request[/holiday] does not contain handler parameter named action. i put a hidden property of action eventhough i know that wont work coz link doesnt submit the form. how will i solve this? You should be able to add the dispatch name to the action in the link tag: html:link action=/holiday.do?action=edit paramId=id paramName=holiday paramProperty=holidayId/ I don't think you need the '.do' on the action either (the tag can match the correct action without it) so this should work: html:link action=/holiday?action=edit paramId=id paramName=holiday paramProperty=holidayId/ Of course you might have trouble with this sort of link because the LookupDispatchAction will try to match the action parameter's value with a localised key. I define two keys for each method eg protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(global.action.internal.list, list); map.put(global.action.internal.edit, edit); map.put(button.list, list); map.put(button.edit, edit); return map; } The global.action.internal.* keys are only defined in my application.properties file so I can create standard links like the one above. The button.* keys are defined application.properties and also the other locales (eg application_ja.properties) so my buttons can show the localised name and still call the correct method. -- Frances Aleah Z. De Guzman SA/Programmer Ingenium Technology, Inc. http://www.ingenium.com.ph Disclaimer : This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with html:multibox
I am having a value object inside an arraylist.The array list i have declared as a property in my form bean.The value object contains id and name.The arraylist gets populated from my action class and i'm displaying like this. logic:iterate id=element name=MyForm property=MyCollection html:multibox property=MyCollection bean:write name=element property=id/ /html:multibox /logic:iterate When i select a checkbox to remove and submit my server shows an error like this, javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1099) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j ava:798) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.j ava:1789) at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.j ava:1684) at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:17 13) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:924) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j ava:798) at
RE: Tiles Tab to Actions
Hi, I have exactly the same question, so if someone can help us out, it would be great. Regards, Trang -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 26. Juni 2003 12:29 To: Struts Users Mailing List Subject: Tiles Tab to Actions I am using the Tiles Tab Layout and I need the links to go to an action rather than a jsp page? Does anyone know how I go about do that. Here is my Tiles Def for the layout !-- tabs page -- definition name=prtr.pr.tabs.page extends=prtr.default put name=body-content value=prtr.tabs.body/ /definition !-- body using tabs -- definition name=prtr.tabs.body path=/jsp/prtr/layouts/tabsLayout.jsp put name=selectedIndex value=0/ put name=parameterName value=selected/ putList name=tabList item value=Description link=/jsp/prtr/tabs/prDescription.jsp/ item value=Size link=/jsp/prtr/tabs/size.jsp/ item value=Checklists link=/jsp/prtr/tabs/checklists.jsp/ item value=Meetings link=/jsp/prtr/tabs/meetings.jsp/ item value=Defects link=/jsp/prtr/tabs/defects.jsp/ item value=Comments link=/jsp/prtr/tabs/comments.jsp/ item value=Distribution link=/jsp/prtr/tabs/distribution.jsp/ item value=Review link=/jsp/prtr/tabs/review.jsp/ item value=TestTab link=/promis/action/createPeerRecord/ /putList /definition Actually, I need it to go to a particular JSP (for example I need the Size tab to go to the Size JSP) but through an action rather than a link Can anyone help? Thanks, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help me to convince my boss to use Struts!!!
Howdy, My suggestion is that you move from skaapstad up to jozi. I have encountered many developers here who have struts projects going, and the local industry seems to be keen on it too. We have just completed moving a banking legacy system to struts/EJBs and our client (Tebabank) insisted on java. Everyone is real impressed with the results and I am certain that this site will be used as a reference for similar projects in the future. :-) Scott. [EMAIL PROTECTED] 06/26/03 01:28pm Hi Everyone I just have had a discussion with my boss with regards to why he prefers the way of using a push mechanism microsoft.xmlhttp to return data to client. (Client's browser doesn't reload when response is returned :) ) We are based in a very MS environment as you can see but he has been going the push mechanism way for some time now. (ASP functions are called up via send() request function of JavaScript MS xmlhttp comp.) I'm trying to convince him that framework such as Struts is the answer to many of our problems. The main issue to him is the extra overhead constraint on bandwidth. We are based in South Africa, Cape Town and the bandwidth here is quite poor hence he would like to lower the roundtrip cost. Example: We have a system that has a tree view of data. Now as a tree, he would like to keep the previously opened branches open while the new one is pushed into the clients browser by the server hence only the newly expanded branch will be returned as a response from the server. Also note that he as a MS slave doesn't give a dam about platform independency, not even multiple browser support. (Sad I know!) Also with regards to security, he implies that we run our applications in a very friendly environment, so people won't try to disable clientside JavaScript validation as an example. It doesn't seem like a major issue either. Development time-frame seems to be a big issue too. I just can seem to convince him of the actual benefits of using Struts even damn ASP.NET compared to his method of using a 2 tiered system with push mechanism. So anyone PLEASE help me get the benefit across to him!!! I would like to put it into a table format or something for him to be able to scan through. From some experience in Struts I have got the real feel for the benefit of using Struts / MVC based framework but I still can't seem to explain well to him the main reason why he should convert!!! :( Hope to hear from you guys soon. Best Regards --Alen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] # The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy and copies. # - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with html:multibox
try and make id of iterate = property. may work... sandeep --- O_Parthasarathy Kesavaraj [EMAIL PROTECTED] wrote: I am having a value object inside an arraylist.The array list i have declared as a property in my form bean.The value object contains id and name.The arraylist gets populated from my action class and i'm displaying like this. logic:iterate id=element name=MyForm property=MyCollection html:multibox property=MyCollection bean:write name=element property=id/ /html:multibox /logic:iterate When i select a checkbox to remove and submit my server shows an error like this, javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1099) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j ava:798) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.j ava:1789) at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.j ava:1684) at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:17 13) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:924) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729) at
RE: Problem with html:multibox
No.it is not working -- From: Sandeep Takhar[SMTP:[EMAIL PROTECTED] Reply To: Struts Users Mailing List Sent: Thursday, June 26, 2003 5:33 PM To: Struts Users Mailing List Subject: Re: Problem with html:multibox try and make id of iterate = property. may work... sandeep --- O_Parthasarathy Kesavaraj [EMAIL PROTECTED] wrote: I am having a value object inside an arraylist.The array list i have declared as a property in my form bean.The value object contains id and name.The arraylist gets populated from my action class and i'm displaying like this. logic:iterate id=element name=MyForm property=MyCollection html:multibox property=MyCollection bean:write name=element property=id/ /html:multibox /logic:iterate When i select a checkbox to remove and submit my server shows an error like this, javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1099) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor .j ava:798) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:25 4) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati on FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter Ch ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve. ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve. ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:1 80 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValv e. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:1 72 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja va :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processCon ne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.j av a:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm pl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils .j ava:1789)
Re: Help me to convince my boss to use Struts!!!
Hi Scott, You know how the majority here in Cape Town take things easy. Well, not me!! :) I'm always looking for better ways in doing things / dealing with problems. I might get a chance to go to Johannesburg soon to work on a legacy system architecture conversion to J2EE architecture. (EJB, JTA, etc..) This will definitely be a good move for me. :) As far as Struts, I've worked with it affectively for only about 2 months so far. It's brilliant I can say! :) I'm doing quite an involved B2C system at the moment using Struts, OJB, and many other interesting goodies. The reality is that I'm currently employed in a very MS environment, so I thought I'll get them to gradually convert to a more Java architectural approach hence hinting towards Struts framework. So far I haven't really succeeded. :) This is why I'm looking for help on the mailing list aspecialy from anyone who had simillar experience. --Alen - Original Message - From: SCOTT VENTER [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 1:46 PM Subject: Re: Help me to convince my boss to use Struts!!! Howdy, My suggestion is that you move from skaapstad up to jozi. I have encountered many developers here who have struts projects going, and the local industry seems to be keen on it too. We have just completed moving a banking legacy system to struts/EJBs and our client (Tebabank) insisted on java. Everyone is real impressed with the results and I am certain that this site will be used as a reference for similar projects in the future. :-) Scott. [EMAIL PROTECTED] 06/26/03 01:28pm Hi Everyone I just have had a discussion with my boss with regards to why he prefers the way of using a push mechanism microsoft.xmlhttp to return data to client. (Client's browser doesn't reload when response is returned :) ) We are based in a very MS environment as you can see but he has been going the push mechanism way for some time now. (ASP functions are called up via send() request function of JavaScript MS xmlhttp comp.) I'm trying to convince him that framework such as Struts is the answer to many of our problems. The main issue to him is the extra overhead constraint on bandwidth. We are based in South Africa, Cape Town and the bandwidth here is quite poor hence he would like to lower the roundtrip cost. Example: We have a system that has a tree view of data. Now as a tree, he would like to keep the previously opened branches open while the new one is pushed into the clients browser by the server hence only the newly expanded branch will be returned as a response from the server. Also note that he as a MS slave doesn't give a dam about platform independency, not even multiple browser support. (Sad I know!) Also with regards to security, he implies that we run our applications in a very friendly environment, so people won't try to disable clientside JavaScript validation as an example. It doesn't seem like a major issue either. Development time-frame seems to be a big issue too. I just can seem to convince him of the actual benefits of using Struts even damn ASP.NET compared to his method of using a 2 tiered system with push mechanism. So anyone PLEASE help me get the benefit across to him!!! I would like to put it into a table format or something for him to be able to scan through. From some experience in Struts I have got the real feel for the benefit of using Struts / MVC based framework but I still can't seem to explain well to him the main reason why he should convert!!! :( Hope to hear from you guys soon. Best Regards --Alen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] # The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy and copies. # - 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: Tiles Tab to Actions
I looked at tabsLayout.jsp in rc2. Here is a code snippet: String href = request.getRequestURI() + ?+parameterName + = + index; // Don't add request URI prefix , but let the client compute the original URL // This allows to use a Struts action as page URL, and perform a forward. // Bug reported by Don Peterkofsky //String href = + ?+parameterName + = + index; String color = notSelectedColor; if( index == selectedIndex ) { selectedBody = tab.getLink(); color = selectedColor; } // enf if index++; % td bgcolor=%=color% a href=%=href% %=tab.getValue()%/a /td td width=1 /td In the above code - tab is what you have defined as an entry in your putList and we are iterating over it. This code is creating the tabs. At the very bottom is where it is creating the link for each tab. This link seems to be always the same according to the code and to just append a parameter to it. So basically you want the original request to the page to be an action and I think it should work since it will always make an href to the original request + parameter which tells what has been selected. Below this code snippet it does an insert (include): tiles:insert name=%=selectedBody% flush=true / selectedBody depends on selectedIndex (this is the paramater that changes depending on the tab). This is set as a default in your definition as well in case you haven't selected a tab yet.(zero below). SelectedBody is a jsp in this case although the comment makes it seem like it could be an action. I am not sure if you can do a tiles:insert name=some_Action?? So if you can't then I wouldn't have the link parameter set to an action... Also selectedBody is set twice. Once in the code above if someone selected something. Also by default. So I think by reading the code the the initial action that brings up the tab layout will always be called when you click on the link. This should always forward to this same tile. The only thing that changes is the parameter saying which page is selected. If you want to change the behaviour you will have to change the code. sandeep --- [EMAIL PROTECTED] wrote: Hi, I have exactly the same question, so if someone can help us out, it would be great. Regards, Trang -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 26. Juni 2003 12:29 To: Struts Users Mailing List Subject: Tiles Tab to Actions I am using the Tiles Tab Layout and I need the links to go to an action rather than a jsp page? Does anyone know how I go about do that. Here is my Tiles Def for the layout !-- tabs page -- definition name=prtr.pr.tabs.page extends=prtr.default put name=body-content value=prtr.tabs.body/ /definition !-- body using tabs -- definition name=prtr.tabs.body path=/jsp/prtr/layouts/tabsLayout.jsp put name=selectedIndex value=0/ put name=parameterName value=selected/ putList name=tabList item value=Description link=/jsp/prtr/tabs/prDescription.jsp/ item value=Size link=/jsp/prtr/tabs/size.jsp/ item value=Checklists link=/jsp/prtr/tabs/checklists.jsp/ item value=Meetings link=/jsp/prtr/tabs/meetings.jsp/ item value=Defects link=/jsp/prtr/tabs/defects.jsp/ item value=Comments link=/jsp/prtr/tabs/comments.jsp/ item value=Distribution link=/jsp/prtr/tabs/distribution.jsp/ item value=Review link=/jsp/prtr/tabs/review.jsp/ item value=TestTab link=/promis/action/createPeerRecord/ /putList /definition Actually, I need it to go to a particular JSP (for example I need the Size tab to go to the Size JSP) but through an action rather than a link Can anyone help? Thanks, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Poolman?
I'm looking for connection pooling for a Struts app. Everyone recommends Poolman but it's discontinued. Can anyone recommend something else or tell me where I can download Poolman? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with html:multibox
Is this the full error? Seems truncated sandeep --- O_Parthasarathy Kesavaraj [EMAIL PROTECTED] wrote: No.it is not working -- From: Sandeep Takhar[SMTP:[EMAIL PROTECTED] Reply To: Struts Users Mailing List Sent: Thursday, June 26, 2003 5:33 PM To: Struts Users Mailing List Subject:Re: Problem with html:multibox try and make id of iterate = property. may work... sandeep --- O_Parthasarathy Kesavaraj [EMAIL PROTECTED] wrote: I am having a value object inside an arraylist.The array list i have declared as a property in my form bean.The value object contains id and name.The arraylist gets populated from my action class and i'm displaying like this. logic:iterate id=element name=MyForm property=MyCollection html:multibox property=MyCollection bean:write name=element property=id/ /html:multibox /logic:iterate When i select a checkbox to remove and submit my server shows an error like this, javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1099) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor .j ava:798) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:25 4) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati on FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter Ch ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve. ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve. ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:1 80 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValv e. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:1 72 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja va :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv ok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processCon ne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.j av a:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39 ) at
Re: html:link / - add parameters
Ok. I forgot a very important peace in the puzzle. I'm running an iteration tag and my html:link / tags get generated inside the loop. So, as my iteration runs, a new html:link / gets generated. Now as you can see, each link will need specific/unique parameter list. e.g. /someLink.do?id=10secLevel=3 next loop /someLink.do?id=21secLevel=2 and so on... So I will need a Map object I presume per Item (In this case per Product) to hold my product specific request parameters (id's)? What is the best way of doing this so that right Map gets pulled out according to right product in iteration process in my view so I can populate my link paramter list (per iteration)? --Alen - Original Message - From: Nagendra Kumar O V S To: [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:30 AM Subject: Re: html:link / - add parameters HI, u will have to populate the map( with name,value pairs) and set this map to ur action form, in the jsp give the name property of the map html:link href=link.do name=taskForm property=params here taskForm is the action form to which params is set .this params is Map params = new HashMap(); params.put(req1,reqvalue1); params.put(req2,reqvalue2); params.put(req3,reqvalue3); params is set to the corresponding action form -nagi ---Original Message--- From: Struts Users Mailing List Date: Wednesday, June 25, 2003 01:45:50 PM To: Struts Users Mailing List Subject: - add parameters Hi all I see that when using html:link / tag I can add parameters to be passed on to the destination / action too. So far I only needed a single parameter id but now I need one more. I see that one can use java.util.Map to pass a list of parameters via a link. The thing is how and where do I populate this Map. The link I click on just basically goes through a action mapping that redirects to a desired jsp page. Could someone show me a snippet regarding this please. Thanks --Alen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . IncrediMail - Email has finally evolved - Click Here - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using modules and actionforward to an action
Have you tried this? return new ActionForward(/logout.do); I guess you are almost there. Jing - Original Message - From: Abhinav (Cognizant) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 11:58 PM Subject: RE: Using modules and actionforward to an action no ... -Original Message- From: Sergey Smirnov [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 10:27 AM To: Struts Users Mailing List Subject: Re: Using modules and actionforward to an action Do you use contextRelative=true to switch between modules? - Original Message - From: Abhinav (Cognizant) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 9:29 PM Subject: Using modules and actionforward to an action For logging out I use this piece of code : RequestUtils.selectModule(, req, getServlet().getServletContext()); return (new ActionForward(/AuthFail.jsp)); I don't want to hardcode /AuthFail.jsp instead of that i want to forward to an action /logout defined in the default servlet-config.xml I tried this return (new ActionForward(/logout)); and in the servlet-config.xml action path=/logout type=actions.LoginAction --- --- /action but no success. Suggestions ... - 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]
requiredif - simple example
Hi all, The validator package works well for me. But I'm trying to use the requiredif and failing. I know there has been previous discussion of this, but I'm trying to a simple validation based on a checkbox so perhaps someone could tell me where I'm going wrong. For example, I want to validate a creditcard, if a checkbox is checked. I currently am trying to do this as follows: form name=myForm field property=creditCard depends=requiredif,creditCard arg0 key=myForm.creditCard/ arg0 name=creditCard key=CreditCard resource=false / arg0 name=requiredif key=A Credit-Card is resource=false / var var-namemyForm.checked/var-name var-valueon/var-value /var /field /form The form name is: myForm The creditcard field is named creditCard The checkbox field is named checked Note that all other types of validation are working correctly for me. Any help would be SO much appreciated. Brian
common-logging, Struts, Log4j
Hi. I have problem in using the common-logging with struts and Log4j. I am basically lost. I have short questions, I appreciate if anyone can help me little bit. these are the questions with examples: The file outputfile.log that I specify in log4j.appender.LOGFILE.File=outputfile.log where it is located? where I find it? is it physical file? I dont know why my configuration is not working, although I put the following files in the classpath WEB-INF/classes/org/myclasses/: commons-logging.properties: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL ogger log4j.properties: log4j.rootLogger=DEBUG, rolling log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m% n log4j.appender.rolling=org.apache.log4j.RollingFileAppender log4j.appender.rolling.File=outputfile.log log4j.appender.rolling.MaxFileSize=100KB log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p % c - %m%n What else should I specify, or configure to make it to work? I have log4j-1.2.4.jar in my WEB-INF/lib/ Should I set any system propreties? or web.xml? or struts-config? In my classes I am doing that: protected static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(this.class); if (log.isDebugEnabled()) log.debug(getMessage( + locale + , + key + )); (How can I enable/disable the Debug or Trace?) Thank you in advance. I am really stuck and I couldnt make it to work. I am using tomcat 4.18 Rabih - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: common-logging, Struts, Log4j
I had the same problem and was only able to solve it by forceably loading the log4j configuration file. I put the following in the servlet's init() method: // get log4j property file. java.net.URL log4jProps = ActionServlet.class.getClassLoader().getResource(log4j.properties); System.out.println(System.out.println - Log4j URL: + log4jProps); // configure log4j PropertyConfigurator.configure(log4jProps); Mike -Original Message- From: rablists [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 7:51 AM To: [EMAIL PROTECTED] Subject: common-logging, Struts, Log4j Hi. I have problem in using the common-logging with struts and Log4j. I am basically lost. I have short questions, I appreciate if anyone can help me little bit. these are the questions with examples: The file outputfile.log that I specify in log4j.appender.LOGFILE.File=outputfile.log where it is located? where I find it? is it physical file? I dont know why my configuration is not working, although I put the following files in the classpath WEB-INF/classes/org/myclasses/: commons-logging.properties: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL ogger log4j.properties: log4j.rootLogger=DEBUG, rolling log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m% n log4j.appender.rolling=org.apache.log4j.RollingFileAppender log4j.appender.rolling.File=outputfile.log log4j.appender.rolling.MaxFileSize=100KB log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p % c - %m%n What else should I specify, or configure to make it to work? I have log4j-1.2.4.jar in my WEB-INF/lib/ Should I set any system propreties? or web.xml? or struts-config? In my classes I am doing that: protected static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(this.class); if (log.isDebugEnabled()) log.debug(getMessage( + locale + , + key + )); (How can I enable/disable the Debug or Trace?) Thank you in advance. I am really stuck and I couldnt make it to work. I am using tomcat 4.18 Rabih - 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]
bean:message and html tags in the propeties file.
Hi list: If I put messages in a properties file that have html tags, when I use the bean:message/ tag to retrieve them Struts will convert somthing like b into lt;bgt; so I actually see b in the browser window instead of bold text. Is there any way to prevent this from happening? Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Poolman?
On Thu, 26 Jun 2003, bill blackmon wrote: The first place I would look would be with your app server. If your app server does not provide this service, then You can still download Poolman from SourceForge http://sourceforge.net/projects/poolman/ You can also look in the Jakarta-Commons DBCP http://jakarta.apache.org/commons/index.html I'm looking for connection pooling for a Struts app. Everyone recommends Poolman but it's discontinued. Can anyone recommend something else or tell me where I can download Poolman? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Melissa L Kelley [EMAIL PROTECTED] www.stuology.net -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
URLs not escaped
The following JSP fragment jstl:url value=/view var=url jstl:param name=id value=1 / jstl:param name=format value=rdf / /jstl:url html:link href=${url}.../html:link generates a link with an invalid href attribute of http://x.org/app/view?id=1value=rdf instead of http://x.org/app/view?id=1amp;value=rdf Whose fault is it? A) JSTL tag library B) Struts HTML-EL tag library C) My fault -- Eric Jain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link / - add parameters
It's pretty easy to use JSTL to handle the Map: jsp:useBean id=paramMap class=java.util.HashMap/ c:forEach var=product items=${productList} c:set target=${paramMap} property=id value=${product.id}/ c:set target=${paramMap} property=secLevel value=${product.secLevel}/ html:link action=/someLink name=paramMap ... /html:link /c:forEach Quoting Alen Ribic [EMAIL PROTECTED]: Ok. I forgot a very important peace in the puzzle. I'm running an iteration tag and my html:link / tags get generated inside the loop. So, as my iteration runs, a new html:link / gets generated. Now as you can see, each link will need specific/unique parameter list. e.g. /someLink.do?id=10secLevel=3 next loop /someLink.do?id=21secLevel=2 and so on... So I will need a Map object I presume per Item (In this case per Product) to hold my product specific request parameters (id's)? What is the best way of doing this so that right Map gets pulled out according to right product in iteration process in my view so I can populate my link paramter list (per iteration)? --Alen - Original Message - From: Nagendra Kumar O V S To: [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:30 AM Subject: Re: html:link / - add parameters HI, u will have to populate the map( with name,value pairs) and set this map to ur action form, in the jsp give the name property of the map html:link href=link.do name=taskForm property=params here taskForm is the action form to which params is set .this params is Map params = new HashMap(); params.put(req1,reqvalue1); params.put(req2,reqvalue2); params.put(req3,reqvalue3); params is set to the corresponding action form -nagi ---Original Message--- From: Struts Users Mailing List Date: Wednesday, June 25, 2003 01:45:50 PM To: Struts Users Mailing List Subject: - add parameters Hi all I see that when using html:link / tag I can add parameters to be passed on to the destination / action too. So far I only needed a single parameter id but now I need one more. I see that one can use java.util.Map to pass a list of parameters via a link. The thing is how and where do I populate this Map. The link I click on just basically goes through a action mapping that redirects to a desired jsp page. Could someone show me a snippet regarding this please. Thanks --Alen -- 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]
controlling the View state in Struts w/Tiles
Im working on a solution to create a flexible solution in Struts to accomodate highly dynamic forms and error handling. Here is what Im after: Based on selections on a form, easily change other fields in the form such as show/hide, disable/enable, mark field as required/not required. I am open to approaches that would minmize the number of times I have to refresh the page such as calling Java methods from JavaScript? Currently Im using a combination of JavaScript and Java calls which are accomplished by refreshing the page but I would like a cleaner/more elegant solution. I would like to get away from using JavaScript simply because some amount of domain logic is tied to the View now. Any suggestions or best practices would be appreciated. Thanks, Shane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Looking for ideas for action servlet checking for logged in user.
I have a little bit run away question. Since there is an existing login facility in our codes, is there a general facility that allows us to plug it into major application servers, like Oracle9iAS, WebLogic, ...? Or it is completely impossible as of today? Jing Netspread Carrier http://www.netspread.com - Original Message - From: Jason Lea [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 4:34 AM Subject: Re: Looking for ideas for action servlet checking for logged in user. In case no one has mentioned it yet: http://securityfilter.sourceforge.net/ This emulates the container managed security but uses filters. You can define the security contraints in security-filter.xml (looks similar in structure to web.xml) eg security-constraint web-resource-collection web-resource-nameAdministrator-only Area/web-resource-name url-pattern/admin/*/url-pattern /web-resource-collection auth-constraint role-nameadmin/role-name /auth-constraint /security-constraint You can even use the Tomcat's JDBC Realm with it. This means you can use the request.isUserInRole() and you can define access to Struts actions by role eg: action path=/admin/Admin type=org.apache.struts.actions.ForwardAction parameter=.main.admin roles=admin,someOtherRole,yetAnotherRole /action Or display tiles if they have the right role eg definition name=.secrets.tile path=/WEB-INF/jsp/tiles/secrets.jsp role=admin / The other problem you normally encounter is creating a few objects that you want in your session after a user logs in eg get user's name, email, phone number etc throw it into a User object and store it in the session so you can refer to it later. There are a couple of choices... 1. Create a BaseAction class that all of your other Actions extend 2. Use a Filter The process is the same for each: a. Check to see if request.getUserPrincipal() is not null. If null, the user has not been authenticated b. If the user has been authenticated check to see if you have defined a session variable eg session.getAttribute(USER_LOGGED_IN) c. If it hasn't been defined, then this is a newly logged in user and you can do your initialisation stuff, record the login etc and store something in our session variable session.setAttribute(USER_LOGGED_IN, Obj) If you want to log the user out you can use session.invalidate() --jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: requiredif - simple example
The following worked for me. Note that in RC1, the var-name tag values are expected to be field-test[n], not fieldTest[n] and so on The requiredif check was removed because in 1.1RC1, requiredif would break a javascript validator such as mask. I used custom validation instead. field property=prop1 depends=mask!-- removed requiredif -- msg name=requiredif key=app224Form.aForm.prop1.req/ msg name=mask key=app224Form.aForm.prop1.mask/ var var-namemask/var-name var-value${4dig}/var-value /var !--var var-namefield[0]/var-name var-valuefeeExempt/var-value /var var var-namefieldTest[0]/var-name var-valueEQUAL/var-value /var var var-namefieldValue[0]/var-name var-valuetrue/var-value /var var var-namefield[1]/var-name var-valueprop1/var-value /var var var-namefieldTest[1]/var-name var-valueNULL/var-value /var -- You can also check out the Validator doc on the struts documentation. Just expand the struts-documentation webapp that comes with your version of struts, it is under User and Developer Guides. -Kevin --- Brian McSweeney [EMAIL PROTECTED] wrote: Hi all, The validator package works well for me. But I'm trying to use the requiredif and failing. I know there has been previous discussion of this, but I'm trying to a simple validation based on a checkbox so perhaps someone could tell me where I'm going wrong. For example, I want to validate a creditcard, if a checkbox is checked. I currently am trying to do this as follows: form name=myForm field property=creditCard depends=requiredif,creditCard arg0 key=myForm.creditCard/ arg0 name=creditCard key=CreditCard resource=false / arg0 name=requiredif key=A Credit-Card is resource=false / var var-namemyForm.checked/var-name var-valueon/var-value /var /field /form The form name is: myForm The creditcard field is named creditCard The checkbox field is named checked Note that all other types of validation are working correctly for me. Any help would be SO much appreciated. Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link / - add parameters
this seems good. does JSTL comp. come standard with Struts? do you prefer using JSTL for common tasks and why? --Alen - Original Message - From: Kris Schneider [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 3:18 PM Subject: Re: html:link / - add parameters It's pretty easy to use JSTL to handle the Map: jsp:useBean id=paramMap class=java.util.HashMap/ c:forEach var=product items=${productList} c:set target=${paramMap} property=id value=${product.id}/ c:set target=${paramMap} property=secLevel value=${product.secLevel}/ html:link action=/someLink name=paramMap ... /html:link /c:forEach Quoting Alen Ribic [EMAIL PROTECTED]: Ok. I forgot a very important peace in the puzzle. I'm running an iteration tag and my html:link / tags get generated inside the loop. So, as my iteration runs, a new html:link / gets generated. Now as you can see, each link will need specific/unique parameter list. e.g. /someLink.do?id=10secLevel=3 next loop /someLink.do?id=21secLevel=2 and so on... So I will need a Map object I presume per Item (In this case per Product) to hold my product specific request parameters (id's)? What is the best way of doing this so that right Map gets pulled out according to right product in iteration process in my view so I can populate my link paramter list (per iteration)? --Alen - Original Message - From: Nagendra Kumar O V S To: [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:30 AM Subject: Re: html:link / - add parameters HI, u will have to populate the map( with name,value pairs) and set this map to ur action form, in the jsp give the name property of the map html:link href=link.do name=taskForm property=params here taskForm is the action form to which params is set .this params is Map params = new HashMap(); params.put(req1,reqvalue1); params.put(req2,reqvalue2); params.put(req3,reqvalue3); params is set to the corresponding action form -nagi ---Original Message--- From: Struts Users Mailing List Date: Wednesday, June 25, 2003 01:45:50 PM To: Struts Users Mailing List Subject: - add parameters Hi all I see that when using html:link / tag I can add parameters to be passed on to the destination / action too. So far I only needed a single parameter id but now I need one more. I see that one can use java.util.Map to pass a list of parameters via a link. The thing is how and where do I populate this Map. The link I click on just basically goes through a action mapping that redirects to a desired jsp page. Could someone show me a snippet regarding this please. Thanks --Alen -- 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: html:link / - add parameters
JSTL is not part of Struts. It's a Java specification defined by JSR-52 (JSTL 1.0). http://java.sun.com/products/jsp/jstl/ Apache Jakarta provides an implementation: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html You might also be interested in the Struts-EL tag library. It integrates the JSTL Expression Language (EL) with a *subset* of Struts tags: http://jakarta.apache.org/struts/userGuide/building_view.html#struts-el It's included in the contrib/struts-el dir of the Struts distribution. Quoting Alen Ribic [EMAIL PROTECTED]: this seems good. does JSTL comp. come standard with Struts? do you prefer using JSTL for common tasks and why? --Alen - Original Message - From: Kris Schneider [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 3:18 PM Subject: Re: html:link / - add parameters It's pretty easy to use JSTL to handle the Map: jsp:useBean id=paramMap class=java.util.HashMap/ c:forEach var=product items=${productList} c:set target=${paramMap} property=id value=${product.id}/ c:set target=${paramMap} property=secLevel value=${product.secLevel}/ html:link action=/someLink name=paramMap ... /html:link /c:forEach Quoting Alen Ribic [EMAIL PROTECTED]: Ok. I forgot a very important peace in the puzzle. I'm running an iteration tag and my html:link / tags get generated inside the loop. So, as my iteration runs, a new html:link / gets generated. Now as you can see, each link will need specific/unique parameter list. e.g. /someLink.do?id=10secLevel=3 next loop /someLink.do?id=21secLevel=2 and so on... So I will need a Map object I presume per Item (In this case per Product) to hold my product specific request parameters (id's)? What is the best way of doing this so that right Map gets pulled out according to right product in iteration process in my view so I can populate my link paramter list (per iteration)? --Alen - Original Message - From: Nagendra Kumar O V S To: [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:30 AM Subject: Re: html:link / - add parameters HI, u will have to populate the map( with name,value pairs) and set this map to ur action form, in the jsp give the name property of the map html:link href=link.do name=taskForm property=params here taskForm is the action form to which params is set .this params is Map params = new HashMap(); params.put(req1,reqvalue1); params.put(req2,reqvalue2); params.put(req3,reqvalue3); params is set to the corresponding action form -nagi ---Original Message--- From: Struts Users Mailing List Date: Wednesday, June 25, 2003 01:45:50 PM To: Struts Users Mailing List Subject: - add parameters Hi all I see that when using html:link / tag I can add parameters to be passed on to the destination / action too. So far I only needed a single parameter id but now I need one more. I see that one can use java.util.Map to pass a list of parameters via a link. The thing is how and where do I populate this Map. The link I click on just basically goes through a action mapping that redirects to a desired jsp page. Could someone show me a snippet regarding this please. Thanks --Alen -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- 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]
Any struts developments in Israel?
I started building application on the Struts framework and I wonder how common/ or not this framework is used here? And, as always, am appreciating close reference and assistant and vice versa... Ido Kobelkowsky Diaz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:link / - add parameters
Yes.. come to the light of JSTL.. [EMAIL PROTECTED] -Tim :) -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 9:52 AM To: Struts Users Mailing List Subject: Re: html:link / - add parameters JSTL is not part of Struts. It's a Java specification defined by JSR-52 (JSTL 1.0). http://java.sun.com/products/jsp/jstl/ Apache Jakarta provides an implementation: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html You might also be interested in the Struts-EL tag library. It integrates the JSTL Expression Language (EL) with a *subset* of Struts tags: http://jakarta.apache.org/struts/userGuide/building_view.html#struts-el It's included in the contrib/struts-el dir of the Struts distribution. Quoting Alen Ribic [EMAIL PROTECTED]: this seems good. does JSTL comp. come standard with Struts? do you prefer using JSTL for common tasks and why? --Alen - Original Message - From: Kris Schneider [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 3:18 PM Subject: Re: html:link / - add parameters It's pretty easy to use JSTL to handle the Map: jsp:useBean id=paramMap class=java.util.HashMap/ c:forEach var=product items=${productList} c:set target=${paramMap} property=id value=${product.id}/ c:set target=${paramMap} property=secLevel value=${product.secLevel}/ html:link action=/someLink name=paramMap ... /html:link /c:forEach Quoting Alen Ribic [EMAIL PROTECTED]: Ok. I forgot a very important peace in the puzzle. I'm running an iteration tag and my html:link / tags get generated inside the loop. So, as my iteration runs, a new html:link / gets generated. Now as you can see, each link will need specific/unique parameter list. e.g. /someLink.do?id=10secLevel=3 next loop /someLink.do?id=21secLevel=2 and so on... So I will need a Map object I presume per Item (In this case per Product) to hold my product specific request parameters (id's)? What is the best way of doing this so that right Map gets pulled out according to right product in iteration process in my view so I can populate my link paramter list (per iteration)? --Alen - Original Message - From: Nagendra Kumar O V S To: [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:30 AM Subject: Re: html:link / - add parameters HI, u will have to populate the map( with name,value pairs) and set this map to ur action form, in the jsp give the name property of the map html:link href=link.do name=taskForm property=params here taskForm is the action form to which params is set .this params is Map params = new HashMap(); params.put(req1,reqvalue1); params.put(req2,reqvalue2); params.put(req3,reqvalue3); params is set to the corresponding action form -nagi ---Original Message--- From: Struts Users Mailing List Date: Wednesday, June 25, 2003 01:45:50 PM To: Struts Users Mailing List Subject: - add parameters Hi all I see that when using html:link / tag I can add parameters to be passed on to the destination / action too. So far I only needed a single parameter id but now I need one more. I see that one can use java.util.Map to pass a list of parameters via a link. The thing is how and where do I populate this Map. The link I click on just basically goes through a action mapping that redirects to a desired jsp page. Could someone show me a snippet regarding this please. Thanks --Alen -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- 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: requiredif - simple example
Hi Kevin, Thanks for the reply. I'm a little confused by your example though. First off - what does the ${4dig} mean? This won't validate a checkbox, right? Second, you have a lot of stuff commented out. Are these fields getting validated? Finally, if I wanted to just test against a boolean being checked would I do something like the following? field property=prop1 depends=mask msg name=requiredif key=app224Form.aForm.prop1.req/ msg name=mask key=app224Form.aForm.prop1.mask/ var var-namemask/var-name var-value${4dig}/var-value /var var var-namefield-checked[0]/var-name var-valuetrue/var-value /var I'm quite confused! Sorry, Thanks, Brian -Original Message- From: Kevin Robair [mailto:[EMAIL PROTECTED] Sent: 26 June 2003 14:30 To: Struts Users Mailing List Subject: Re: requiredif - simple example The following worked for me. Note that in RC1, the var-name tag values are expected to be field-test[n], not fieldTest[n] and so on The requiredif check was removed because in 1.1RC1, requiredif would break a javascript validator such as mask. I used custom validation instead. field property=prop1 depends=mask!-- removed requiredif -- msg name=requiredif key=app224Form.aForm.prop1.req/ msg name=mask key=app224Form.aForm.prop1.mask/ var var-namemask/var-name var-value${4dig}/var-value /var !--var var-namefield[0]/var-name var-valuefeeExempt/var-value /var var var-namefieldTest[0]/var-name var-valueEQUAL/var-value /var var var-namefieldValue[0]/var-name var-valuetrue/var-value /var var var-namefield[1]/var-name var-valueprop1/var-value /var var var-namefieldTest[1]/var-name var-valueNULL/var-value /var -- You can also check out the Validator doc on the struts documentation. Just expand the struts-documentation webapp that comes with your version of struts, it is under User and Developer Guides. -Kevin --- Brian McSweeney [EMAIL PROTECTED] wrote: Hi all, The validator package works well for me. But I'm trying to use the requiredif and failing. I know there has been previous discussion of this, but I'm trying to a simple validation based on a checkbox so perhaps someone could tell me where I'm going wrong. For example, I want to validate a creditcard, if a checkbox is checked. I currently am trying to do this as follows: form name=myForm field property=creditCard depends=requiredif,creditCard arg0 key=myForm.creditCard/ arg0 name=creditCard key=CreditCard resource=false / arg0 name=requiredif key=A Credit-Card is resource=false / var var-namemyForm.checked/var-name var-valueon/var-value /var /field /form The form name is: myForm The creditcard field is named creditCard The checkbox field is named checked Note that all other types of validation are working correctly for me. Any help would be SO much appreciated. Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] opening URI in mozilla
Ashish, Check out the mozilla site at http://www.mozilla.org/releases/mozilla1.4b/ and read the security section near the bottom of the page. There is a section that explains why this happens and how to get around it. Kevin -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 2:25 PM To: [EMAIL PROTECTED] Subject: [OT] opening URI in mozilla Hi, I have a link on one of the jsp which opens a local file from the client PC, i am working on intranet application so this is fine by me, so my path in HTML tag looks like this file:///C:/cognos/scheduling/Scenario.imr This works perfect in IE , but i get error in mozilla and netscape, saying Security Error: Content at http://localhost:8080/testapp/menu/mapsmenu.jsp may not load or link to file:///C:/cognos/scheduling/Scenario.imr. Error: uncaught exception: [Exception... Access to restricted URI denied code: 1012 nsresult: 0x805303f4 (NS_ERROR_DOM_BAD_URI) location: http://localhost:8080/testapp/menu/coolmenus4.js Line: 419] any workaround or any forum where i can post this question Ashish = A$HI$H __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This electronic mail transmission contains confidential and/or privileged information intended only for the person(s) named. Any use, distribution, copying or disclosure by another person is strictly prohibited. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: submitting back to opener page
Another option is to set the target attribute of the popup window's form to point to the opener window. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 2:22 AM To: Struts Users Mailing List Subject: RE: submitting back to opener page My app had a similar requirement so what I did was have the popup submit directly to the action and then the action returned a forward to a page (displayed in the popup) that had javascript to invoke a refresh method in the opener window and then to close its own (popup) window. -Original Message- From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 June 2003 14:13 To: [EMAIL PROTECTED] Subject: submitting back to opener page hi, i have a jsp with a button which opens up a new pop-up window. when i say submit on the pop-up window , i want to close the pop-up window and go to the action class(do the needful) and now i want to refresh the opener page(main jsp). can i do this, if yes how?? any ideas... --nagi Nagendra Kumar O V S Member Technical Staff Ikigo India Private Ltd. 470-B, Road No. 36, Jubilee Hills, Hyderabad 500033 Contact(O): 23544671 Cell: 98482-41789 IncrediMail - Email has finally evolved - Click Here *** This electronic mail transmission contains confidential and/or privileged information intended only for the person(s) named. Any use, distribution, copying or disclosure by another person is strictly prohibited. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
servlet.getDebug()?
Hi, guys: I have seen the above use of servlet variable without declaring it before its use. Why is it? thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Anchor tags in a page
Hi, I have a page that is quite large so i'm trying to put anchor a tags in the page so that i can redirect the user to a specific part of the page. this is quite easy to achieve so I'm told using the following piece of code in the struts-config.xml file: action path=/action type=org.me.myAction name=addNewAorB scope=request forward name=addA path=/a.jsp#addA/ /action This will take me to the addA anchor tag in the page provided redirect is set to true. The problem I have is that I'm using tiles. Does this prevent me from doing the above? If so is there any way around this? Many thanks, Jon. Need a new email address that people can remember Check out the new EudoraMail at http://www.eudoramail.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: servlet.getDebug()?
it's the same with: session, request, (i believe: log) and a few more. These variable a deklared automatically for usage within your servlets. HTH Filip -Original Message- From: sgu88 [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 4:15 PM To: [EMAIL PROTECTED] Subject: servlet.getDebug()? Hi, guys: I have seen the above use of servlet variable without declaring it before its use. Why is it? thanks, - 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: Help me to convince my boss to use Struts!!!
You might take a look at Maverick. http://mavnet.sourceforge.net/ It's very much like Struts, and uses a site-map, but is simpler. It is also available for .NET (as well as .PHP). Perhaps the Maverick.NET framework might provide a way that you could combine the best of both worlds. IMHO, the major benefit of MVC frameworks, including Struts, is the XML site map. -Ted. Alen Ribic wrote: Hi Everyone I just have had a discussion with my boss with regards to why he prefers the way of using a push mechanism microsoft.xmlhttp to return data to client. (Client's browser doesn't reload when response is returned :) ) We are based in a very MS environment as you can see but he has been going the push mechanism way for some time now. (ASP functions are called up via send() request function of JavaScript MS xmlhttp comp.) I'm trying to convince him that framework such as Struts is the answer to many of our problems. The main issue to him is the extra overhead constraint on bandwidth. We are based in South Africa, Cape Town and the bandwidth here is quite poor hence he would like to lower the roundtrip cost. Example: We have a system that has a tree view of data. Now as a tree, he would like to keep the previously opened branches open while the new one is pushed into the clients browser by the server hence only the newly expanded branch will be returned as a response from the server. Also note that he as a MS slave doesn't give a dam about platform independency, not even multiple browser support. (Sad I know!) Also with regards to security, he implies that we run our applications in a very friendly environment, so people won't try to disable clientside JavaScript validation as an example. It doesn't seem like a major issue either. Development time-frame seems to be a big issue too. I just can seem to convince him of the actual benefits of using Struts even damn ASP.NET compared to his method of using a 2 tiered system with push mechanism. So anyone PLEASE help me get the benefit across to him!!! I would like to put it into a table format or something for him to be able to scan through. From some experience in Struts I have got the real feel for the benefit of using Struts / MVC based framework but I still can't seem to explain well to him the main reason why he should convert!!! :( Hope to hear from you guys soon. Best Regards --Alen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Struts in Action http://husted.com/struts/book.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pool: JPetStore Database Layer
love to help but how? I searched for a bug in the Commons bugzilla and didn't find one - your best bet would be to establish a test case for the problem and post it in bugzilla - you don't need to be an Apache developer to search or add bugs to their bugzilla. FrenzyGNX wrote: So maybe you can help me with the problem? I have posted the problem in Commons list and here, but have got no answer so far. Thanks. And to be precise, the error is not closed connection, but broken pipe. --- Adam Hardy [EMAIL PROTECTED] wrote: I just checked the Apache bugzilla and couldn't find any bugs on this (I queried using closed or connection and got 23 hits). There are 2 bugs about closed connections, but they are both resolved - http://issues.apache.org/bugzilla/show_bug.cgi?id=9073 http://issues.apache.org/bugzilla/show_bug.cgi?id=8620 I'm using version 1.0 too. Not had any problems with it. I see there was no reply to that message you quote either. Adam FrenzyGNX wrote: There is a bug in DBCP that will return closed connections, even if the validation query is set. http://www.mail-archive.com/[EMAIL PROTECTED]/msg66565.html Also due to the very fact that it is removed from Struts 1.1rc2, and there were some discussions regarding it in this list earlier on. --- Adam Hardy [EMAIL PROTECTED] wrote: FrenzyGNX wrote: My personal experience with DBCP is not good. I would avoid it in my next project. From what point of view were you disappointed? Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Send free SMS from your PC! http://sg.sms.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Send free SMS from your PC! http://sg.sms.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Message Resources example using OJB
Hi all, Has anyone tried and used Message Resources example using OJB which can be used to place the application properties in a database instead of a properties file. If anyone has tried this, can u help me know what to do when a property is changed in the database, at present i am having to reload the application. Is there any way around this so that the application reads the properties dynamically. Thanks in adv, srikanth. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: common-logging, Struts, Log4j
I have the similar setup and works very well for me. log4j.appender.LOGFILE.File=outputfile.log where it is located? where I find it? is it physical file? It should be saved under the app. server bin dir like c:/tomcat-4.18/bin. I don't use tomcat. But websphere app. server saves this file under bin folder. If you want, you can give absolute path like c:/tomcat-4.18/logs/outputfile.log. log4j.rootLogger=DEBUG, rolling Here you have not declared stdout as an appender. So, all log messages (because you have lowest level DEBUG for rootLogger) will be sent to file declared in rolling appender. You can include stdout in rootLogger like log4j.rootLogger=DEBUG, stdout, rolling and check your tomcat log files to see if there is anything written before you check rolling file permissions etc. Hope this helps. Reddy Original Message- From: rablists [SMTP:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 8:51 AM To: [EMAIL PROTECTED] Subject: common-logging, Struts, Log4j Hi. I have problem in using the common-logging with struts and Log4j. I am basically lost. I have short questions, I appreciate if anyone can help me little bit. these are the questions with examples: The file outputfile.log that I specify in log4j.appender.LOGFILE.File=outputfile.log where it is located? where I find it? is it physical file? I dont know why my configuration is not working, although I put the following files in the classpath WEB-INF/classes/org/myclasses/: commons-logging.properties: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL ogger log4j.properties: log4j.rootLogger=DEBUG, rolling log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m% n log4j.appender.rolling=org.apache.log4j.RollingFileAppender log4j.appender.rolling.File=outputfile.log log4j.appender.rolling.MaxFileSize=100KB log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p % c - %m%n What else should I specify, or configure to make it to work? I have log4j-1.2.4.jar in my WEB-INF/lib/ Should I set any system propreties? or web.xml? or struts-config? In my classes I am doing that: protected static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(this.class); if (log.isDebugEnabled()) log.debug(getMessage( + locale + , + key + )); (How can I enable/disable the Debug or Trace?) Thank you in advance. I am really stuck and I couldnt make it to work. I am using tomcat 4.18 Rabih - 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: display an image
If you've got an action that retrieves image data from a database, it should be doing something like (error handling ignored): public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { byte[] dataBytes = getImageData(); response.setContentType(image/jpeg); ServletOutputStream out = response.getOutputStream(); out.write(dataBytes); return null; } You would then need an img tag in an HTML document to reference the action: bean:define id=imageId value=1/ html:img page=/displayImage.do paramId=imageid paramName=imageId/ Quoting Richard Raquepo [EMAIL PROTECTED]: i want to write a web app to display an image from a mssql db (image datatype). my action should be displayImage.do?imageid=1 where: imageid is the id of a particular image from the db. now my action class would retrieve this for example: byte[] dataBytes; //an array of bytes if (rs.next()) //if there is a record { dataBytes = rs.getBytes(imagedata) } request.setAttribute(imagedate,imagedate); my action would now forward to a jsp. my question is how will i be able to display the image in my jsp? can someone enlighten me on what should i do? thanks. -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Re: Poolman?
I have a Tomcat project that uses jakarta commons DBCP which is based on commons pooling. You configure it thru the tomcat config and access the pool via JNDI lookup of a datasource (just like a in WebLogic app). It appears to work well. Regards, Rich -Original Message- From: Melissa L Kelley [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 9:14 AM To: Struts Users Mailing List Subject: [OT] Re: Poolman? On Thu, 26 Jun 2003, bill blackmon wrote: The first place I would look would be with your app server. If your app server does not provide this service, then You can still download Poolman from SourceForge http://sourceforge.net/projects/poolman/ You can also look in the Jakarta-Commons DBCP http://jakarta.apache.org/commons/index.html I'm looking for connection pooling for a Struts app. Everyone recommends Poolman but it's discontinued. Can anyone recommend something else or tell me where I can download Poolman? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Melissa L Kelley [EMAIL PROTECTED] www.stuology.net -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with html:multibox
Hi Partha, I think u have completely messed up iterate and multibox... So instead of myself suggesting u changes to be done u better take a look at the below url http://article.gmane.org/gmane.comp.jakarta.struts.user/52790/match=html+multibox+ Cheers Prashanth O_Parthasarathy Kesavaraj [EMAIL PROTECTED] wrote: I am having a value object inside an arraylist.The array list i have declared as a property in my form bean.The value object contains id and name.The arraylist gets populated from my action class and i'm displaying like this. When i select a checkbox to remove and submit my server shows an error like this, javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1099) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j ava:798) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:536) root cause java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.j ava:1789) at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.j ava:1684) at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:17 13) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:924) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j ava:798) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at
Re: Help me to convince my boss to use Struts!!!
thx Ted. Could you perhaps give me some really strong points as to why they would benefit from switching over to Struts or do you believe that switching over to Struts would only merely be debatable? I really wanna use Struts in our dev. env. :-) --Alen - Original Message - From: Ted Husted [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 4:33 PM Subject: Re: Help me to convince my boss to use Struts!!! You might take a look at Maverick. http://mavnet.sourceforge.net/ It's very much like Struts, and uses a site-map, but is simpler. It is also available for .NET (as well as .PHP). Perhaps the Maverick.NET framework might provide a way that you could combine the best of both worlds. IMHO, the major benefit of MVC frameworks, including Struts, is the XML site map. -Ted. Alen Ribic wrote: Hi Everyone I just have had a discussion with my boss with regards to why he prefers the way of using a push mechanism microsoft.xmlhttp to return data to client. (Client's browser doesn't reload when response is returned :) ) We are based in a very MS environment as you can see but he has been going the push mechanism way for some time now. (ASP functions are called up via send() request function of JavaScript MS xmlhttp comp.) I'm trying to convince him that framework such as Struts is the answer to many of our problems. The main issue to him is the extra overhead constraint on bandwidth. We are based in South Africa, Cape Town and the bandwidth here is quite poor hence he would like to lower the roundtrip cost. Example: We have a system that has a tree view of data. Now as a tree, he would like to keep the previously opened branches open while the new one is pushed into the clients browser by the server hence only the newly expanded branch will be returned as a response from the server. Also note that he as a MS slave doesn't give a dam about platform independency, not even multiple browser support. (Sad I know!) Also with regards to security, he implies that we run our applications in a very friendly environment, so people won't try to disable clientside JavaScript validation as an example. It doesn't seem like a major issue either. Development time-frame seems to be a big issue too. I just can seem to convince him of the actual benefits of using Struts even damn ASP.NET compared to his method of using a 2 tiered system with push mechanism. So anyone PLEASE help me get the benefit across to him!!! I would like to put it into a table format or something for him to be able to scan through. From some experience in Struts I have got the real feel for the benefit of using Struts / MVC based framework but I still can't seem to explain well to him the main reason why he should convert!!! :( Hope to hear from you guys soon. Best Regards --Alen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Struts in Action http://husted.com/struts/book.html - 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: submitting back to opener page
Try: opener.document.forms[0].submit(); If that doesn't work, debug by doing alert(opener.document.forms[0]); We have this working in IE 5+, NS 4.7+ HTH -jaafar -Original Message- From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 4:50 AM To: [EMAIL PROTECTED] Subject: RE: submitting back to opener page hi, window.opener.document.forms[0].submit(); does't work for me, says object does't support this property i am using IE5.0 window.opener.document.location.href=sdf.do works for me ,but i want to submit the form to get the other form elements any clues? TIA -nagi ---Original Message--- From: Struts Users Mailing mailto:[EMAIL PROTECTED] List Date: Thursday, June 26, 2003 12:22:34 PM To: 'Struts Users Mailing mailto:[EMAIL PROTECTED] List' Subject: RE: submitting back to opener page If you want to submit the form in the original page, you can try javascript like: window.opener.document.forms[0].submit(); If you need to first set some values from the child window: window.opener.document.forms[0].elements[field name].value = value from child HTH -jaafar ps: Matt will probably correct me to forms[0][field name] above. -Original Message- From: Andrew Hill [ mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 2:22 AM To: Struts Users Mailing List Subject: RE: submitting back to opener page My app had a similar requirement so what I did was have the popup submit directly to the action and then the action returned a forward to a page (displayed in the popup) that had javascript to invoke a refresh method in the opener window and then to close its own (popup) window. -Original Message- From: Nagendra Kumar O V S [ mailto:[EMAIL PROTECTED] Sent: Thursday, 26 June 2003 14:13 To: [EMAIL PROTECTED] Subject: submitting back to opener page hi, i have a jsp with a button which opens up a new pop-up window. when i say submit on the pop-up window , i want to close the pop-up window and go to the action class(do the needful) and now i want to refresh the opener page(main jsp). can i do this, if yes how?? any ideas... --nagi Nagendra Kumar O V S Member Technical Staff Ikigo India Private Ltd. 470-B, Road No. 36, Jubilee Hills, Hyderabad 500033 Contact(O): 23544671 Cell: 98482-41789 IncrediMail - Email has finally evolved - Click Here - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . http://www.incredimail.com/redir.asp?ad_id=309lang=9 IncrediMail - Email has finally evolved - http://www.incredimail.com/redir.asp?ad_id=309lang=9 Click Here
Upload Error
I applied the folowing example to my project but a get an error : java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUploadException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590) at java.lang.Class.getConstructor0(Class.java:1762) at java.lang.Class.newInstance0(Class.java:276) at java.lang.Class.newInstance(Class.java:259) http://jakarta.apache.org/struts/faqs/actionForm.html [EMAIL PROTECTED] language=java [EMAIL PROTECTED] uri=/WEB-INF/struts-html.tld prefix=html html:form action=uploadAction.do enctype=multipart/form-data Please Input Text: html:text property=myText Please Input The File You Wish to Upload: html:file property=myFile html:submit / /html:form The next step is to create your ActionForm bean: import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.upload.FormFile; public class UploadForm extends ActionForm { protected String myText; protected FormFile myFile; public void setMyText(String text) { myText = text; } public String getMyText() { return myText; } public void setMyFile(FormFile file) { myFile = file; } public FormFile getMyFile() { return myFile; } }
Difference between ValidatorForm and ValidatorActionForm?
I kind of understand it. ValidatorForm validates the form and ValidatorActionForm validates the form based on action path. But why would you prefer one over the other? I mean you can achieve almost the same effect with either. Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help me to convince my boss to use Struts!!!
Alen, Take a look at this ... http://www.strutskickstart.com/ There's a link in the sidebar, Powerpoint: Selling Struts to Management, to download a presentation that might be helpful for you. I haven't read it myself (thankfully haven't needed to), but others on this list have been grateful for it. Hope that helps, Susan Bradeen On 06/26/2003 11:00:09 AM Alen Ribic wrote: thx Ted. Could you perhaps give me some really strong points as to why they would benefit from switching over to Struts or do you believe that switching over to Struts would only merely be debatable? I really wanna use Struts in our dev. env. :-) --Alen - Original Message - From: Ted Husted [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 4:33 PM Subject: Re: Help me to convince my boss to use Struts!!! You might take a look at Maverick. http://mavnet.sourceforge.net/ It's very much like Struts, and uses a site-map, but is simpler. It is also available for .NET (as well as .PHP). Perhaps the Maverick.NET framework might provide a way that you could combine the best of both worlds. IMHO, the major benefit of MVC frameworks, including Struts, is the XML site map. -Ted. Alen Ribic wrote: Hi Everyone I just have had a discussion with my boss with regards to why he prefers the way of using a push mechanism microsoft.xmlhttp to return data to client. (Client's browser doesn't reload when response is returned :) ) We are based in a very MS environment as you can see but he has been going the push mechanism way for some time now. (ASP functions are called up via send() request function of JavaScript MS xmlhttp comp.) I'm trying to convince him that framework such as Struts is the answer to many of our problems. The main issue to him is the extra overhead constraint on bandwidth. We are based in South Africa, Cape Town and the bandwidth here is quite poor hence he would like to lower the roundtrip cost. Example: We have a system that has a tree view of data. Now as a tree, he would like to keep the previously opened branches open while the new one is pushed into the clients browser by the server hence only the newly expanded branch will be returned as a response from the server. Also note that he as a MS slave doesn't give a dam about platform independency, not even multiple browser support. (Sad I know!) Also with regards to security, he implies that we run our applications in a very friendly environment, so people won't try to disable clientside JavaScript validation as an example. It doesn't seem like a major issue either. Development time-frame seems to be a big issue too. I just can seem to convince him of the actual benefits of using Struts even damn ASP.NET compared to his method of using a 2 tiered system with push mechanism. So anyone PLEASE help me get the benefit across to him!!! I would like to put it into a table format or something for him to be able to scan through. From some experience in Struts I have got the real feel for the benefit of using Struts / MVC based framework but I still can't seem to explain well to him the main reason why he should convert!!! :( Hope to hear from you guys soon. Best Regards --Alen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Struts in Action http://husted.com/struts/book.html - 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]
Cannot start expanded struts/tiles web app in Weblogic 6.1sp4
Hi, I have had lots of problems attempting to upgrade from struts rc1 to struts rc2 on weblogic 6.1sp4 and have all but given up. Has anybody else managed it? This simple test fails on my box: 1. Deploying tiles-documentation.war to weblogic works fine. 2. Expand tiles-documentation.war to be an expanded web-app and delete tiles-documentation.war). You now get the following error during weblogic start-up: [ERROR] Digester - -End event threw error java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactoryjava.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.beanutils.MethodUtils.clinit (MethodUtils.java:103) at org.apache.commons.digester.CallMethodRule.end (CallMethodRule.java:505) at org.apache.commons.digester.Rule.end(Rule.java:276) at org.apache.commons.digester.Digester.endElement(Digester.java:1058) at weblogic.apache.xerces.parsers.SAXParser.endElement (SAXParser.java:1411) at weblogic.apache.xerces.validators.common.XMLValidator.callEndElement (XMLValidator.java:14 52) at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat ch (XMLDocumen tScanner.java:1234) at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome (XMLDocumentScanner.java:396 ) at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:975) at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:123) at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:125) at org.apache.commons.digester.Digester.parse(Digester.java:1567) at org.apache.struts.action.ActionServlet.initServlet (ActionServlet.java:1431) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl.createServlet (ServletStubImpl.java:731) at weblogic.servlet.internal.ServletStubImpl.createInstances (ServletStubImpl.java:658) at weblogic.servlet.internal.ServletStubImpl.prepareServlet (ServletStubImpl.java:603) at weblogic.servlet.internal.WebAppServletContext.preloadServlet (WebAppServletContext.java:2 360) at weblogic.servlet.internal.WebAppServletContext.preloadServlets (WebAppServletContext.java: 2301) at weblogic.servlet.internal.HttpServer.preloadServlets (HttpServer.java:558) at weblogic.servlet.internal.WebService.preloadServlets (WebService.java:450) at weblogic.t3.srvr.ServletInitRunner.run(ServletInitRunner.java:49) at java.lang.Thread.run(Thread.java:479) 25-Jun-03 14:03:28 BST Error HTTP [WebAppServletContext(3083702,tiles- documentation,/tiles-do cumentation)] Error loading servlet: 'action' java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.beanutils.MethodUtils.clinit (MethodUtils.java:103) at org.apache.commons.digester.CallMethodRule.end (CallMethodRule.java:505) at org.apache.commons.digester.Rule.end(Rule.java:276) at org.apache.commons.digester.Digester.endElement(Digester.java:1058) at weblogic.apache.xerces.parsers.SAXParser.endElement (SAXParser.java:1411) at weblogic.apache.xerces.validators.common.XMLValidator.callEndElement (XMLValidator.java:14 52) at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat ch (XMLDocumen tScanner.java:1234) at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome (XMLDocumentScanner.java:396 ) at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:975) This e-mail and any files transmitted with it are confidential and may be protected by legal privilege. If you are not the intended recipient, please notify the sender and delete the e-mail from your system. No employee or agent of London Electricity Group PLC or any related company is authorised to conclude any binding agreement on behalf of London Electricity Group PLC or any related company by email. All e-mails received by London Electricity Group PLC are subject to monitoring to ensure compliance with the company security policy. This email and any attachments have been swept for malicious software by MIMEsweeper software. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: submitting back to opener page
Just as an FYI - If you are referencing an opener from a page with frames, you need to reference the top level of your current window to get to the opener. For example: window.top.window.opener.document.forms[0].submit() Ted -Original Message- From: El Harouchi, Jaafar [IT] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:09 AM To: Struts Users Mailing List Subject: RE: submitting back to opener page Try: opener.document.forms[0].submit(); If that doesn't work, debug by doing alert(opener.document.forms[0]); We have this working in IE 5+, NS 4.7+ HTH -jaafar -Original Message- From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 4:50 AM To: [EMAIL PROTECTED] Subject: RE: submitting back to opener page hi, window.opener.document.forms[0].submit(); does't work for me, says object does't support this property i am using IE5.0 window.opener.document.location.href=sdf.do works for me ,but i want to submit the form to get the other form elements any clues? TIA -nagi ---Original Message--- From: Struts Users Mailing mailto:[EMAIL PROTECTED] List Date: Thursday, June 26, 2003 12:22:34 PM To: 'Struts Users Mailing mailto:[EMAIL PROTECTED] List' Subject: RE: submitting back to opener page If you want to submit the form in the original page, you can try javascript like: window.opener.document.forms[0].submit(); If you need to first set some values from the child window: window.opener.document.forms[0].elements[field name].value = value from child HTH -jaafar ps: Matt will probably correct me to forms[0][field name] above. -Original Message- From: Andrew Hill [ mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 2:22 AM To: Struts Users Mailing List Subject: RE: submitting back to opener page My app had a similar requirement so what I did was have the popup submit directly to the action and then the action returned a forward to a page (displayed in the popup) that had javascript to invoke a refresh method in the opener window and then to close its own (popup) window. -Original Message- From: Nagendra Kumar O V S [ mailto:[EMAIL PROTECTED] Sent: Thursday, 26 June 2003 14:13 To: [EMAIL PROTECTED] Subject: submitting back to opener page hi, i have a jsp with a button which opens up a new pop-up window. when i say submit on the pop-up window , i want to close the pop-up window and go to the action class(do the needful) and now i want to refresh the opener page(main jsp). can i do this, if yes how?? any ideas... --nagi Nagendra Kumar O V S Member Technical Staff Ikigo India Private Ltd. 470-B, Road No. 36, Jubilee Hills, Hyderabad 500033 Contact(O): 23544671 Cell: 98482-41789 IncrediMail - Email has finally evolved - Click Here - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . http://www.incredimail.com/redir.asp?ad_id=309lang=9 IncrediMail - Email has finally evolved - http://www.incredimail.com/redir.asp?ad_id=309lang=9 Click Here Confidentiality Warning: This e-mail contains information intended only for the use of the individual or entity named above. If the reader of this e-mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, any dissemination, publication or copying of this e-mail is strictly prohibited. The sender does not accept any responsibility for any loss, disruption or damage to your data or computer system that may occur while using data contained in, or transmitted with, this e-mail. If you have received this e-mail in error, please immediately notify us by return e-mail. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Looking for File Upload Example
Hi i'm looking for un example of using File UPLOAD whith Struts API The servlet and JSP code Thanks Flo
RE: Upload Error
Looks like you need commons-fileupload.jar in your classpath. It appears org/apache/commons/fileupload/FileUploadException is an apache commons file which can't be found to be loaded. The struts file upload code must throw that exception or something. -Original Message- From: Flo [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 12:40 PM To: [EMAIL PROTECTED] Subject: Upload Error I applied the folowing example to my project but a get an error : java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUploadException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590) at java.lang.Class.getConstructor0(Class.java:1762) at java.lang.Class.newInstance0(Class.java:276) at java.lang.Class.newInstance(Class.java:259) http://jakarta.apache.org/struts/faqs/actionForm.html [EMAIL PROTECTED] language=java [EMAIL PROTECTED] uri=/WEB-INF/struts-html.tld prefix=html html:form action=uploadAction.do enctype=multipart/form-data Please Input Text: html:text property=myText Please Input The File You Wish to Upload: html:file property=myFile html:submit / /html:form The next step is to create your ActionForm bean: import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.upload.FormFile; public class UploadForm extends ActionForm { protected String myText; protected FormFile myFile; public void setMyText(String text) { myText = text; } public String getMyText() { return myText; } public void setMyFile(FormFile file) { myFile = file; } public FormFile getMyFile() { return myFile; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: common-logging, Struts, Log4j
By default the property-files commons-logging.properties log4j.properties are located in the directory WEB-INF/classes Usually you put them in your workbench in the root of the Java Source directory. If you build with ant you simply copy them there from your chosen source directory Markus rablists wrote: Hi. I have problem in using the common-logging with struts and Log4j. I am basically lost. I have short questions, I appreciate if anyone can help me little bit. these are the questions with examples: The file outputfile.log that I specify in log4j.appender.LOGFILE.File=outputfile.log where it is located? where I find it? is it physical file? I dont know why my configuration is not working, although I put the following files in the classpath WEB-INF/classes/org/myclasses/: commons-logging.properties: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL ogger log4j.properties: log4j.rootLogger=DEBUG, rolling log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m% n log4j.appender.rolling=org.apache.log4j.RollingFileAppender log4j.appender.rolling.File=outputfile.log log4j.appender.rolling.MaxFileSize=100KB log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p % c - %m%n What else should I specify, or configure to make it to work? I have log4j-1.2.4.jar in my WEB-INF/lib/ Should I set any system propreties? or web.xml? or struts-config? In my classes I am doing that: protected static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(this.class); if (log.isDebugEnabled()) log.debug(getMessage( + locale + , + key + )); (How can I enable/disable the Debug or Trace?) Thank you in advance. I am really stuck and I couldnt make it to work. I am using tomcat 4.18 Rabih - 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: Difference between ValidatorForm and ValidatorActionForm?
Yansheng, Since ActionForms are intended to be reused across multiple actions, you might have different validation requirements depending on the context that the ActionForm is being used. One Action might require a certain field but that field may not be required for another Action that is using the same ActionForm. Hope this helps. -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:52 AM To: 'Struts Users Mailing List' Subject: Difference between ValidatorForm and ValidatorActionForm? I kind of understand it. ValidatorForm validates the form and ValidatorActionForm validates the form based on action path. But why would you prefer one over the other? I mean you can achieve almost the same effect with either. Thanks! - 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: Help me to convince my boss to use Struts!!!
Great! Thanks Susan. This is definitely something I'll be able to use. Regards, --Alen - Original Message - From: Susan Bradeen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 6:13 PM Subject: Re: Help me to convince my boss to use Struts!!! Alen, Take a look at this ... http://www.strutskickstart.com/ There's a link in the sidebar, Powerpoint: Selling Struts to Management, to download a presentation that might be helpful for you. I haven't read it myself (thankfully haven't needed to), but others on this list have been grateful for it. Hope that helps, Susan Bradeen On 06/26/2003 11:00:09 AM Alen Ribic wrote: thx Ted. Could you perhaps give me some really strong points as to why they would benefit from switching over to Struts or do you believe that switching over to Struts would only merely be debatable? I really wanna use Struts in our dev. env. :-) --Alen - Original Message - From: Ted Husted [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 4:33 PM Subject: Re: Help me to convince my boss to use Struts!!! You might take a look at Maverick. http://mavnet.sourceforge.net/ It's very much like Struts, and uses a site-map, but is simpler. It is also available for .NET (as well as .PHP). Perhaps the Maverick.NET framework might provide a way that you could combine the best of both worlds. IMHO, the major benefit of MVC frameworks, including Struts, is the XML site map. -Ted. Alen Ribic wrote: Hi Everyone I just have had a discussion with my boss with regards to why he prefers the way of using a push mechanism microsoft.xmlhttp to return data to client. (Client's browser doesn't reload when response is returned :) ) We are based in a very MS environment as you can see but he has been going the push mechanism way for some time now. (ASP functions are called up via send() request function of JavaScript MS xmlhttp comp.) I'm trying to convince him that framework such as Struts is the answer to many of our problems. The main issue to him is the extra overhead constraint on bandwidth. We are based in South Africa, Cape Town and the bandwidth here is quite poor hence he would like to lower the roundtrip cost. Example: We have a system that has a tree view of data. Now as a tree, he would like to keep the previously opened branches open while the new one is pushed into the clients browser by the server hence only the newly expanded branch will be returned as a response from the server. Also note that he as a MS slave doesn't give a dam about platform independency, not even multiple browser support. (Sad I know!) Also with regards to security, he implies that we run our applications in a very friendly environment, so people won't try to disable clientside JavaScript validation as an example. It doesn't seem like a major issue either. Development time-frame seems to be a big issue too. I just can seem to convince him of the actual benefits of using Struts even damn ASP.NET compared to his method of using a 2 tiered system with push mechanism. So anyone PLEASE help me get the benefit across to him!!! I would like to put it into a table format or something for him to be able to scan through. From some experience in Struts I have got the real feel for the benefit of using Struts / MVC based framework but I still can't seem to explain well to him the main reason why he should convert!!! :( Hope to hear from you guys soon. Best Regards --Alen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Struts in Action http://husted.com/struts/book.html - 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: Looking for File Upload Example
Struts config (only because I am using a Dyna form): !-- Load Request form bean -- form-bean name=loadReqCompForm type=org.apache.struts.validator.DynaValidatorActionForm form-property name=fileContent type=org.apache.struts.upload.FormFile/ /form-bean - In action execute method: DynaActionForm dynaForm = (DynaActionForm)form; FormFile fileInfo = (FormFile)dynaForm.get(fileContent); String fileName = fileInfo.getFileName(); int fileSize = fileInfo.getFileSize (); //This just shows it uploaded (not sure what you want to do with the file) System.out.println(N=+fileName+ S=+fileSize); --- In JSP: html:form action=/loadCompletion method=post enctype=multipart/form-data form-property name=fileContent type=org.apache.struts.upload.FormFile/ /html:form --- That's it! -Original Message- From: Flo [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:31 AM To: [EMAIL PROTECTED] Subject: Looking for File Upload Example Hi i'm looking for un example of using File UPLOAD whith Struts API The servlet and JSP code Thanks Flo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Looking for ideas for action servlet checking for logged in user.
I didn't know about this project. I am very interested. Anybody deploy this with JRun4? -Original Message- From: Jason Lea [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 5:34 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. In case no one has mentioned it yet: http://securityfilter.sourceforge.net/ This emulates the container managed security but uses filters. You can define the security contraints in security-filter.xml (looks similar in structure to web.xml) eg security-constraint web-resource-collection web-resource-nameAdministrator-only Area/web-resource-name url-pattern/admin/*/url-pattern /web-resource-collection auth-constraint role-nameadmin/role-name /auth-constraint /security-constraint You can even use the Tomcat's JDBC Realm with it. This means you can use the request.isUserInRole() and you can define access to Struts actions by role eg: action path=/admin/Admin type=org.apache.struts.actions.ForwardAction parameter=.main.admin roles=admin,someOtherRole,yetAnotherRole /action Or display tiles if they have the right role eg definition name=.secrets.tile path=/WEB-INF/jsp/tiles/secrets.jsp role=admin / The other problem you normally encounter is creating a few objects that you want in your session after a user logs in eg get user's name, email, phone number etc throw it into a User object and store it in the session so you can refer to it later. There are a couple of choices... 1. Create a BaseAction class that all of your other Actions extend 2. Use a Filter The process is the same for each: a. Check to see if request.getUserPrincipal() is not null. If null, the user has not been authenticated b. If the user has been authenticated check to see if you have defined a session variable eg session.getAttribute(USER_LOGGED_IN) c. If it hasn't been defined, then this is a newly logged in user and you can do your initialisation stuff, record the login etc and store something in our session variable session.setAttribute(USER_LOGGED_IN, Obj) If you want to log the user out you can use session.invalidate() --jason Adam Hardy wrote: The drawback to using filters compared to security constraints is that you would have to roll your own login mechanism - which seems unnecessary when you could use the container's authentication method. Did you mention having to change Tomcat to get it to use your JDBC realm? I'm not sure quite what you mean, but yes I suppose if you have a complex realm module and you're not going to use container-managed security, I guess filters or constraints would be just as good. Adam Michael Remijan wrote: Filters have mapping patterns just like servlets have mapping patters (take a look at the web.xml DTD). So like you say servlet Foo is mapped to *.foo or /foo/* you can map a filter to urls as well. So if you have a directory in your webapp named secure. can protect all the jsp pages in that directory with the mapping /secure/*. similarly, you can add the mappings of servlets to protect them in the same way. Michael. -Original Message- From: Jing Zhou [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 11:54 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. This is an interesting use of Filters. Our action mappings have an attribute, 'privileged'. When the privileged attribute is set to true, users only with a true privileged mode in his/her action tracking (in the user's session) can execute the corresponding actions. Can a filter be easily bound to the dynamic security requirements as shown above? and in what ways, any ideas? Jing - Original Message - From: Michael Remijan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:49 AM Subject: RE: Looking for ideas for action servlet checking for logged in user. I've found using security constraints to be a little cumbersome, especially since it requires some moderate modification of tomcat to put in a jdbc realm that fits your needs. My preference is to use Filters. A filter set up on your secure directory (specifed as /secure-dir-name/*) can be run, check for an object in the session, and easily redirect if not found. Mike -Original Message- From: Jing Zhou [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:10 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 4:13 AM Subject: Re: Looking for ideas for action servlet checking for logged in user. I would use container-managed security. All the secured pages
RE: Difference between ValidatorForm and ValidatorActionForm?
So do you have to do anything differently in your validation.xml? Also, where can I find some documentation on this? - Keith -Original Message- From: Butash, Bob [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 12:59 PM To: 'Struts Users Mailing List' Subject: RE: Difference between ValidatorForm and ValidatorActionForm? Yansheng, Since ActionForms are intended to be reused across multiple actions, you might have different validation requirements depending on the context that the ActionForm is being used. One Action might require a certain field but that field may not be required for another Action that is using the same ActionForm. Hope this helps. -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:52 AM To: 'Struts Users Mailing List' Subject: Difference between ValidatorForm and ValidatorActionForm? I kind of understand it. ValidatorForm validates the form and ValidatorActionForm validates the form based on action path. But why would you prefer one over the other? I mean you can achieve almost the same effect with either. Thanks! - 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: Tiles Tab to Actions
Where were you guys two days ago. :) I spent over a day writing my own tabs. I didn't know struts had built in tab support. Any documentation you can point me to? -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 6:29 AM To: Struts Users Mailing List Subject: Tiles Tab to Actions I am using the Tiles Tab Layout and I need the links to go to an action rather than a jsp page? Does anyone know how I go about do that. Here is my Tiles Def for the layout !-- tabs page -- definition name=prtr.pr.tabs.page extends=prtr.default put name=body-content value=prtr.tabs.body/ /definition !-- body using tabs -- definition name=prtr.tabs.body path=/jsp/prtr/layouts/tabsLayout.jsp put name=selectedIndex value=0/ put name=parameterName value=selected/ putList name=tabList item value=Description link=/jsp/prtr/tabs/prDescription.jsp/ item value=Size link=/jsp/prtr/tabs/size.jsp/ item value=Checklists link=/jsp/prtr/tabs/checklists.jsp/ item value=Meetings link=/jsp/prtr/tabs/meetings.jsp/ item value=Defects link=/jsp/prtr/tabs/defects.jsp/ item value=Comments link=/jsp/prtr/tabs/comments.jsp/ item value=Distribution link=/jsp/prtr/tabs/distribution.jsp/ item value=Review link=/jsp/prtr/tabs/review.jsp/ item value=TestTab link=/promis/action/createPeerRecord/ /putList /definition Actually, I need it to go to a particular JSP (for example I need the Size tab to go to the Size JSP) but through an action rather than a link Can anyone help? Thanks, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Anyone using SSLExt with Container Managed Security JAAS?
Is Anyone using SSLExt with Container Managed Security JAAS? --- Thanks... Mick Knutson --- _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Looking for ideas for action servlet checking for logged in user.
I just got the securityfilter-example.war deployed successfully in no time. Hmmm. I may have to look into this. I have been looking for a cross container way to have authentication done and be able to use the request methods (like isUserInRole, etc.). -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:27 AM To: 'Struts Users Mailing List' Subject: RE: Looking for ideas for action servlet checking for logged in user. I didn't know about this project. I am very interested. Anybody deploy this with JRun4? -Original Message- From: Jason Lea [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 5:34 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. In case no one has mentioned it yet: http://securityfilter.sourceforge.net/ This emulates the container managed security but uses filters. You can define the security contraints in security-filter.xml (looks similar in structure to web.xml) eg security-constraint web-resource-collection web-resource-nameAdministrator-only Area/web-resource-name url-pattern/admin/*/url-pattern /web-resource-collection auth-constraint role-nameadmin/role-name /auth-constraint /security-constraint You can even use the Tomcat's JDBC Realm with it. This means you can use the request.isUserInRole() and you can define access to Struts actions by role eg: action path=/admin/Admin type=org.apache.struts.actions.ForwardAction parameter=.main.admin roles=admin,someOtherRole,yetAnotherRole /action Or display tiles if they have the right role eg definition name=.secrets.tile path=/WEB-INF/jsp/tiles/secrets.jsp role=admin / The other problem you normally encounter is creating a few objects that you want in your session after a user logs in eg get user's name, email, phone number etc throw it into a User object and store it in the session so you can refer to it later. There are a couple of choices... 1. Create a BaseAction class that all of your other Actions extend 2. Use a Filter The process is the same for each: a. Check to see if request.getUserPrincipal() is not null. If null, the user has not been authenticated b. If the user has been authenticated check to see if you have defined a session variable eg session.getAttribute(USER_LOGGED_IN) c. If it hasn't been defined, then this is a newly logged in user and you can do your initialisation stuff, record the login etc and store something in our session variable session.setAttribute(USER_LOGGED_IN, Obj) If you want to log the user out you can use session.invalidate() --jason Adam Hardy wrote: The drawback to using filters compared to security constraints is that you would have to roll your own login mechanism - which seems unnecessary when you could use the container's authentication method. Did you mention having to change Tomcat to get it to use your JDBC realm? I'm not sure quite what you mean, but yes I suppose if you have a complex realm module and you're not going to use container-managed security, I guess filters or constraints would be just as good. Adam Michael Remijan wrote: Filters have mapping patterns just like servlets have mapping patters (take a look at the web.xml DTD). So like you say servlet Foo is mapped to *.foo or /foo/* you can map a filter to urls as well. So if you have a directory in your webapp named secure. can protect all the jsp pages in that directory with the mapping /secure/*. similarly, you can add the mappings of servlets to protect them in the same way. Michael. -Original Message- From: Jing Zhou [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 11:54 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. This is an interesting use of Filters. Our action mappings have an attribute, 'privileged'. When the privileged attribute is set to true, users only with a true privileged mode in his/her action tracking (in the user's session) can execute the corresponding actions. Can a filter be easily bound to the dynamic security requirements as shown above? and in what ways, any ideas? Jing - Original Message - From: Michael Remijan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 10:49 AM Subject: RE: Looking for ideas for action servlet checking for logged in user. I've found using security constraints to be a little cumbersome, especially since it requires some moderate modification of tomcat to put in a jdbc realm that fits your needs. My preference is to use Filters. A filter set up on your secure directory (specifed as /secure-dir-name/*) can be run, check for an object in the session, and easily redirect if not found. Mike -Original Message- From: Jing Zhou
Application Properties
Is there any way to avoid reloading the application in the server(tomcat 4.1.18) when an appliaction property is changed, I mean any methods or code is appreciated. Thanks in advance, Srikanth. -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:29 AM To: 'Struts Users Mailing List' Subject: RE: Tiles Tab to Actions Where were you guys two days ago. :) I spent over a day writing my own tabs. I didn't know struts had built in tab support. Any documentation you can point me to? -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 6:29 AM To: Struts Users Mailing List Subject: Tiles Tab to Actions I am using the Tiles Tab Layout and I need the links to go to an action rather than a jsp page? Does anyone know how I go about do that. Here is my Tiles Def for the layout !-- tabs page -- definition name=prtr.pr.tabs.page extends=prtr.default put name=body-content value=prtr.tabs.body/ /definition !-- body using tabs -- definition name=prtr.tabs.body path=/jsp/prtr/layouts/tabsLayout.jsp put name=selectedIndex value=0/ put name=parameterName value=selected/ putList name=tabList item value=Description link=/jsp/prtr/tabs/prDescription.jsp/ item value=Size link=/jsp/prtr/tabs/size.jsp/ item value=Checklists link=/jsp/prtr/tabs/checklists.jsp/ item value=Meetings link=/jsp/prtr/tabs/meetings.jsp/ item value=Defects link=/jsp/prtr/tabs/defects.jsp/ item value=Comments link=/jsp/prtr/tabs/comments.jsp/ item value=Distribution link=/jsp/prtr/tabs/distribution.jsp/ item value=Review link=/jsp/prtr/tabs/review.jsp/ item value=TestTab link=/promis/action/createPeerRecord/ /putList /definition Actually, I need it to go to a particular JSP (for example I need the Size tab to go to the Size JSP) but through an action rather than a link Can anyone help? Thanks, Natalie - 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: Message Resources example using OJB
Check source forge www.sf.net, I think James from this list created one about 6 months ago and he was very happy with the performance of it. -Original Message- From: Srikanth Gubba [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 9:37 AM To: '[EMAIL PROTECTED]' Subject: Message Resources example using OJB Hi all, Has anyone tried and used Message Resources example using OJB which can be used to place the application properties in a database instead of a properties file. If anyone has tried this, can u help me know what to do when a property is changed in the database, at present i am having to reload the application. Is there any way around this so that the application reads the properties dynamically. Thanks in adv, srikanth. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Empty Result Set
Does the ResultSet have to be scrollable for this to work? I'm getting an error that tells me that my result set isn't scrollable. I think it's weird because I can make a call on rs.next() in a while loop using a default resultset without a problem. Confusing... - Keith -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 1:35 PM To: Struts Users Mailing List Subject: Re: [OT] Empty Result Set boolean isEmpty = !rs.next(); David --- Kamholz, Keith (corp-staff) USX [EMAIL PROTECTED] wrote: Hey everyone, This isn't really a struts question, but it's applicable. I'm just wondering how to find out if a ResultSet is empty or not after I execute my query. I've searched online, but I'm having a hard time finding much of anything. Can I just use: if (myResultSet.next() ) { empty = false; } else { empty = true; } Would that work or would that not do what I'm looking for? Any help would be appreciated, thanks! - Keith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Looking for ideas for action servlet checking for logged in user.
I'll definitely will be able to make good use of some type of cross-container authentication in the system I'm building now. I never new that this was even possible. :) ...reading though project docs now... --Alen - Original Message - From: Bailey, Shane C. [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 7:02 PM Subject: RE: Looking for ideas for action servlet checking for logged in u ser. I just got the securityfilter-example.war deployed successfully in no time. Hmmm. I may have to look into this. I have been looking for a cross container way to have authentication done and be able to use the request methods (like isUserInRole, etc.). -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:27 AM To: 'Struts Users Mailing List' Subject: RE: Looking for ideas for action servlet checking for logged in user. I didn't know about this project. I am very interested. Anybody deploy this with JRun4? -Original Message- From: Jason Lea [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 5:34 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. In case no one has mentioned it yet: http://securityfilter.sourceforge.net/ This emulates the container managed security but uses filters. You can define the security contraints in security-filter.xml (looks similar in structure to web.xml) eg security-constraint web-resource-collection web-resource-nameAdministrator-only Area/web-resource-name url-pattern/admin/*/url-pattern /web-resource-collection auth-constraint role-nameadmin/role-name /auth-constraint /security-constraint You can even use the Tomcat's JDBC Realm with it. This means you can use the request.isUserInRole() and you can define access to Struts actions by role eg: action path=/admin/Admin type=org.apache.struts.actions.ForwardAction parameter=.main.admin roles=admin,someOtherRole,yetAnotherRole /action Or display tiles if they have the right role eg definition name=.secrets.tile path=/WEB-INF/jsp/tiles/secrets.jsp role=admin / The other problem you normally encounter is creating a few objects that you want in your session after a user logs in eg get user's name, email, phone number etc throw it into a User object and store it in the session so you can refer to it later. There are a couple of choices... 1. Create a BaseAction class that all of your other Actions extend 2. Use a Filter The process is the same for each: a. Check to see if request.getUserPrincipal() is not null. If null, the user has not been authenticated b. If the user has been authenticated check to see if you have defined a session variable eg session.getAttribute(USER_LOGGED_IN) c. If it hasn't been defined, then this is a newly logged in user and you can do your initialisation stuff, record the login etc and store something in our session variable session.setAttribute(USER_LOGGED_IN, Obj) If you want to log the user out you can use session.invalidate() --jason Adam Hardy wrote: The drawback to using filters compared to security constraints is that you would have to roll your own login mechanism - which seems unnecessary when you could use the container's authentication method. Did you mention having to change Tomcat to get it to use your JDBC realm? I'm not sure quite what you mean, but yes I suppose if you have a complex realm module and you're not going to use container-managed security, I guess filters or constraints would be just as good. Adam Michael Remijan wrote: Filters have mapping patterns just like servlets have mapping patters (take a look at the web.xml DTD). So like you say servlet Foo is mapped to *.foo or /foo/* you can map a filter to urls as well. So if you have a directory in your webapp named secure. can protect all the jsp pages in that directory with the mapping /secure/*. similarly, you can add the mappings of servlets to protect them in the same way. Michael. -Original Message- From: Jing Zhou [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 11:54 AM To: Struts Users Mailing List Subject: Re: Looking for ideas for action servlet checking for logged in user. This is an interesting use of Filters. Our action mappings have an attribute, 'privileged'. When the privileged attribute is set to true, users only with a true privileged mode in his/her action tracking (in the user's session) can execute the corresponding actions. Can a filter be easily bound to the dynamic security requirements as shown above? and in what ways, any ideas? Jing - Original Message - From: Michael Remijan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday,
RE: Message Resources example using OJB
Hi, I am currently using this which is very good, but want to know the ways to avoid relocading the application when a property is changed. Thanks, Srikanth. -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:25 AM To: 'Struts Users Mailing List' Subject: RE: Message Resources example using OJB Check source forge www.sf.net, I think James from this list created one about 6 months ago and he was very happy with the performance of it. -Original Message- From: Srikanth Gubba [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 9:37 AM To: '[EMAIL PROTECTED]' Subject: Message Resources example using OJB Hi all, Has anyone tried and used Message Resources example using OJB which can be used to place the application properties in a database instead of a properties file. If anyone has tried this, can u help me know what to do when a property is changed in the database, at present i am having to reload the application. Is there any way around this so that the application reads the properties dynamically. Thanks in adv, srikanth. - 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]
Question reguarding ActionForms
Hi Everyone, Ok.. we have been using struts for sometime now and have recently come a realization that i would love to get confirmed or corrected. ActionForms: All variables that are editable should be Strings! no wrappers or other toString() tricks.. if you want to use validation and struts they best be Strings! That being said.. i dont want my core models to be that way which means my actions will need to do some population of the form prior and after the jsp is displayed. Is this inline with what everyone else is doing ? Thanks, J. Guillemette
RE: Difference between ValidatorForm and ValidatorActionForm?
Keith, I'm currently reading Programming Jakarta Struts by Chuck Cavaness. It has been a really good book so far and gives you a strong foundation to build on. In you validation.xml file for the form element's name attribute you need to give the action's name that you want the validation rule to be in effect for. Example validation.xml entry: formset form name=/rootSelection field property=rootPath depends=required arg0 key=formFields.rootPath/ /field /form /formset Example Action Mapping: action path=/rootSelection type=com.eds.bluesphere.propertywizard.component.RootPathSelectionProcess name=rootSelectionForm scope=request validate=true input=/jsp/rootPathSelectionDisplay.jsp /action The ValidatorActionForm will obtain the ActionForm name from your ActionMapping. Hope this helps. -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 1:05 PM To: 'Struts Users Mailing List' Subject: RE: Difference between ValidatorForm and ValidatorActionForm? So do you have to do anything differently in your validation.xml? Also, where can I find some documentation on this? - Keith -Original Message- From: Butash, Bob [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 12:59 PM To: 'Struts Users Mailing List' Subject: RE: Difference between ValidatorForm and ValidatorActionForm? Yansheng, Since ActionForms are intended to be reused across multiple actions, you might have different validation requirements depending on the context that the ActionForm is being used. One Action might require a certain field but that field may not be required for another Action that is using the same ActionForm. Hope this helps. -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:52 AM To: 'Struts Users Mailing List' Subject: Difference between ValidatorForm and ValidatorActionForm? I kind of understand it. ValidatorForm validates the form and ValidatorActionForm validates the form based on action path. But why would you prefer one over the other? I mean you can achieve almost the same effect with either. Thanks! - 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: Message Resources example using OJB
On Thursday 26 June 2003 11:25, Hookom, Jacob wrote: Check source forge www.sf.net, I think James from this list created one about 6 months ago and he was very happy with the performance of it. That is the one Srikanth is speaking about. We had an off-line discussion about caching, and I just wasn't able to help. I know enough about OJB to get this implementation to work. Deeper configuration is up to the developer. The only thing I can suggest is to change ObjectCacheClass to use org.apache.ojb.broker.cache.ObjectCacheDefaultImpl in your OJB.properties file. Good luck with it. -Original Message- From: Srikanth Gubba [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 9:37 AM To: '[EMAIL PROTECTED]' Subject: Message Resources example using OJB Hi all, Has anyone tried and used Message Resources example using OJB which can be used to place the application properties in a database instead of a properties file. If anyone has tried this, can u help me know what to do when a property is changed in the database, at present i am having to reload the application. Is there any way around this so that the application reads the properties dynamically. Thanks in adv, srikanth. - 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] -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 770-822-3359 AIM:jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Empty Result Set
--- Kamholz, Keith (corp-staff) USX [EMAIL PROTECTED] wrote: Does the ResultSet have to be scrollable for this to work? I'm getting an error that tells me that my result set isn't scrollable. I think it's weird because I can make a call on rs.next() in a while loop using a default resultset without a problem. Confusing... I don't set any special properties on the ResultSet and it works fine. David - Keith -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 1:35 PM To: Struts Users Mailing List Subject: Re: [OT] Empty Result Set boolean isEmpty = !rs.next(); David --- Kamholz, Keith (corp-staff) USX [EMAIL PROTECTED] wrote: Hey everyone, This isn't really a struts question, but it's applicable. I'm just wondering how to find out if a ResultSet is empty or not after I execute my query. I've searched online, but I'm having a hard time finding much of anything. Can I just use: if (myResultSet.next() ) { empty = false; } else { empty = true; } Would that work or would that not do what I'm looking for? Any help would be appreciated, thanks! - Keith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Message Resources example using OJB
On Thursday 26 June 2003 13:30, James Mitchell wrote: On Thursday 26 June 2003 11:25, Hookom, Jacob wrote: Check source forge www.sf.net, I think James from this list created one about 6 months ago and he was very happy with the performance of it. That is the one Srikanth is speaking about. We had an off-line discussion about caching, and I just wasn't able to help. I know enough about OJB to get this implementation to work. Deeper configuration is up to the developer. The only thing I can suggest is to change ObjectCacheClass to use org.apache.ojb.broker.cache.ObjectCacheDefaultImpl in your OJB.properties ...sorry, that was supposed to ObjectCacheEmptyImpl, but now that I think about it, you may need to upgrade OJB to a newer version to get that class. file. Good luck with it. -Original Message- From: Srikanth Gubba [mailto:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 9:37 AM To: '[EMAIL PROTECTED]' Subject: Message Resources example using OJB Hi all, Has anyone tried and used Message Resources example using OJB which can be used to place the application properties in a database instead of a properties file. If anyone has tried this, can u help me know what to do when a property is changed in the database, at present i am having to reload the application. Is there any way around this so that the application reads the properties dynamically. Thanks in adv, srikanth. - 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] -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 770-822-3359 AIM:jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Difference between ValidatorForm and ValidatorActionForm?
The core difference is what will be used as reference when running the validation lets say you have an form object that spans 3 actions ( is shared by ) and all of them have validate = true in the struts-config.xml if you use ValidatorForm to then all of the validation rules you specify will be run. which may or may not be good.. if you use ValidatorActionForm then you can break up the validation rules into chuncks based on the action that was run. The only difference in the validation setup is wether your form entrie referes to the form object or the action. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
entity refs in struts config files
Does anyone know if entity refs (such as those described at the bottom of http://jamesholmes.com/struts/) work properly in struts 1.0.2 config files? They sort of seem to work for me, except that relative references seem to be relative to ${TOMCAT_HOME)/bin rather than ${TOMCAT_HOME}/webapps/foocontext/WEB-INF where the struts config file is located. Any info would be much appreciated! Thanks, Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: common-logging, Struts, Log4j
Rabih, You place the properties files at the wrong place. Move them to WEB-INF/classes -D - Original Message - From: rablists [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 5:50 AM Subject: common-logging, Struts, Log4j Hi. I have problem in using the common-logging with struts and Log4j. I am basically lost. I have short questions, I appreciate if anyone can help me little bit. these are the questions with examples: The file outputfile.log that I specify in log4j.appender.LOGFILE.File=outputfile.log where it is located? where I find it? is it physical file? I dont know why my configuration is not working, although I put the following files in the classpath WEB-INF/classes/org/myclasses/: commons-logging.properties: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL ogger log4j.properties: log4j.rootLogger=DEBUG, rolling log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m% n log4j.appender.rolling=org.apache.log4j.RollingFileAppender log4j.appender.rolling.File=outputfile.log log4j.appender.rolling.MaxFileSize=100KB log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p % c - %m%n What else should I specify, or configure to make it to work? I have log4j-1.2.4.jar in my WEB-INF/lib/ Should I set any system propreties? or web.xml? or struts-config? In my classes I am doing that: protected static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(this.class); if (log.isDebugEnabled()) log.debug(getMessage( + locale + , + key + )); (How can I enable/disable the Debug or Trace?) Thank you in advance. I am really stuck and I couldnt make it to work. I am using tomcat 4.18 Rabih - 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: common-logging, Struts, Log4j
Thank you. It worked fine. The properties files should be under WEB- INF/classes directly. Plus, the major problem was with the commons- logging jar files: I should put in the WEB-INF/lib only the commons- logging.jar, and delete the commons-logging-api.jar, which should be placed instead under the tomact/common/lib/ Confusing but it worked fine. Rabih. --- In [EMAIL PROTECTED], Pingili, Madhupal [EMAIL PROTECTED] wrote: I have the similar setup and works very well for me. log4j.appender.LOGFILE.File=outputfile.log where it is located? where I find it? is it physical file? It should be saved under the app. server bin dir like c:/tomcat- 4.18/bin. I don't use tomcat. But websphere app. server saves this file under bin folder. If you want, you can give absolute path like c:/tomcat-4.18/logs/outputfile.log. log4j.rootLogger=DEBUG, rolling Here you have not declared stdout as an appender. So, all log messages (because you have lowest level DEBUG for rootLogger) will be sent to file declared in rolling appender. You can include stdout in rootLogger like log4j.rootLogger=DEBUG, stdout, rolling and check your tomcat log files to see if there is anything written before you check rolling file permissions etc. Hope this helps. Reddy Original Message- From: rablists [SMTP:[EMAIL PROTECTED] Sent: Thursday, June 26, 2003 8:51 AM To: [EMAIL PROTECTED] Subject:common-logging, Struts, Log4j Hi. I have problem in using the common-logging with struts and Log4j. I am basically lost. I have short questions, I appreciate if anyone can help me little bit. these are the questions with examples: The file outputfile.log that I specify in log4j.appender.LOGFILE.File=outputfile.log where it is located? where I find it? is it physical file? I dont know why my configuration is not working, although I put the following files in the classpath WEB-INF/classes/org/myclasses/: commons-logging.properties: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JL ogger log4j.properties: log4j.rootLogger=DEBUG, rolling log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m% n log4j.appender.rolling=org.apache.log4j.RollingFileAppender log4j.appender.rolling.File=outputfile.log log4j.appender.rolling.MaxFileSize=100KB log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - % p % c - %m%n What else should I specify, or configure to make it to work? I have log4j-1.2.4.jar in my WEB-INF/lib/ Should I set any system propreties? or web.xml? or struts- config? In my classes I am doing that: protected static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(this.class); if (log.isDebugEnabled()) log.debug(getMessage( + locale + , + key + )); (How can I enable/disable the Debug or Trace?) Thank you in advance. I am really stuck and I couldnt make it to work. I am using tomcat 4.18 Rabih - 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: Question - how many of us?
On Thu, 26 Jun 2003, Adam Hardy wrote: Date: Thu, 26 Jun 2003 10:21:51 +0200 From: Adam Hardy [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Question - how many of us? Wow - average 70 to 100 thousand downloads per month according to those stats. Not all of those hits are downloads, since every access to any page in the online documentation counts :-). Presume average 80,000 per month for the last 12 months, even if only 25% of the downloads lead to people using struts, that's 12 * 0.25 * 8 = 240,000 users. Alas, there are also a few folks who have downloaded more than one version of Struts over the last three years OK so there's some way to go yet before struts achieves the same market saturation as Windows ;) Yep. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]