FW: newbie html-el question
I am trying to display a value from a requestAttribute in an html-el:text ... but I can't get it to work. Here is my code: html-el:text: property=searchType value=%=request.getAttribute(searchType)%/ I recieve the error: Attribute searchType has no value Someone told me I have to do something more like this: html-el:text property=searchType value=${searchType}/ but where would I define the variable searchType that is accessed there? I tried defining a local string variable called searchType hoping its value would be passed in, but no luck. Just hitting a wall on what I'm hoping is a pretty simple issue. I googled this one for a while with no luck before coming here. Thanks!, Jim This e-mail transmission contains information that is confidential and may be privileged. It is intended only for the addressee(s) named above. If you receive this e-mail in error, please do not read, copy or disseminate it in any manner. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this information is prohibited. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please erase it from your computer system. Your assistance in correcting this error is appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie html-el question
I am trying to display a value from a requestAttribute in an html-el:text ... but I can't get it to work. Here is my code: html-el:text: property=searchType value=%=request.getAttribute(searchType)%/ I recieve the error: Attribute searchType has no value Someone told me I have to do something more like this: html-el:text property=searchType value=${searchType}/ That's exactly what you should be doing but where would I define the variable searchType that is accessed there? searchType should be saved as an attribute of (preferably) your request object. Actually, a local variable should also work, you can define it using the c:set... JSTL tag. Actually, you shouldn't need to specify a value here at all. The html-el:text... tag will get the default value from your form bean. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie html-el question
From: Bender, James [mailto:[EMAIL PROTECTED] I am trying to display a value from a requestAttribute in an html-el:text ... but I can't get it to work. Here is my code: html-el:text: property=searchType value=%=request.getAttribute(searchType)%/ I recieve the error: Attribute searchType has no value Someone told me I have to do something more like this: html-el:text property=searchType value=${searchType}/ but where would I define the variable searchType that is accessed there? You wouldn't, you'd set the property of the Form bean and let Struts handle it. If you need to pre-populate the form, you do that in the Action by calling setSearchType() on your Form bean. Then when you forward to the JSP, Struts will fill in the value. Can you explain more about your situation? I'm making some assumptions that may not be correct. In general there's no need to touch the 'value' attribute of the tags that render HTML form elements. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie html-el question
Hi Wendy, Thanks for responding! Someone showed me a way to do what I needed to do, but the way I'm approaching the entire problem may be kludged: The user can click Search Attributes | Search Components | Search Templates I've provided html:link's like these respectively: doPrepareSearch.do?searchType=attribute | doPrepareSearch.do?searchType=component | doPrepareSearch.do?searchType=template so when they user lands on my form, I want to prepopulate the search type based on what they chose. If they submit a search with bad data, then I'd want the SearchForm's (extends ActionForm) validate() method to send the back to the search form, this time keeping their most recent entries to the form field -- if they changed search type for example now it would be different. I am new to Struts and may not be getting a key concept of it's Best Practices usage. Does it make sense what I've described? Thanks again!, Jim -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Friday, March 26, 2004 2:03 PM To: Struts Users Mailing List Subject: RE: newbie html-el question From: Bender, James [mailto:[EMAIL PROTECTED] I am trying to display a value from a requestAttribute in an html-el:text ... but I can't get it to work. Here is my code: html-el:text: property=searchType value=%=request.getAttribute(searchType)%/ I recieve the error: Attribute searchType has no value Someone told me I have to do something more like this: html-el:text property=searchType value=${searchType}/ but where would I define the variable searchType that is accessed there? You wouldn't, you'd set the property of the Form bean and let Struts handle it. If you need to pre-populate the form, you do that in the Action by calling setSearchType() on your Form bean. Then when you forward to the JSP, Struts will fill in the value. Can you explain more about your situation? I'm making some assumptions that may not be correct. In general there's no need to touch the 'value' attribute of the tags that render HTML form elements. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail transmission contains information that is confidential and may be privileged. It is intended only for the addressee(s) named above. If you receive this e-mail in error, please do not read, copy or disseminate it in any manner. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this information is prohibited. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please erase it from your computer system. Your assistance in correcting this error is appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie html-el question
From: Bender, James [mailto:[EMAIL PROTECTED] The user can click Search Attributes | Search Components | Search Templates I've provided html:link's like these respectively: doPrepareSearch.do?searchType=attribute | doPrepareSearch.do?searchType=component | doPrepareSearch.do?searchType=template When the user clicks one of those, Struts will populate the form associated with (I assume) PrepareSearchAction. Does the mapping for that have a 'name' attribute? Does that Form have get/setSearchType methods? If you need to remember data, it's often easiest to put the Form bean in session scope. And you can associate one Form to several different Actions if it makes sense for your application. Some people will argue against session scope, so you may want to consult the archives and see if their reasons apply to your situation. so when they user lands on my form, I want to prepopulate the search type based on what they chose. That will just magically happen if you let Struts populate the form from the query string parameter and then use the same Form bean when you display your HTML form using the JSP. Rather than confuse the issue, if you still need help, post your struts-config.xml so we can see what you've got. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:javascript question
And alternatively, logic:messagesPresent script language=jscriptalert('bean:message key=global.error.heading/\n\nhtml:messages id=error - bean:write name=error/\n\n/html:messages') /script /logic:messagesPresent global.error.heading=An Error(s) has occured: Colm -Original Message- From: Andreas Solarik [mailto:[EMAIL PROTECTED] Sent: 24 March 2004 15:18 To: 'Struts Users Mailing List' Subject: AW: html:javascript question nice one, didn't even occur to me to do this. Andreas -Ursprüngliche Nachricht- Von: Janarthan Sathiamurthy [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 24. März 2004 16:05 An: Struts Users Mailing List Betreff: RE: html:javascript question var myMessage = bean:write name=msg /; alert(myMessage) -Original Message- From: Daniel [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 6:23 PM To: Struts Users Mailing List Subject: html:javascript question I want to put the msg inside a javasript alert (popup with error message ),some one know how can I make it ??? font color=red html:messages id=msg message=true bundle=geral bean:write name=msg /br /html:messages /font - 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]
tiles question
Hi all, I have an html page (external.html) and in another my struts application is running, could I use a title:put pointing to his web page? That page is a dynamic perl page... I don't know if tiles:get tag gets directly a file, o maybe it can do a http request to another machine, in order to get html code. Maybe I don't explain very well :) I want somethins like this: definition name=layout extends=myLayout put name=title value=titleName / put name=body value=http://x.x.x.x/external.html; / /definition external.html is a page that forwards to a html page (made with perl). could toy help me, please? Thanks, Mariano. -- Mariano García González :: Ingeniero de Sistemas OPTIVA MEDIAPGP 0x89E8E4CE O'Donnel 29 28010 Madrid (España) t. +34 91 577 80 57 www.optivamedia.com © This message is printed on 100% recycled electrons. signature.asc Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente
html:javascript question
I want to put the msg inside a javasript alert (popup with error message ),some one know how can I make it ??? font color=red html:messages id=msg message=true bundle=geral bean:write name=msg /br /html:messages /font
AW: html:javascript question
Well, I believe that you are not allowed to mix static and dynamic text within a JSP, so something like alert(Error message: bean:write name=msg/); should fail. I read once that enclosing the dynamic text in single quotes whould work (never tried it though). One solution that I do know is: snip % String tempString=Error message: + whateverBean.getWhatever(); % alert(%= tempString %); /snip Its ugly, but it works. Anyone know of a more elegant solution? Note that you need to get to the data contained in the bean you are writing from, possibly with a request.getAtribute(attributeName); Good luck, Andreas -Ursprüngliche Nachricht- Von: Daniel [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 24. März 2004 13:53 An: Struts Users Mailing List Betreff: html:javascript question I want to put the msg inside a javasript alert (popup with error message ),some one know how can I make it ??? font color=red html:messages id=msg message=true bundle=geral bean:write name=msg /br /html:messages /font - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Basic question about ActionForms
Hi all, In my app I am using a DynaActionForm with scope = session. When I am calling the action for the first time, obviously the Form is 'emtpy', so I populate it with all the values.. When I am redirected to the action class again, the actionform Should be in the session (in theory). However, what is in the session looks like an 'empty' actionform as it Was before. Now the question: if my actionform has scope of session, do I have to Put the value in the session explicitly or struts will do it for me? IT LOOKS like all the values are erased all the time, no matter if I have Specified as scope session.. Anyone has any clues of what's going on? Regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:javascript question
var myMessage = bean:write name=msg /; alert(myMessage) -Original Message- From: Daniel [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 6:23 PM To: Struts Users Mailing List Subject: html:javascript question I want to put the msg inside a javasript alert (popup with error message ),some one know how can I make it ??? font color=red html:messages id=msg message=true bundle=geral bean:write name=msg /br /html:messages /font - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: html:javascript question
nice one, didn't even occur to me to do this. Andreas -Ursprüngliche Nachricht- Von: Janarthan Sathiamurthy [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 24. März 2004 16:05 An: Struts Users Mailing List Betreff: RE: html:javascript question var myMessage = bean:write name=msg /; alert(myMessage) -Original Message- From: Daniel [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 6:23 PM To: Struts Users Mailing List Subject: html:javascript question I want to put the msg inside a javasript alert (popup with error message ),some one know how can I make it ??? font color=red html:messages id=msg message=true bundle=geral bean:write name=msg /br /html:messages /font - 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: Basic question about ActionForms
Marco, This could be caused by how your mappings are configured. If you can send more information, someone might spot the cause. Hubert --- Marco Mistroni [EMAIL PROTECTED] wrote: Hi all, In my app I am using a DynaActionForm with scope = session. When I am calling the action for the first time, obviously the Form is 'emtpy', so I populate it with all the values.. When I am redirected to the action class again, the actionform Should be in the session (in theory). However, what is in the session looks like an 'empty' actionform as it Was before. Now the question: if my actionform has scope of session, do I have to Put the value in the session explicitly or struts will do it for me? IT LOOKS like all the values are erased all the time, no matter if I have Specified as scope session.. Anyone has any clues of what's going on? Regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
greetings a newbie question
hi, just joined the list, and i have a newbie question about struts design. this is where i am at. i have looked at struts about a year back, and rolled my own version of mvc web architecture, stealing several basic ideas from struts. at the time, it appeared that many features of struts were not apparently applicable to the project, so the overhead of configuring struts didn't seem justifiable. now the need for many of the struts features has become pretty concrete, and so i am in process of incorporating struts rather than re-inventing the wheels (and axels and cupholders, etc). while adapting the code base to use struts, i get the sense that: these are the classes/packages; for many, you can configure/adapt it to your needs via config files; in other aspects, you may want/need to subclass and override some of the classes to fit your needs. for the later category of adaptation (subclassing/overriding), the best way seems to be to look into the source to ascertain the default behavior and to ensure the overriding implementation is proper. to put it simply, struts' interface doesn't seem to be clearly defined. by clearly defined interface, i mean programming/usage could/should be via/against the interface without delving into implementation details. if not, pointer(s) to the authoritative interface defnitions would be much appreciated (i told you i'm a newbie). but if so, is this deliberate? and the reasoning behind? some obvious (generic) arguments i could see are: 1. it's advantageous in order to provide greater flexibility, struts being a development framework 2. struts (and web app requirements) are progressing rapidly, so loose interface may serve the purpose better are there more specific reasons other than these? or perhaps it is simply a documentation issue? thanx for any insight/info, dasa ps: i am sending this to both the user and dev lists, thinking the subject is of interest to both. perhaps you'll correct me. again, a newbie here. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Design Question
Hi, In my previous company I had exactly what you are talking about, Access and fields are restricted by country (and we had also different Names for fields depending on the country - not internationalization, just Different name). Solution adopted was to have only ONE database in which you store permissions by country.. When your struts app has to display the data in the page, we look up Database to see which fields you can display Hope this helps Regards Marco PS this of course involves writing a gui tool that writes in the Database the permissions and modifies it. If you are using Hibernate Than that will save you a lot of time (you can reuse the framework For both the GUI tool and the struts app) Good luck! -Original Message- From: Claudio Sanchez [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 00:52 To: [EMAIL PROTECTED] Subject: [OT] Design Question Hi all, This is off-topic, but i hope that somebody helps me. I have an application that use struts, spring and hibernate. The security is based on roles using CMS (JdbcRealm over Tomcat 4.1.29) The goal of this application is to manage contracts. Authorized users creates contracts with supplier's data, start date, end date, etc. Then the application send alarm e-mails to users, for example when a contrat expire, etc. For now everithing works fine. But I have a requirements to people the other countrys use the application. Obviously people of a country can't manage or view the information the other countrys (contracts, users, departments, currencies, etc). The easiest implementation is to have an instance of the application and database for each country. But I dont like this. I'd like to have only one instance to the application. Another idea is separate only the database for country. For example ArgentineanDB and MexicanDB. So when a user access to the application, he(o she) enter his(or her) country and the application use the appropriate database. But i found a problem with this. ¿How to manage security? because now i have the user and role tables in ArgentineanDB and MexicanDB. ¿Is possible change dynamically (depending of the user's country) the user and role table use for the CMS? I think that is not possible. ¿Is there a way to resolve this requirements without change the actual user-role schema? I'd like to hear another options Thanks in advance, Claudio Sanchez (apologize for my english) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Question with Indexed Properties
friendly *bump* On Sun, 21 Mar 2004 18:12:54 -0600 (CST), Craig Tataryn wrote: Hi, I have the following definition in my validation.xml file: formset form name=MarketAddressForm field property=provStateId indexedListProperty=address depends=required arg0 key=Listing.formError.streetProvState/ /field /form /formset I then have a form that is built like so: % addressIndex = address( + region.getKey() + ); % html:select styleClass=Field property='%=addressIndex + .provStateId%' . . . /html:select This generates HTML that looks like: select name=address(355).provStateId class=Field . . . /select However, if I look at the javascript generated by html:javascript formName=addressForm, I find: var bCancel = false; function validateMarketAddressForm(form) { if (bCancel) return true; else return validateRequired(form); } function required () { } So does this mean that indexed properties for the validator do not work in javascript? Or am I doing something wrong? Thanks, Craig tataryn:craig/ tataryn:craig/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] tataryn:craig/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT} web service question
Hi, i am trying to develop a webserivce using RPC and/or SOAP all the samples i have seen dont deal atall with the database or with servlet context, I want to get data from a servlet context which i load when loading the application can anyone provide some code example or site where i can have this kind or example Ashish __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation Question with Indexed Properties
Hi, I have the following definition in my validation.xml file: formset form name=MarketAddressForm field property=provStateId indexedListProperty=address depends=required arg0 key=Listing.formError.streetProvState/ /field /form /formset I then have a form that is built like so: % addressIndex = address( + region.getKey() + ); % html:select styleClass=Field property='%=addressIndex + .provStateId%' . . . /html:select This generates HTML that looks like: select name=address(355).provStateId class=Field . . . /select However, if I look at the javascript generated by html:javascript formName=addressForm, I find: var bCancel = false; function validateMarketAddressForm(form) { if (bCancel) return true; else return validateRequired(form); } function required () { } So does this mean that indexed properties for the validator do not work in javascript? Or am I doing something wrong? Thanks, Craig tataryn:craig/ tataryn:craig/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Object Design Question
On 12/03/2004 21:26, Avinash Gangadharan [EMAIL PROTECTED] wrote: People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. If you're talking about SQL, can't you issue one or two SQL queries (with subselects, inner or outer joins) or write a stored procedure to retrieve all the info? (I am used to work with MySQL so my advanced SQL is a bit rusty) Continuing with simple SQL queries only... You could do this in a 2 step mode: - retrieve all persons who have addresses and employees (1 query per person) - for the remaining people (1-2 queries per person) - get the addresses (select... where person.ssn = address.ssn and id ...) (1 query per person) - get the employees (similar to the previous case) (1 query per person) (anyway you get 3 full table search) If you had to had 2 flags on the Person - hasAddresses and hasEmployees - you could make the queries more simple - fetch for (1-1), (1-0) and (0-0) - but maybe it would be more difficult to maintain. If you are talking about a persistence layer (like OJB - see ojb-user mailing list) some of them have lazy loading: it only loads the Person collection of Addresses only if you use them. This will certainly be simpler... And if you have object cache it could even things up (maybe you could issue a great number SQL queries but if the objects were already in cache then there would be no need for any SQL query). The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. I don¹t see any problem on the design itself (well maybe... it seems you have the social security number has the primary key... pks are not supposed to have any real meaning - what would happen if all of the social security numbers were to be changed? It would generate a huge number of cascade updates. Do whatever you like maybe I am raising a false issue here). Hope it helps, Pedro Salgado Thanks and Regards Avinash - 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]
off-theme question: about getServletConfig and getServeletContext
does the servlet container has only one servletcontext instance for all the servlets it manages? and the same to servletconfig instance? ThanksRegards _ MSN Hotmail http://www.hotmail.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: off-theme question: about getServletConfig and getServeletContext
Quoting Mu Mike [EMAIL PROTECTED]: does the servlet container has only one servletcontext instance for all the servlets it manages? and the same to servletconfig instance? There is one ServletContext instance for each web application (which can encompass many servlets and JSP pages). There is one ServletConfig instance for each servlet. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validwhen validation question
Is it possisble to use validwhen for date fields like comparing dates? Brendan Richards [EMAIL PROTECTED] wrote: I'm looking at using validwhen for a complex validation. I've got a value that can either be ignored when another parameter is set or is valid when it's a date. A simple date validation would be something like this: datePatterndd-MM-var Can a validwhen call another validation? Giving you something like test ((ignoreDate == yes) or ( #insert date validation# )) or should I just write my own validation rule / do it with javascript before I submit? Thanks, Brendan Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time.
[OT]Re: Off topic Oracle JDeveloper question
Martin you can ask this on the JDeveloper forum on OTN http://forums.oracle.com/forums/forum.jsp?forum=83 However, I assume you talking about the New Dialog in JDev 9.0.3 / 9.0.4? The option is there in mine - but you'll find it's disabled unless you have a project created to put it into. So create a new Workspace and project, then bring up the new dialog and away you go... Duncan Martin Gainty wrote: Hello Anyone out there using JDeveloper know how to add Java Web Services item to General / WebServices Menu Sorry for being completely off topic but I dont know where else to ask Thank You, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Regards Duncan Mills - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validwhen validation question
I'm looking at using validwhen for a complex validation. I've got a value that can either be ignored when another parameter is set or is valid when it's a date. A simple date validation would be something like this: field property=date depends=required,date arg0 key=myForm.date/ varvar-namedatePattern/var-namevar-valuedd-MM-/var-value/ var /field Can a validwhen call another validation? Giving you something like field property=date depends=validwhen arg0 key=myform.date/ var var-nametest/var-name var-value((ignoreDate == yes) or ( #insert date validation# ))/var-value /var /field or should I just write my own validation rule / do it with javascript before I submit? Thanks, Brendan
[OT] Design Question
Hi all, This is off-topic, but i hope that somebody helps me. I have an application that use struts, spring and hibernate. The security is based on roles using CMS (JdbcRealm over Tomcat 4.1.29) The goal of this application is to manage contracts. Authorized users creates contracts with supplier's data, start date, end date, etc. Then the application send alarm e-mails to users, for example when a contrat expire, etc. For now everithing works fine. But I have a requirements to people the other countrys use the application. Obviously people of a country can't manage or view the information the other countrys (contracts, users, departments, currencies, etc). The easiest implementation is to have an instance of the application and database for each country. But I dont like this. I'd like to have only one instance to the application. Another idea is separate only the database for country. For example ArgentineanDB and MexicanDB. So when a user access to the application, he(o she) enter his(or her) country and the application use the appropriate database. But i found a problem with this. ¿How to manage security? because now i have the user and role tables in ArgentineanDB and MexicanDB. ¿Is possible change dynamically (depending of the user's country) the user and role table use for the CMS? I think that is not possible. ¿Is there a way to resolve this requirements without change the actual user-role schema? I'd like to hear another options Thanks in advance, Claudio Sanchez (apologize for my english) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
scope question
Hello, I know this could be a dumb question, but how do access the objects stored in the ServletContext object using bean:write a quick answer would help!!
URL Pattern question
HI My URL pattern in web.xml is web-resource-collection web-resource-nameemis-web/web-resource-name descriptionRequire users to authenticate/description url-pattern/emis/*/url-pattern http-methodPOST/http-method http-methodGET/http-method /web-resource-collection Now http://localhost:/emis prompts for CMA login page that I have configured but the following url directly hits the action http://localhost:/emis/taskmanagement/taskCreation.do?actionType=prepopu lateTaskInfo What could be the problem ? Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL Pattern question
HI , Just go through the name of the file matches excatly file name existing directory corrected. Ex: sample/web.xml/*/sample Bye MOHAN RADHAKRISHNAN [EMAIL PROTECTED] wrote: HI My URL pattern in web.xml is emis-web Require users to authenticate /emis/* POST GET Now http://localhost:/emis prompts for CMA login page that I have configured but the following url directly hits the action http://localhost:/emis/taskmanagement/taskCreation.do?actionType=prepopu lateTaskInfo What could be the problem ? Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
RE: scope question
bean:write name=foo property=bar scope=application/ Application scope, aka global, aka servlet context -Original Message- From: Rajat Pandit [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 5:14 AM To: Struts Users Mailing List Subject: scope question Hello, I know this could be a dumb question, but how do access the objects stored in the ServletContext object using bean:write a quick answer would help!! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Off topic Oracle JDeveloper question
Hello Anyone out there using JDeveloper know how to add Java Web Services item to General / WebServices Menu Sorry for being completely off topic but I dont know where else to ask Thank You, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Object Design Question
People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Object Design Question
It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 2:26 PM To: '[EMAIL PROTECTED]' Subject: [OT] Object Design Question People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - 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] Object Design Question
Avinash: ...Adding to what Jacob says below: if you are writing your own, this is a good link to study: http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html Regards, Geeta Hookom, Jacob wrote: It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ridiculously simple (I hope) question about url patterns
I'm trying to an application in progress to use a /do/* url pattern instead of a *.do. I'm finding some strange behavior I haven't quite isolated, but the least of it is that each successive mouseclick is prepending an extra /do to the uri portion of the url. Is there something I need to put into the controller portion of struts config to get this to work correctly? TIA -Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Object Design Question
+1. Join the tables in a query and write an algorithm to parse the results into the view you need. One connection, one query, let the database do the work. Not very OO, but very efficient. robert -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 3:37 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 2:26 PM To: '[EMAIL PROTECTED]' Subject: [OT] Object Design Question People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - 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: [OT] Object Design Question
That's the way I have it now, a view object querying the datastore and forming the business objects. The view issues a query for the parent and then calls the views of the children to give their list of objects for that parent and then constituting the parent completely. I agree getting them back together and then parsing them out would be better but sure not a clean OO way of getting data. -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 1:01 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question +1. Join the tables in a query and write an algorithm to parse the +results into the view you need. One connection, one query, let the database do the work. Not very OO, but very efficient. robert -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 3:37 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 2:26 PM To: '[EMAIL PROTECTED]' Subject: [OT] Object Design Question People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - 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: [OT] Object Design Question
OO is not alwasy the best way; and there are trade offs for every implementation. As Jacob mentioned... It's always on a case by case basis. robert -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 4:46 PM To: 'Struts Users Mailing List' Subject: RE: [OT] Object Design Question That's the way I have it now, a view object querying the datastore and forming the business objects. The view issues a query for the parent and then calls the views of the children to give their list of objects for that parent and then constituting the parent completely. I agree getting them back together and then parsing them out would be better but sure not a clean OO way of getting data. -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 1:01 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question +1. Join the tables in a query and write an algorithm to parse the +results into the view you need. One connection, one query, let the database do the work. Not very OO, but very efficient. robert -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 3:37 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 2:26 PM To: '[EMAIL PROTECTED]' Subject: [OT] Object Design Question People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
collection of strings (newbie question)
I have an action that creates a bean. That bean has a property myStrings that returns a collection of String objects. On a jsp, I want to list the strings. If my jsp has this: logic:iterate id=myId name=myBean property=myStrings bean:write name=myId/ /logic:iterate Then I get an exception Cannot find bean myId in any scope. I can understand that cos myId is a String not a bean. What should I use instead of bean:write ? Steve ___ Yahoo! Messenger - Communicate instantly...Ping your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: collection of strings (newbie question)
Have you import logic taglibs ? steve hazelwood wrote: I have an action that creates a bean. That bean has a property myStrings that returns a collection of String objects. On a jsp, I want to list the strings. If my jsp has this: logic:iterate id=myId name=myBean property=myStrings bean:write name=myId/ /logic:iterate Then I get an exception Cannot find bean myId in any scope. I can understand that cos myId is a String not a bean. What should I use instead of bean:write ? Steve ___ Yahoo! Messenger - Communicate instantly...Ping your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.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: collection of strings (newbie question)
Solved, well done. I'm glad I put 'newbie' in the subject line now :-) Thanks, Steve On 9 Mar 2004 at 11:03, Daniel Henrique Alves Lima wrote: Have you import logic taglibs ? steve hazelwood wrote: I have an action that creates a bean. That bean has a property myStrings that returns a collection of String objects. On a jsp, I want to list the strings. If my jsp has this: logic:iterate id=myId name=myBean property=myStrings bean:write name=myId/ /logic:iterate Then I get an exception Cannot find bean myId in any scope. I can understand that cos myId is a String not a bean. What should I use instead of bean:write ? Steve ___ Yahoo! Messenger - Communicate instantly...Ping your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: collection of strings (newbie question)
Hi all, Other possibility is to check whether 'myBean' exists in some scope. Cheers, Daniel Silva. --- Daniel Henrique Alves Lima [EMAIL PROTECTED] wrote: Have you import logic taglibs ? steve hazelwood wrote: I have an action that creates a bean. That bean has a property myStrings that returns a collection of String objects. On a jsp, I want to list the strings. If my jsp has this: logic:iterate id=myId name=myBean property=myStrings bean:write name=myId/ /logic:iterate Then I get an exception Cannot find bean myId in any scope. I can understand that cos myId is a String not a bean. What should I use instead of bean:write ? Steve ___ Yahoo! Messenger - Communicate instantly...Ping your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.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] __ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:select question
Hi Paul, Your question seems very similar to my post last week. I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: For this you can set the attribute in your form class and when you use html:selectin your jsp, while populating the options in the drop down, struts will automatically select the dafult predetermined option and show it as selected. (See vincent and robert's posts). Let me know if that helps! (I did try the same logic and when i give system.out in my jsp, it is identifying the correct default value-only that I cant see the option selected.let me know if yours works from these hints. That would help me too) :-))) Thanks, Sam. Au-Yeung, Stella H [EMAIL PROTECTED] wrote: I see. I'll try that tomorrow and let you know. Thx. -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 12:05 AM To: Struts Users Mailing List Subject: Re: question the most simplest solution is often the best Au-Yeung, Stella H wrote: Paul wrote: labelProperty=name/ No I don't know how to try yours because I don't see how the above statement tells it to compare userId with person.id and then store the value into person.id. In other words, I don't know how to convert my statement below to yours: collection=uList name=UserFormBean property=userId labelproperty=commonName/ -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: Re: question i think you are trying to do the following... labelProperty=name/ this is assuming uList is a list of beans with id/name fields and your form has a userId field. Au-Yeung, Stella H wrote: Hi: I need to set a pre-defined option in using the value= attribute, I thought the following will work: collection=uList name=UserFormBean property=userId labelproperty=commonName/ I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
html:select question
Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:select question
i think you are trying to do the following... html:select name=UserFormBean property=userId html:options collection=uList property=id labelProperty=name/ /html:select this is assuming uList is a list of beans with id/name fields and your form has a userId field. Au-Yeung, Stella H wrote: Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - 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:select question
Try something like this, bean:define id=uList name=UserFormBean property=userList/ bean;define id=person name=person.id / html:select property=person.id value=%=person% html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select The value attribute is RT-Exp, and not name of a bean. hth -jayash -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:38 PM To: '[EMAIL PROTECTED]' Subject: html:select question Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - 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:select question
I got a compilation errror after I changed to using %= %: Here's my error: cannot resolve symbol probably occurred due to an error in /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 92: html:select property=shopWorkOrder.engineerId value=%=shopWorkOrder.engineerId% My actual segment of JSP: bean:define id=eList name=ShopWorkOrderFormBean property=engineerList/ html:select property=shopWorkOrder.engineerId value=%=shopWorkOrder.engineerId% html:options collection=eList name=ShopWorkOrderFormBean property=userId labelproperty=commonName/ /html:select engineerId is an attribute in the dataBean shopWorkOrder. Can't I reference shopWorkOrder.engineerId inside the %= %? I want to compare value of userId in the collection with shopWorkOrder.engineerId. -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: RE: html:select question Try something like this, bean:define id=uList name=UserFormBean property=userList/ bean;define id=person name=person.id / html:select property=person.id value=%=person% html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select The value attribute is RT-Exp, and not name of a bean. hth -jayash -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:38 PM To: '[EMAIL PROTECTED]' Subject: html:select question Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - 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: html:select question
did you try mine? Au-Yeung, Stella H wrote: I got a compilation errror after I changed to using %= %: Here's my error: cannot resolve symbol probably occurred due to an error in /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 92: html:select property=shopWorkOrder.engineerId value=%=shopWorkOrder.engineerId% My actual segment of JSP: bean:define id=eList name=ShopWorkOrderFormBean property=engineerList/ html:select property=shopWorkOrder.engineerId value=%=shopWorkOrder.engineerId% html:options collection=eList name=ShopWorkOrderFormBean property=userId labelproperty=commonName/ /html:select engineerId is an attribute in the dataBean shopWorkOrder. Can't I reference shopWorkOrder.engineerId inside the %= %? I want to compare value of userId in the collection with shopWorkOrder.engineerId. -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: RE: html:select question Try something like this, bean:define id=uList name=UserFormBean property=userList/ bean;define id=person name=person.id / html:select property=person.id value=%=person% html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select The value attribute is RT-Exp, and not name of a bean. hth -jayash -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:38 PM To: '[EMAIL PROTECTED]' Subject: html:select question Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - 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: html:select question
engineerId is an attribute in the dataBean shopWorkOrder. Can't I reference shopWorkOrder.engineerId inside the %= %? I guess shopWorkOrder is the attribute name of the bean. The %= % should contain a java expression. Use the bean:define to define a JSP variable and use it in %= % bean:define id=engineerId name=shopWorkOrder property=engineerId / then use %=engineerId% in the html:select. -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 4:49 PM To: 'Struts Users Mailing List' Subject: RE: html:select question I got a compilation errror after I changed to using %= %: Here's my error: cannot resolve symbol probably occurred due to an error in /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 92: html:select property=shopWorkOrder.engineerId value=%=shopWorkOrder.engineerId% My actual segment of JSP: bean:define id=eList name=ShopWorkOrderFormBean property=engineerList/ html:select property=shopWorkOrder.engineerId value=%=shopWorkOrder.engineerId% html:options collection=eList name=ShopWorkOrderFormBean property=userId labelproperty=commonName/ /html:select engineerId is an attribute in the dataBean shopWorkOrder. Can't I reference shopWorkOrder.engineerId inside the %= %? I want to compare value of userId in the collection with shopWorkOrder.engineerId. -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: RE: html:select question Try something like this, bean:define id=uList name=UserFormBean property=userList/ bean;define id=person name=person.id / html:select property=person.id value=%=person% html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select The value attribute is RT-Exp, and not name of a bean. hth -jayash -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:38 PM To: '[EMAIL PROTECTED]' Subject: html:select question Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - 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: html:select question
I tried the following and got the same result. Is this what you mean? If I remove the value= then I don't get the compilation error. bean:define id=eList name=ShopWorkOrderFormBean property=engineerList/ bean:define id=engineer name=ShopWorkOrderFormBean property=shopWorkOrder.engineerId/ html:select property=shopWorkOrder.engineerId value=%=engineer% html:options collection=eList name=ShopWorkOrderFormBean property=userId labelproperty=commonName/ /html:select cannot resolve symbol probably occurred due to an error in /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 93: html:select property=shopWorkOrder.engineerId value=%=engineer% symbol : method setValue (java.lang.Object) location: class org.apache.struts.taglib.html.SelectTag _html_select0.setValue(engineer); -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 8:44 PM To: Struts Users Mailing List Subject: RE: html:select question engineerId is an attribute in the dataBean shopWorkOrder. Can't I reference shopWorkOrder.engineerId inside the %= %? I guess shopWorkOrder is the attribute name of the bean. The %= % should contain a java expression. Use the bean:define to define a JSP variable and use it in %= % bean:define id=engineerId name=shopWorkOrder property=engineerId / then use %=engineerId% in the html:select. -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 4:49 PM To: 'Struts Users Mailing List' Subject: RE: html:select question I got a compilation errror after I changed to using %= %: Here's my error: cannot resolve symbol probably occurred due to an error in /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 92: html:select property=shopWorkOrder.engineerId value=%=shopWorkOrder.engineerId% My actual segment of JSP: bean:define id=eList name=ShopWorkOrderFormBean property=engineerList/ html:select property=shopWorkOrder.engineerId value=%=shopWorkOrder.engineerId% html:options collection=eList name=ShopWorkOrderFormBean property=userId labelproperty=commonName/ /html:select engineerId is an attribute in the dataBean shopWorkOrder. Can't I reference shopWorkOrder.engineerId inside the %= %? I want to compare value of userId in the collection with shopWorkOrder.engineerId. -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: RE: html:select question Try something like this, bean:define id=uList name=UserFormBean property=userList/ bean;define id=person name=person.id / html:select property=person.id value=%=person% html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select The value attribute is RT-Exp, and not name of a bean. hth -jayash -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:38 PM To: '[EMAIL PROTECTED]' Subject: html:select question Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:select question
Paul wrote: html:select name=UserFormBean property=userId html:options collection=uList property=id labelProperty=name/ /html:select No I don't know how to try yours because I don't see how the above statement tells it to compare userId with person.id and then store the value into person.id. In other words, I don't know how to convert my statement below to yours: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: Re: html:select question i think you are trying to do the following... html:select name=UserFormBean property=userId html:options collection=uList property=id labelProperty=name/ /html:select this is assuming uList is a list of beans with id/name fields and your form has a userId field. Au-Yeung, Stella H wrote: Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - 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: html:select question
the html:options tag handles this. Au-Yeung, Stella H wrote: Paul wrote: html:select name=UserFormBean property=userId html:options collection=uList property=id labelProperty=name/ /html:select No I don't know how to try yours because I don't see how the above statement tells it to compare userId with person.id and then store the value into person.id. In other words, I don't know how to convert my statement below to yours: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: Re: html:select question i think you are trying to do the following... html:select name=UserFormBean property=userId html:options collection=uList property=id labelProperty=name/ /html:select this is assuming uList is a list of beans with id/name fields and your form has a userId field. Au-Yeung, Stella H wrote: Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - 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: html:select question
the most simplest solution is often the best Au-Yeung, Stella H wrote: Paul wrote: html:select name=UserFormBean property=userId html:options collection=uList property=id labelProperty=name/ /html:select No I don't know how to try yours because I don't see how the above statement tells it to compare userId with person.id and then store the value into person.id. In other words, I don't know how to convert my statement below to yours: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: Re: html:select question i think you are trying to do the following... html:select name=UserFormBean property=userId html:options collection=uList property=id labelProperty=name/ /html:select this is assuming uList is a list of beans with id/name fields and your form has a userId field. Au-Yeung, Stella H wrote: Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - 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: html:select question
I see. I'll try that tomorrow and let you know. Thx. -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 12:05 AM To: Struts Users Mailing List Subject: Re: html:select question the most simplest solution is often the best Au-Yeung, Stella H wrote: Paul wrote: html:select name=UserFormBean property=userId html:options collection=uList property=id labelProperty=name/ /html:select No I don't know how to try yours because I don't see how the above statement tells it to compare userId with person.id and then store the value into person.id. In other words, I don't know how to convert my statement below to yours: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: Re: html:select question i think you are trying to do the following... html:select name=UserFormBean property=userId html:options collection=uList property=id labelProperty=name/ /html:select this is assuming uList is a list of beans with id/name fields and your form has a userId field. Au-Yeung, Stella H wrote: Hi: I need to set a pre-defined option in html:select using the value= attribute, I thought the following will work: bean:define id=uList name=UserFormBean property=userList/ html:select property=person.id value=person.id html:options collection=uList name=UserFormBean property=userId labelproperty=commonName//html:select I have a person bean. I want to set the selected option if person.id matches userId . I thought the value attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the selected option . Am I misunderstanding the use of value=? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question about DTDs ...
A lot of things have to be parsed : web.xml, struts-config.xml and so on so for example, lines like that are already present in our XML files : !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; or !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; I understand the concept of DTD but does it mean that each time a XML file is parsed, a connection to SUN or Jakarta is established in order to retrieve the DTD ? Thank's Alain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about DTDs ...
DOCTYPE syntax uses an optional URI for the DTD, so that a validating XML parser can download an unknown DTD and validate the document. Struts registers local copy of it's configuration DTD to the XML parser (struts, tiles validator). This way they're is no need to have access to the Internet Nico. Alain Van Vyve a écrit : A lot of things have to be parsed : web.xml, struts-config.xml and so on so for example, lines like that are already present in our XML files : !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; or !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; I understand the concept of DTD but does it mean that each time a XML file is parsed, a connection to SUN or Jakarta is established in order to retrieve the DTD ? Thank's Alain - 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]
Newbie question
Hi, I am new to struts. I found a number of simple tutorials (with examples) to understand struts-1.0, but there seems to none for struts-1.1. I have gone through one struts-1.0 tutorial given at jspfinder.com, which is good. Can you please recommend for struts-1.1 (with examples)? Thanks, Satya
Re: Newbie question
From the main page of Struts (the one you clicked past to subscribe to this list) http://jakarta.apache.org/struts/learning.html -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx MSN: [EMAIL PROTECTED] - Original Message - From: Satya Narayan Dash [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 9:31 AM Subject: Newbie question Hi, I am new to struts. I found a number of simple tutorials (with examples) to understand struts-1.0, but there seems to none for struts-1.1. I have gone through one struts-1.0 tutorial given at jspfinder.com, which is good. Can you please recommend for struts-1.1 (with examples)? Thanks, Satya - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionMapping problem: upgrading struts1.0 to struts1.1 question
In the current struts 1.0 application, we do following: String actionNameFind = / + thisForm.getAction(); ActionMapping newMapping = (ActionMapping) getServlet().findMapping(actionNameFind); Does anybody know how I can retrieve ActionMapping in a similar manner in struts 1.1? Thank you so much. Stella. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic flow question (more or less)
Hi, New to Struts, so pretty much just learning by example for now; however I couldn't find a good example for this, hence the question: I have a jsp page that lists certain equipment requests that were fetched from a database by a servlet and are now contained in the request scope as ActionForm beans. I need the user to be able to somehow click on each particular request and either approve or reject it on the next jsp page. How can this be implemented? Hyperlinks? Multiple submit buttons? Checkboxes with a possibility of only one of them to be checked? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic flow question (more or less)
what about radio buttons? - Original Message - From: Max Kovalenkov [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 7:40 PM Subject: logic flow question (more or less) Hi, New to Struts, so pretty much just learning by example for now; however I couldn't find a good example for this, hence the question: I have a jsp page that lists certain equipment requests that were fetched from a database by a servlet and are now contained in the request scope as ActionForm beans. I need the user to be able to somehow click on each particular request and either approve or reject it on the next jsp page. How can this be implemented? Hyperlinks? Multiple submit buttons? Checkboxes with a possibility of only one of them to be checked? 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: ActionMapping problem: upgrading struts1.0 to struts1.1 question
where are you trying to access your actionmapping? - Original Message - From: Averbukh Stella [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 6:13 PM Subject: ActionMapping problem: upgrading struts1.0 to struts1.1 question In the current struts 1.0 application, we do following: String actionNameFind = / + thisForm.getAction(); ActionMapping newMapping = (ActionMapping) getServlet().findMapping(actionNameFind); Does anybody know how I can retrieve ActionMapping in a similar manner in struts 1.1? Thank you so much. Stella. - 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
Hello All, I have a requirement, where on page we have 3 fields named condition1, condition2, and condition3. These three fields are text fields. No problem in doing that. Now the requirement is that if the user wants to add more conditions they can click on the more conditions link and then we are suppose to show next three conditions.. and this process in not finite it can be any number of conditions. How can i handle that ? Any solution. I heard something like indexed property in ActionForm. Can someone please explain what is the best to do in such scineario. Thanks in advance, Vijay.
RE: Question
If you want to get better answers quicker Id suggest you learn the concept of 'meaningful subjects' for emails. Question is not a meaningful subject line. http://www.catb.org/~esr/faqs/smart-questions.html Ok now on to your Question. Having been kind enough to take the time to read it to see if its something I can help with I have found you are in luck. So here is an answer: For 'complex' stuff like this you could make full use nested beans as demonstrated in this tutorial: http://www.keyboardmonkey.com/next/index.jsp In this case as its just one column of text fields you could also get away with just using a collection property in your actionform, and you could back it with a lazy list from commons collections: http://jakarta.apache.org/commons/collections/api/index.html Your view rendering code could iterate through the collection rendering out fields for each: ie renders the html: input name=condition[3] value=foo/ (I think the nested tags can do the indexing for you if your using JSP? not sure. Dont use jsp myself) Your 'add' button or 'conditions link' or whatever would submit and on the server side you try to get the next three items from the lazylist causing them to be instatntiated by the factory you specify. On return to the view the extra fields are rendered ready for input. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 4 March 2004 06:03 To: [EMAIL PROTECTED] Subject: Question Hello All, I have a requirement, where on page we have 3 fields named condition1, condition2, and condition3. These three fields are text fields. No problem in doing that. Now the requirement is that if the user wants to add more conditions they can click on the more conditions link and then we are suppose to show next three conditions.. and this process in not finite it can be any number of conditions. How can i handle that ? Any solution. I heard something like indexed property in ActionForm. Can someone please explain what is the best to do in such scineario. Thanks in advance, Vijay. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Another struts question on bean:write
If I use bean:write to display a bean property comments which happens to be a long line of text. Is there a way to enforce wrapping with bean:write so the long comments can be displayed as a paragraph? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts question on bean:write
The resulting html text will wrap inside of the element tags that you have placed it into unless you explicitly tell it not to with something like p nowrapcomments here/p Or with css p style=white-space: nowrap;comments here/p So in other words you should not have to do anything. If you want to keep the text width a certain size you can also inline style with p style=width: 200px;comments here/p HTH -- Tim Coy If I use bean:write to display a bean property comments which happens to be a long line of text. Is there a way to enforce wrapping with bean:write so the long comments can be displayed as a paragraph? 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]
Question about File downlods and letting users save a downloaded file. I am losing the original file name.
My Problem is with the URL presented when i get prompted to save a file. I am retreiving files/resources from a database and want to let the users browse them at will. The code below works except when i get prompted to Save or Open the file. The name of the file is the name of my Action Mapping. in this case Attachments.do How can i place the file name i saved in the database in the browser. The Action below it an example from the mailing list. public final class AttachmentsAction extends eCABaseAction { /** * @param mapping The ActionMapping used to select this instance * @param actionForm The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * @exception IOException if an input/output error occurs * @exception ServletException if a servlet exception occurs * @exception SessionTimeoutException if the session times out, user must relog */ public ActionForward execute (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception, IOException, ServletException, SessionTimeoutException { Log log = LogFactory.getLog(AttachmentsAction.class); log.debug(At Template); checkSession(request); securityAccess cmap=(securityAccess)mapping; cmap.validateAccess(request); int id = 0; try { id = Integer.parseInt(request.getParameter(id)); } catch (NumberFormatException ex) { throw new NoValidWebData(error.NoWebData.issueNumber.Missing); } IeCAService serviceImpl = this.geteCAService(); Attachment attch = serviceImpl.getAttachment(new Integer(id)); response.setContentType(attch.getContentType()); response.setContentLength(attch.getAttachment().length); ServletOutputStream ostream = response.getOutputStream(); ostream.write(attch.getAttachment()); ostream.flush(); return new ActionForward(null); } actionpath=/AttachmentGet type=com.myplace.AttachmentsAction name=AttachmentGet scope=request validate=false set-property property=accessLevel value=ASU / /action - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question about File downlods and letting users save a downloaded file. I am losing the original file name.
Answered My own Question. Thank you Jacob -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2003 9:04 AM To: Struts Users Mailing List Subject: [OT] RE: File Download? This is what we use for file downloads (Excel/PDF files). String contentType = this.beanWriter.getContentType(); response.setContentType(contentType); response.setHeader(Content-Disposition,attachment;filename=\ + this.beanWriter.getFileName(request) + \); And have your struts action return null. -Jacob -Original Message- From: Stephan Jones [mailto:[EMAIL PROTECTED] Sent: March 1, 2004 1:42 AM To: [EMAIL PROTECTED] Subject: Question about File downlods and letting users save a downloaded file. I am losing the original file name. My Problem is with the URL presented when i get prompted to save a file. I am retreiving files/resources from a database and want to let the users browse them at will. The code below works except when i get prompted to Save or Open the file. The name of the file is the name of my Action Mapping. in this case Attachments.do How can i place the file name i saved in the database in the browser. The Action below it an example from the mailing list. public final class AttachmentsAction extends eCABaseAction { /** * @param mapping The ActionMapping used to select this instance * @param actionForm The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * @exception IOException if an input/output error occurs * @exception ServletException if a servlet exception occurs * @exception SessionTimeoutException if the session times out, user must relog */ public ActionForward execute (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception, IOException, ServletException, SessionTimeoutException { Log log = LogFactory.getLog(AttachmentsAction.class); log.debug(At Template); checkSession(request); securityAccess cmap=(securityAccess)mapping; cmap.validateAccess(request); int id = 0; try { id = Integer.parseInt(request.getParameter(id)); } catch (NumberFormatException ex) { throw new NoValidWebData(error.NoWebData.issueNumber.Missing); } IeCAService serviceImpl = this.geteCAService(); Attachment attch = serviceImpl.getAttachment(new Integer(id)); response.setContentType(attch.getContentType()); response.setContentLength(attch.getAttachment().length); ServletOutputStream ostream = response.getOutputStream(); ostream.write(attch.getAttachment()); ostream.flush(); return new ActionForward(null); } actionpath=/AttachmentGet type=com.myplace.AttachmentsAction name=AttachmentGet scope=request validate=false set-property property=accessLevel value=ASU / /action - 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: FormBeans: A question of Style
On Thu, 2004-02-26 at 23:01, Pradeep, PK wrote: I think whatever you do you can't make JSP and Action Class independent. Where are you populating ActionForm Object from the results from service layer? In Action class only right? Which you know very well for which JSP page it will be applicable. True, but having one well-defined interface between the two (an ActionForm) is preferable to having a handful of poorly-defined interfaces between them (an ActionForm + stuffing a bunch of stuff into the request). Also is it easy to populate all what you need in ActionForm? How one can populate resultset in action form which will automatically get populated in html table.. Yes, call myActionForm.setResults(results) instead of request.setAttribute(results, results). This may seem like a minor point (and it is admittedly a simple example), but maintaining complex pages with a lot of structured data behind them gets difficult when you have to pull a bunch of stuff out of the request with no structure defined between the items you are pulling. Using the ActionForm as the root of your data structure is a simple rule to follow that 'scales up' (with data structure complexity) much better than request-stuffing. -Max - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FormBeans: A question of Style
This is just wrong. This is done everyday. They are not in the least dependent. At 11:01 PM 2/26/2004, you wrote: I think whatever you do you can't make JSP and Action Class independent. Where are you populating ActionForm Object from the results from service layer? In Action class only right? Which you know very well for which JSP page it will be applicable. Also is it easy to populate all what you need in ActionForm? How one can populate resultset in action form which will automatically get populated in html table.. -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:41 AM To: Struts Users Mailing List Subject: Re: FormBeans: A question of Style I consider the ActionForms to be part of the view primarily. They should both collect submitted data and provide the JSP (or other view components) with most or all the data they need to render the page (camp 2). I say 'most' only because sometimes custom tags can be useful for getting data for list boxes, etc. All the data that the Action collects, however, should be carried to the JSP in the ActionForm. The alternatives for carrying data from Actions to JSPs for the camp 1 gang are not attractive, in my opinion. Having an Action put a bunch of stuff into the request or session scope creates a lot of coupling between the Action and JSP. The Action must know where to put it and the JSP must know where to find it with that scenario. I prefer to keep the Actions and JSPs loosely coupled by having them both depend on the ActionForm, rather than depending on each other. The Action populates the ActionForm, and the JSP renders it. For complex pages, the ActionForm can be the root of an object graph that contains all the data you need to render the page. Stashing additional info all over the session and request is sloppy by comparison, in my opinion. I think the ActionForm is the root of all view data approach promotes more concentrated thought about the structure of the data, which is a good thing. It provides a more concrete interface between the controller (Action) and view (JSP) components. Maintaining JSPs that get their data from one place is much easier than maintaining JSPs that have to collect, organize, and display data from multiple sources. JSPs that pull data from the ActionForm, stuff stashed in the session, and/or stuff stashed in the request are harder to maintain. Where do I find it? How does it all relate? Yuk! -Max On Thu, 2004-02-26 at 17:57, [EMAIL PROTECTED] wrote: We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - 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: FormBeans: A question of Style
Agreed. Consider these scenarios: A single form used with multiple actions (think view/edit/new) A tile that conforms to some interface implemented by multiple forms, that is used on different pages An action that manipulates data and forwards to multiple views (WML vs XML vs HTML, or maybe Table vs Graph) Independence is very important for reusability and maintainability. -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 4:53 PM To: Struts Users Mailing List Subject: RE: FormBeans: A question of Style This is just wrong. This is done everyday. They are not in the least dependent. At 11:01 PM 2/26/2004, you wrote: I think whatever you do you can't make JSP and Action Class independent. Where are you populating ActionForm Object from the results from service layer? In Action class only right? Which you know very well for which JSP page it will be applicable. Also is it easy to populate all what you need in ActionForm? How one can populate resultset in action form which will automatically get populated in html table.. -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:41 AM To: Struts Users Mailing List Subject: Re: FormBeans: A question of Style I consider the ActionForms to be part of the view primarily. They should both collect submitted data and provide the JSP (or other view components) with most or all the data they need to render the page (camp 2). I say 'most' only because sometimes custom tags can be useful for getting data for list boxes, etc. All the data that the Action collects, however, should be carried to the JSP in the ActionForm. The alternatives for carrying data from Actions to JSPs for the camp 1 gang are not attractive, in my opinion. Having an Action put a bunch of stuff into the request or session scope creates a lot of coupling between the Action and JSP. The Action must know where to put it and the JSP must know where to find it with that scenario. I prefer to keep the Actions and JSPs loosely coupled by having them both depend on the ActionForm, rather than depending on each other. The Action populates the ActionForm, and the JSP renders it. For complex pages, the ActionForm can be the root of an object graph that contains all the data you need to render the page. Stashing additional info all over the session and request is sloppy by comparison, in my opinion. I think the ActionForm is the root of all view data approach promotes more concentrated thought about the structure of the data, which is a good thing. It provides a more concrete interface between the controller (Action) and view (JSP) components. Maintaining JSPs that get their data from one place is much easier than maintaining JSPs that have to collect, organize, and display data from multiple sources. JSPs that pull data from the ActionForm, stuff stashed in the session, and/or stuff stashed in the request are harder to maintain. Where do I find it? How does it all relate? Yuk! -Max On Thu, 2004-02-26 at 17:57, [EMAIL PROTECTED] wrote: We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Xhtml tag usage question
I tried to insert the xhtml tag in my pages, but the only way I found is to insert it in each tile that composes my page. It seems it is not sufficient to put it in the template file, or in the page using the template. Is there a better approach ? Any help is appreciated Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Xhtml tag usage question
Unfortunately it saves the xhtml 'flag' in page scope so there isn't much you can do about it. Background: BaseHandlerTag has an isXhtml() method which calls the TagUtils.isXhtml() method which checks the xhtml 'flag' in page scope. I did think a solution would be to override the TagUtils.isXhtml() method to either always return 'true' or check a flag in request scope (which you would have to set some way) - but unfortunately the instance variable for TagUtils is both private and final - so theres no way to extend and implement your own custom TagUtils version in 'vanilla' struts. If you build your own version of struts, you could change TagUtils itself, so maybe thats an option for you - but then every time you take a new struts version you have to re-implement your change. Another alternative is to extend the struts tags to create 'xhtml' versions - all you would have to do is override the isXhtml() method there. For example public class XhtmlTextTag extends TextTag public XhtmlTextTag () { super(); } protected boolean isXhtml() { return true; } } So I think you have a few options: - put the html:xhtml tag in every jsp - build your own version of struts and change TagUtils - extend the struts tags to create xhtml versions Personally, I would go with html:xhtml for now and try to get struts changed so that either the scope of the xhtml flag can be customized or TagUtils can be extended and overriden. Niall - Original Message - From: Renato Romano [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 8:49 AM Subject: Xhtml tag usage question I tried to insert the xhtml tag in my pages, but the only way I found is to insert it in each tile that composes my page. It seems it is not sufficient to put it in the template file, or in the page using the template. Is there a better approach ? Any help is appreciated Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - 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: FormBeans: A question of Style
I consider the ActionForms to be part of the view primarily. They should both collect submitted data and provide the JSP (or other view components) with most or all the data they need to render the page (camp 2). I say 'most' only because sometimes custom tags can be useful for getting data for list boxes, etc. All the data that the Action collects, however, should be carried to the JSP in the ActionForm. The alternatives for carrying data from Actions to JSPs for the camp 1 gang are not attractive, in my opinion. Having an Action put a bunch of stuff into the request or session scope creates a lot of coupling between the Action and JSP. The Action must know where to put it and the JSP must know where to find it with that scenario. I prefer to keep the Actions and JSPs loosely coupled by having them both depend on the ActionForm, rather than depending on each other. The Action populates the ActionForm, and the JSP renders it. For complex pages, the ActionForm can be the root of an object graph that contains all the data you need to render the page. Stashing additional info all over the session and request is sloppy by comparison, in my opinion. I think the ActionForm is the root of all view data approach promotes more concentrated thought about the structure of the data, which is a good thing. It provides a more concrete interface between the controller (Action) and view (JSP) components. Maintaining JSPs that get their data from one place is much easier than maintaining JSPs that have to collect, organize, and display data from multiple sources. JSPs that pull data from the ActionForm, stuff stashed in the session, and/or stuff stashed in the request are harder to maintain. Where do I find it? How does it all relate? Yuk! -Max On Thu, 2004-02-26 at 17:57, [EMAIL PROTECTED] wrote: We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - 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]
custom validator question
I'm creating a custom validator to enforce a = relationship between 2 date fields and am having a problem. A validator method gets a Field arg for the field with which it's associated in validation.xml, but I need to also get the Field object for the other date field. I need this so that I can get its property name for display in an error message. (I'd also like to be able to get the field's datePattern.) I can't figure out how to do this. Any help would be much appreciated! jim Here's the relevant part of my validation.xml file: form name=ActivityViewForm field property=starting depends=date arg0 key=ActivityViewForm.starting.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var /field field property=ending depends=date,date1LEdate2 arg0 key=ActivityViewForm.ending.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var var var-namedate1/var-name var-valuestarting/var-value /var /field /form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: custom validator question
I guess I wasn't clear (also, I was a bit confused :) My validator is already working, and what you suggest below will get me the property name I need for display in an error msg. But how can I get the datePattern from mySecondDate? At the moment I'm assuming it'll be the same as for myFirstDate, but that's just an assumption... -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 10:18 AM To: Struts Users Mailing List Subject: Re: custom validator question Specify the second field as var field property=myFirstDate depends=date,dateCompare var var-namedatePattern/var-name var-valuedd/MM//var-value /var var var-namecompareDate/var-name var-valuemySecondDate/var-value /var /field Then in your custom validation method: String datePattern = field.getVarValue(datePattern); String compareDateProperty = field.getVarValue(compareDate); String compareDate = ValidatorUtils.getValueAsString(bean, compareDateProperty); Niall - Original Message - From: Anderson, James H [IT] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:54 PM Subject: custom validator question I'm creating a custom validator to enforce a = relationship between 2 date fields and am having a problem. A validator method gets a Field arg for the field with which it's associated in validation.xml, but I need to also get the Field object for the other date field. I need this so that I can get its property name for display in an error message. (I'd also like to be able to get the field's datePattern.) I can't figure out how to do this. Any help would be much appreciated! jim Here's the relevant part of my validation.xml file: form name=ActivityViewForm field property=starting depends=date arg0 key=ActivityViewForm.starting.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var /field field property=ending depends=date,date1LEdate2 arg0 key=ActivityViewForm.ending.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var var var-namedate1/var-name var-valuestarting/var-value /var /field /form - 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: custom validator question
I wasn't aware of it--I'm using Struts 1.1. I'll check it out. Thanks. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 10:20 AM To: Struts User Jakarta Subject: Re: custom validator question Also, what about using the existing ValidWhen validation http://jakarta.apache.org/struts/userGuide/dev_validator.html Niall - Original Message - From: Niall Pemberton [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 3:17 PM Subject: Re: custom validator question Specify the second field as var field property=myFirstDate depends=date,dateCompare var var-namedatePattern/var-name var-valuedd/MM//var-value /var var var-namecompareDate/var-name var-valuemySecondDate/var-value /var /field Then in your custom validation method: String datePattern = field.getVarValue(datePattern); String compareDateProperty = field.getVarValue(compareDate); String compareDate = ValidatorUtils.getValueAsString(bean, compareDateProperty); Niall - Original Message - From: Anderson, James H [IT] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:54 PM Subject: custom validator question I'm creating a custom validator to enforce a = relationship between 2 date fields and am having a problem. A validator method gets a Field arg for the field with which it's associated in validation.xml, but I need to also get the Field object for the other date field. I need this so that I can get its property name for display in an error message. (I'd also like to be able to get the field's datePattern.) I can't figure out how to do this. Any help would be much appreciated! jim Here's the relevant part of my validation.xml file: form name=ActivityViewForm field property=starting depends=date arg0 key=ActivityViewForm.starting.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var /field field property=ending depends=date,date1LEdate2 arg0 key=ActivityViewForm.ending.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var var var-namedate1/var-name var-valuestarting/var-value /var /field /form - 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]
Struts menu Question
I know, this list is not struts-menu list, but .. at the struts menu example (permissions menu) at SetPermissionsAction.java there is this line: String[] menus = request.getParameterValues(menus); I'd like to know just where they put the menus attribute in a session ?? thanks Daniel S.
FormBeans: A question of Style
We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FormBeans: A question of Style
Dam - I was in Camp 3: Form beans are View components...but looking in the user guide... Note: While ActionForm beans often have properties that correspond to properties in your Model beans, the form beans themselves should be considered a Controller component. As such, they are able to transfer data between the Model and View layers. Niall - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 27, 2004 1:57 AM Subject: FormBeans: A question of Style We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - 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: FormBeans: A question of Style
Im with camp 3 then I guess. Way I see it , forms are view components, there to provide an object for both action and JSP to be able to access the state of the screen. (Fields values and other bits of information that are needed to recreate the html, and a place to hold the state of the view (ie: submitted field values) on the server side for the controller (action) to read from) Maybe we should raise an issue in bugzilla against the userguide? Forms have no business transfering stuff from view to model. The model should never have to see an actionForm and should be blissfuly unaware of their very existence. Thats the job of an action to do, taking data from the form, and providing it to the model and vice versa (preferably with some kind of helper classes and perhaps also non-form DTOs involved) -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 12:12 To: Struts Users Mailing List Subject: Re: FormBeans: A question of Style Dam - I was in Camp 3: Form beans are View components...but looking in the user guide... Note: While ActionForm beans often have properties that correspond to properties in your Model beans, the form beans themselves should be considered a Controller component. As such, they are able to transfer data between the Model and View layers. Niall - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 27, 2004 1:57 AM Subject: FormBeans: A question of Style We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - 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: FormBeans: A question of Style
I agree Camp 3. All the text I have read on MVC advise that the business logic should be performed by calling service modules out of the action class. On Fri, 27 Feb 2004, Andrew Hill wrote: Im with camp 3 then I guess. Way I see it , forms are view components, there to provide an object for both action and JSP to be able to access the state of the screen. (Fields values and other bits of information that are needed to recreate the html, and a place to hold the state of the view (ie: submitted field values) on the server side for the controller (action) to read from) Maybe we should raise an issue in bugzilla against the userguide? Forms have no business transfering stuff from view to model. The model should never have to see an actionForm and should be blissfuly unaware of their very existence. Thats the job of an action to do, taking data from the form, and providing it to the model and vice versa (preferably with some kind of helper classes and perhaps also non-form DTOs involved) -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 12:12 To: Struts Users Mailing List Subject: Re: FormBeans: A question of Style Dam - I was in Camp 3: Form beans are View components...but looking in the user guide... Note: While ActionForm beans often have properties that correspond to properties in your Model beans, the form beans themselves should be considered a Controller component. As such, they are able to transfer data between the Model and View layers. Niall - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 27, 2004 1:57 AM Subject: FormBeans: A question of Style We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - 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: custom validator question
I had a custom validator 'futureDate' for which I needed to pass in a date and time which were 2 different form fields, to check that the date was in the future. I passed 2 different values into a custom parameter using two args and vars: form name=form field property=emailDate depends=required, mask, futureDate msg name=mask key=errors.invalid/ arg0 key=form.emailDate/ arg1 key=form.emailTime/ var var-namemask/var-name var-value${dateMask}/var-value /var var var-nametime/var-name var-valueemailTime/var-value /var /field /form In the custom validator I retrieved the two values using: public static boolean validateDate(Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { String value; if (isString(bean)) { value = (String) bean; } else { value = ValidatorUtil.getValueAsString(bean, field.getProperty()); } String propertyTime = field.getVarValue(time); String valueTime = ValidatorUtil.getValueAsString(bean, propertyTime); . . . . . Hope this helps Claire -Original Message- From: Anderson, James H [IT] [mailto:[EMAIL PROTECTED] Sent: 26 February 2004 14:54 To: [EMAIL PROTECTED] Subject: custom validator question I'm creating a custom validator to enforce a = relationship between 2 date fields and am having a problem. A validator method gets a Field arg for the field with which it's associated in validation.xml, but I need to also get the Field object for the other date field. I need this so that I can get its property name for display in an error message. (I'd also like to be able to get the field's datePattern.) I can't figure out how to do this. Any help would be much appreciated! jim Here's the relevant part of my validation.xml file: form name=ActivityViewForm field property=starting depends=date arg0 key=ActivityViewForm.starting.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var /field field property=ending depends=date,date1LEdate2 arg0 key=ActivityViewForm.ending.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var var var-namedate1/var-name var-valuestarting/var-value /var /field /form E-mail is an informal method of communication and may be subject to data corruption, interception and unauthorised amendment for which Digital Bridges Ltd will accept no liability. Therefore, it will normally be inappropriate to rely on information contained on e-mail without obtaining written confirmation. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: custom validator question
Also, what about using the existing ValidWhen validation http://jakarta.apache.org/struts/userGuide/dev_validator.html Niall - Original Message - From: Niall Pemberton [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 3:17 PM Subject: Re: custom validator question Specify the second field as var field property=myFirstDate depends=date,dateCompare var var-namedatePattern/var-name var-valuedd/MM//var-value /var var var-namecompareDate/var-name var-valuemySecondDate/var-value /var /field Then in your custom validation method: String datePattern = field.getVarValue(datePattern); String compareDateProperty = field.getVarValue(compareDate); String compareDate = ValidatorUtils.getValueAsString(bean, compareDateProperty); Niall - Original Message - From: Anderson, James H [IT] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:54 PM Subject: custom validator question I'm creating a custom validator to enforce a = relationship between 2 date fields and am having a problem. A validator method gets a Field arg for the field with which it's associated in validation.xml, but I need to also get the Field object for the other date field. I need this so that I can get its property name for display in an error message. (I'd also like to be able to get the field's datePattern.) I can't figure out how to do this. Any help would be much appreciated! jim Here's the relevant part of my validation.xml file: form name=ActivityViewForm field property=starting depends=date arg0 key=ActivityViewForm.starting.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var /field field property=ending depends=date,date1LEdate2 arg0 key=ActivityViewForm.ending.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var var var-namedate1/var-name var-valuestarting/var-value /var /field /form - 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: custom validator question
Specify the second field as var field property=myFirstDate depends=date,dateCompare var var-namedatePattern/var-name var-valuedd/MM//var-value /var var var-namecompareDate/var-name var-valuemySecondDate/var-value /var /field Then in your custom validation method: String datePattern = field.getVarValue(datePattern); String compareDateProperty = field.getVarValue(compareDate); String compareDate = ValidatorUtils.getValueAsString(bean, compareDateProperty); Niall - Original Message - From: Anderson, James H [IT] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:54 PM Subject: custom validator question I'm creating a custom validator to enforce a = relationship between 2 date fields and am having a problem. A validator method gets a Field arg for the field with which it's associated in validation.xml, but I need to also get the Field object for the other date field. I need this so that I can get its property name for display in an error message. (I'd also like to be able to get the field's datePattern.) I can't figure out how to do this. Any help would be much appreciated! jim Here's the relevant part of my validation.xml file: form name=ActivityViewForm field property=starting depends=date arg0 key=ActivityViewForm.starting.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var /field field property=ending depends=date,date1LEdate2 arg0 key=ActivityViewForm.ending.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var var var-namedate1/var-name var-valuestarting/var-value /var /field /form - 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: Xhtml tag usage question
Thank you very much for your detailed explanation!!! Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: giovedì 26 febbraio 2004 12.36 To: Struts Users Mailing List Subject: Re: Xhtml tag usage question Unfortunately it saves the xhtml 'flag' in page scope so there isn't much you can do about it. Background: BaseHandlerTag has an isXhtml() method which calls the TagUtils.isXhtml() method which checks the xhtml 'flag' in page scope. I did think a solution would be to override the TagUtils.isXhtml() method to either always return 'true' or check a flag in request scope (which you would have to set some way) - but unfortunately the instance variable for TagUtils is both private and final - so theres no way to extend and implement your own custom TagUtils version in 'vanilla' struts. If you build your own version of struts, you could change TagUtils itself, so maybe thats an option for you - but then every time you take a new struts version you have to re-implement your change. Another alternative is to extend the struts tags to create 'xhtml' versions - all you would have to do is override the isXhtml() method there. For example public class XhtmlTextTag extends TextTag public XhtmlTextTag () { super(); } protected boolean isXhtml() { return true; } } So I think you have a few options: - put the html:xhtml tag in every jsp - build your own version of struts and change TagUtils - extend the struts tags to create xhtml versions Personally, I would go with html:xhtml for now and try to get struts changed so that either the scope of the xhtml flag can be customized or TagUtils can be extended and overriden. Niall - Original Message - From: Renato Romano [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 8:49 AM Subject: Xhtml tag usage question I tried to insert the xhtml tag in my pages, but the only way I found is to insert it in each tile that composes my page. It seems it is not sufficient to put it in the template file, or in the page using the template. Is there a better approach ? Any help is appreciated Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - 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: FormBeans: A question of Style
I think whatever you do you can't make JSP and Action Class independent. Where are you populating ActionForm Object from the results from service layer? In Action class only right? Which you know very well for which JSP page it will be applicable. Also is it easy to populate all what you need in ActionForm? How one can populate resultset in action form which will automatically get populated in html table.. -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:41 AM To: Struts Users Mailing List Subject: Re: FormBeans: A question of Style I consider the ActionForms to be part of the view primarily. They should both collect submitted data and provide the JSP (or other view components) with most or all the data they need to render the page (camp 2). I say 'most' only because sometimes custom tags can be useful for getting data for list boxes, etc. All the data that the Action collects, however, should be carried to the JSP in the ActionForm. The alternatives for carrying data from Actions to JSPs for the camp 1 gang are not attractive, in my opinion. Having an Action put a bunch of stuff into the request or session scope creates a lot of coupling between the Action and JSP. The Action must know where to put it and the JSP must know where to find it with that scenario. I prefer to keep the Actions and JSPs loosely coupled by having them both depend on the ActionForm, rather than depending on each other. The Action populates the ActionForm, and the JSP renders it. For complex pages, the ActionForm can be the root of an object graph that contains all the data you need to render the page. Stashing additional info all over the session and request is sloppy by comparison, in my opinion. I think the ActionForm is the root of all view data approach promotes more concentrated thought about the structure of the data, which is a good thing. It provides a more concrete interface between the controller (Action) and view (JSP) components. Maintaining JSPs that get their data from one place is much easier than maintaining JSPs that have to collect, organize, and display data from multiple sources. JSPs that pull data from the ActionForm, stuff stashed in the session, and/or stuff stashed in the request are harder to maintain. Where do I find it? How does it all relate? Yuk! -Max On Thu, 2004-02-26 at 17:57, [EMAIL PROTECTED] wrote: We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - 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: FormBeans: A question of Style
snip I think whatever you do you can't make JSP and Action Class independent. Where are you populating ActionForm Object from the results from service layer? In Action class only right? Which you know very well for which JSP page it will be applicable. /snip True snip How one can populate resultset in action form which will automatically get populated in html table.. /snip Shouldnt be passing a resultset to the JSP. Better to extract the info you need from it so you can free up the connection before forwarding to the JSP. Take a look at: http://jakarta.apache.org/commons/beanutils/api/ -Original Message- From: Pradeep, PK [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 15:02 To: Struts Users Mailing List Subject: RE: FormBeans: A question of Style I think whatever you do you can't make JSP and Action Class independent. Where are you populating ActionForm Object from the results from service layer? In Action class only right? Which you know very well for which JSP page it will be applicable. Also is it easy to populate all what you need in ActionForm? How one can populate resultset in action form which will automatically get populated in html table.. -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:41 AM To: Struts Users Mailing List Subject: Re: FormBeans: A question of Style I consider the ActionForms to be part of the view primarily. They should both collect submitted data and provide the JSP (or other view components) with most or all the data they need to render the page (camp 2). I say 'most' only because sometimes custom tags can be useful for getting data for list boxes, etc. All the data that the Action collects, however, should be carried to the JSP in the ActionForm. The alternatives for carrying data from Actions to JSPs for the camp 1 gang are not attractive, in my opinion. Having an Action put a bunch of stuff into the request or session scope creates a lot of coupling between the Action and JSP. The Action must know where to put it and the JSP must know where to find it with that scenario. I prefer to keep the Actions and JSPs loosely coupled by having them both depend on the ActionForm, rather than depending on each other. The Action populates the ActionForm, and the JSP renders it. For complex pages, the ActionForm can be the root of an object graph that contains all the data you need to render the page. Stashing additional info all over the session and request is sloppy by comparison, in my opinion. I think the ActionForm is the root of all view data approach promotes more concentrated thought about the structure of the data, which is a good thing. It provides a more concrete interface between the controller (Action) and view (JSP) components. Maintaining JSPs that get their data from one place is much easier than maintaining JSPs that have to collect, organize, and display data from multiple sources. JSPs that pull data from the ActionForm, stuff stashed in the session, and/or stuff stashed in the request are harder to maintain. Where do I find it? How does it all relate? Yuk! -Max On Thu, 2004-02-26 at 17:57, [EMAIL PROTECTED] wrote: We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - 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]
Simple ActionError question
Hi all, just a newbie question. I have a PlaceOrderAction and I want to display as an ActionError the items that were out of stock. I would like to be able to pass a String to my ActionError. Is there a way to do this may using Format? Could somebody provide an example? Suppose I have a string outOfStock = ULLItitle1/LI/UL I want to have an effect equivelant to new ActionError(outofstock)); new ActionError(outOfStock)); if I had new ActionError(error.outofstock)); and in my resources error.outofstock = {0} How would I pass my string value? Thank you for your time, Theo
Re: Simple ActionError question
You ActionError constructor takes additional parameters. Here's a sample from some code that passes two parameters to a message I'm working on. In my example, if the user tries to insert a group with the same name as one in the DB, an error is thrown and html:errors is used to display the errors to the user In the resources.properties file there is the following entry errors.unique={0} has already been used as a {1} There are two parameters I'm passing to the resource. Since there are many places in the code where I could get a unique constraint violation, I pass the field name along with the field name value to prompt the user. The code follows... try { dao.insertSomething(groupName) } catch(SQLException exc) { servlet.log([InsertSomething] - WARNING: error inserting + groupName + msg: + exc.getMessage()); if( exc.getErrorCode() == 1 ) { // constraint violation ActionErrors errors = new ActionErrors(); ActionError error = new ActionError( errors.unique, groupName, Group Name ); errors.add( ActionErrors.GLOBAL_ERROR, error ); _request.setAttribute( Globals.ERROR_KEY, errors ); fwd = new ActionForward( _mapping.getInput() ); } } Theodosios Paschalidis wrote: Hi all, just a newbie question. I have a PlaceOrderAction and I want to display as an ActionError the items that were out of stock. I would like to be able to pass a String to my ActionError. Is there a way to do this may using Format? Could somebody provide an example? Suppose I have a string outOfStock = ULLItitle1/LI/UL I want to have an effect equivelant to new ActionError(outofstock)); new ActionError(outOfStock)); if I had new ActionError(error.outofstock)); and in my resources error.outofstock = {0} How would I pass my string value? Thank you for your time, Theo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple ActionError question
Thanks a lot mate, that did the trick! - Original Message - From: Carl Walker [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 4:01 PM Subject: Re: Simple ActionError question You ActionError constructor takes additional parameters. Here's a sample from some code that passes two parameters to a message I'm working on. In my example, if the user tries to insert a group with the same name as one in the DB, an error is thrown and html:errors is used to display the errors to the user In the resources.properties file there is the following entry errors.unique={0} has already been used as a {1} There are two parameters I'm passing to the resource. Since there are many places in the code where I could get a unique constraint violation, I pass the field name along with the field name value to prompt the user. The code follows... try { dao.insertSomething(groupName) } catch(SQLException exc) { servlet.log([InsertSomething] - WARNING: error inserting + groupName + msg: + exc.getMessage()); if( exc.getErrorCode() == 1 ) { // constraint violation ActionErrors errors = new ActionErrors(); ActionError error = new ActionError( errors.unique, groupName, Group Name ); errors.add( ActionErrors.GLOBAL_ERROR, error ); _request.setAttribute( Globals.ERROR_KEY, errors ); fwd = new ActionForward( _mapping.getInput() ); } } Theodosios Paschalidis wrote: Hi all, just a newbie question. I have a PlaceOrderAction and I want to display as an ActionError the items that were out of stock. I would like to be able to pass a String to my ActionError. Is there a way to do this may using Format? Could somebody provide an example? Suppose I have a string outOfStock = ULLItitle1/LI/UL I want to have an effect equivelant to new ActionError(outofstock)); new ActionError(outOfStock)); if I had new ActionError(error.outofstock)); and in my resources error.outofstock = {0} How would I pass my string value? Thank you for your time, Theo - 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]
A question on Struts taglib.
A question on Struts taglib. Can someone tell me how to reference the index of each element so I can pass it as a parameter with the a href path string? For example I have the following code, I want to print out 'partNumber' and 'partDescription' and a a href' with index of each element'. logic:iterate id=parts collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePart.exec?index=How to reference the index here img src=images/iconEdit.gif/anbsp; /td/tr /logic:iterate Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A question on Struts taglib.
You can use the indexId attribute of logic:iterate tag... http://jakarta.apache.org/struts/doc-1.0.2/struts-logic.html#iterate HTH, Shyam --- Au-Yeung, Stella H [EMAIL PROTECTED] wrote: A question on Struts taglib. Can someone tell me how to reference the index of each element so I can pass it as a parameter with the a href path string? For example I have the following code, I want to print out 'partNumber' and 'partDescription' and a a href' with index of each element'. logic:iterate id=parts collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePart.exec?index=How to reference the index here img src=images/iconEdit.gif/anbsp; /td/tr /logic:iterate Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: A question on Struts taglib.
add index attribute in your logic iterate and append that index to your host string. e.g logic:iterate id=xyzID name=xyzForm property=xyz indexId=index yourhoststring+%=indexId % /logic:iterate -R -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:18 PM To: [EMAIL PROTECTED] Subject: A question on Struts taglib. A question on Struts taglib. Can someone tell me how to reference the index of each element so I can pass it as a parameter with the a href path string? For example I have the following code, I want to print out 'partNumber' and 'partDescription' and a a href' with index of each element'. logic:iterate id=parts collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePart.exec?index=How to reference the index here img src=images/iconEdit.gif/anbsp; /td/tr /logic:iterate Thanks in advance! Stella - 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: A question on Struts taglib.
I changed my code to use indexId and got the following error: symbol : variable indexId location: class jsp_servlet._app._fdd._shopworkorder.__createshopworkorder out.print(weblogic.utils.StringUtils.valueOf(indexId )); //[ /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp; Line: 136] Here's the changed code: logic:iterate id=parts indexId=index collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=updatepartInd ex=%=indexId% img src=images/icoEdit.gif/anbsp; /td /tr /logic:iterate Any Idea? What did I do wrong? -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:45 PM To: Struts Users Mailing List Subject: RE: A question on Struts taglib. add index attribute in your logic iterate and append that index to your host string. e.g logic:iterate id=xyzID name=xyzForm property=xyz indexId=index yourhoststring+%=indexId % /logic:iterate -R -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:18 PM To: [EMAIL PROTECTED] Subject: A question on Struts taglib. A question on Struts taglib. Can someone tell me how to reference the index of each element so I can pass it as a parameter with the a href path string? For example I have the following code, I want to print out 'partNumber' and 'partDescription' and a a href' with index of each element'. logic:iterate id=parts collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePart.exec?index=How to reference the index here img src=images/iconEdit.gif/anbsp; /td/tr /logic:iterate Thanks in advance! Stella - 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: A question on Struts taglib.
Try this: logic:iterate id=parts indexId=index collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=updatepartInd ex=%=index% img src=images/icoEdit.gif/anbsp; /td /tr /logic:iterate If you can use JSTL, this may work for you, assuming ShopWorkOrderFormBean named shopWorkOrderForm in some scope: c:forEach var=item items=${shopWorkOrderForm.shopWorkOrder.partList} varStatus=status tr td class=formCellc:out value=${item.partNumber}//td td class=formCellc:out value=${item.partDescription}//td td class=formCell a href='app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=updatepartIndex=c:out value=${status.index}/'img src=images/icoEdit.gif/anbsp;/a /td /c:forEach robert -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 6:12 PM To: 'Struts Users Mailing List' Subject: RE: A question on Struts taglib. I changed my code to use indexId and got the following error: symbol : variable indexId location: class jsp_servlet._app._fdd._shopworkorder.__createshopworkorder out.print(weblogic.utils.StringUtils.valueOf(indexId )); //[ /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp; Line: 136] Here's the changed code: logic:iterate id=parts indexId=index collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=updatepartInd ex=%=indexId% img src=images/icoEdit.gif/anbsp; /td /tr /logic:iterate Any Idea? What did I do wrong? -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:45 PM To: Struts Users Mailing List Subject: RE: A question on Struts taglib. add index attribute in your logic iterate and append that index to your host string. e.g logic:iterate id=xyzID name=xyzForm property=xyz indexId=index yourhoststring+%=indexId % /logic:iterate -R -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:18 PM To: [EMAIL PROTECTED] Subject: A question on Struts taglib. A question on Struts taglib. Can someone tell me how to reference the index of each element so I can pass it as a parameter with the a href path string? For example I have the following code, I want to print out 'partNumber' and 'partDescription' and a a href' with index of each element'. logic:iterate id=parts collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePart.exec?index=How to reference the index here img src=images/iconEdit.gif/anbsp; /td/tr /logic:iterate Thanks in advance! Stella - 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: A question on Struts taglib.
Thanks Robert, that works. -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 8:52 PM To: Struts Users Mailing List Subject: RE: A question on Struts taglib. Try this: logic:iterate id=parts indexId=index collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=updatepartInd ex=%=index% img src=images/icoEdit.gif/anbsp; /td /tr /logic:iterate If you can use JSTL, this may work for you, assuming ShopWorkOrderFormBean named shopWorkOrderForm in some scope: c:forEach var=item items=${shopWorkOrderForm.shopWorkOrder.partList} varStatus=status tr td class=formCellc:out value=${item.partNumber}//td td class=formCellc:out value=${item.partDescription}//td td class=formCell a href='app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=updatepartInd ex=c:out value=${status.index}/'img src=images/icoEdit.gif/anbsp;/a /td /c:forEach robert -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 6:12 PM To: 'Struts Users Mailing List' Subject: RE: A question on Struts taglib. I changed my code to use indexId and got the following error: symbol : variable indexId location: class jsp_servlet._app._fdd._shopworkorder.__createshopworkorder out.print(weblogic.utils.StringUtils.valueOf(indexId )); //[ /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp; Line: 136] Here's the changed code: logic:iterate id=parts indexId=index collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=updatepartInd ex=%=indexId% img src=images/icoEdit.gif/anbsp; /td /tr /logic:iterate Any Idea? What did I do wrong? -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:45 PM To: Struts Users Mailing List Subject: RE: A question on Struts taglib. add index attribute in your logic iterate and append that index to your host string. e.g logic:iterate id=xyzID name=xyzForm property=xyz indexId=index yourhoststring+%=indexId % /logic:iterate -R -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:18 PM To: [EMAIL PROTECTED] Subject: A question on Struts taglib. A question on Struts taglib. Can someone tell me how to reference the index of each element so I can pass it as a parameter with the a href path string? For example I have the following code, I want to print out 'partNumber' and 'partDescription' and a a href' with index of each element'. logic:iterate id=parts collection=%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% type=com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean/td tr td class=formCellbean:write name=parts property=partNumber/nbsp;/td td class=formCellbean:write name=parts property='partDescription' /nbsp;/td td class=formCell a href=app/fdd/shopWorkOrder/UpdatePart.exec?index=How to reference the index here img src=images/iconEdit.gif/anbsp; /td/tr /logic:iterate Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:text question
The message-resource file is loaded at startup an held in memory as an instance of org.apache.struts.util.MessageResources. The instance is stored in the ServletContext. To access it from a JSP, look for the Globals.MESSAGES_KEY attribute: %@ page import=org.apache.struts.Globals % %@ page import=org.apache.struts.util.MessageResources % % MessageResources mr = (MessageResources)pageContext.getServletContext().getAttribute( Globals.MESSAGES_KEY ); String dbServer = mr.getMessage( login.db.server ); % ... td class=left html:text property=dbServer value=%= dbServer % size=16/ /td From a servlet, it's import org.apache.struts.util.MessageResources; ... MessageResources mr = (MessageResources)request.getSession().getServletContext().getAttribute( Globals.MESSAGES_KEY ); String dbServer = mr.getMessage( login.db.server ); On Friday 20 February 2004 09:27, Slattery, Tim - BLS wrote: how can i add the test value to the html:text like below bean:define id=test name=testForm property=testers.testerName/ html:text name=username value='bean:write name=test/'/ You can't nest tags, but you can use the el version of the Struts html tags: html-el:text name=username value=${testForm.testers.testerName}/ ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Eclipse + Tomcat plugin question
still trying... my folder structure is like this: c:\development\-eclipse \-tomcat how do i check the working dir ? --- Andrew Hill [EMAIL PROTECTED] wrote: Maybe its a working directory thing? I know when I use sysdeo 2.2.1 (2.2 is buggy) with Eclipse 2.1 the working directory will be c:\eclipse (cos thats where my eclipse is), so any code in the webapp that makes the assumption that its working directory is the tomcat bin folder has problems. (In some cases I have sidestepped the issue by copying the things its looking for from bin to my eclipse folder. Yucky but it lets me run under eclipse and debug at least!... sigh/) -Original Message- From: lixin chu [mailto:[EMAIL PROTECTED] Sent: Tuesday, 17 February 2004 19:05 To: [EMAIL PROTECTED] Subject: Eclipse + Tomcat plugin question Hi , sorry if this is not the right forum for this question: I am using Eclipse 3.0M6, Tomcat 5.0.18 and Sysdeo plugin for Tomcat 2.2.1, and Struts 1.1. everything works fine until I wanted to use Log4J in my code. When I start Tomcat from within Eclipse, it reports missing log4j.jar in Tomcat\bin; but after adding log4j-1.2.8.jar, new error msg saying that missing log4j-core.jar. I do not know why I need this as I thought there is only one log4j jar file. but googled and there is a log4j-core.jar but again, a new error came out saying that somethign to do with tomcat\conf\server.xml. lost now. appreciate your help ! li xin __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.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] __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Client Side Validation Question
Hi, I have a little problem with validation. I have a form with a field html:text that show the property de a bean in a session scope. If the field is empty at the load of the page the validation works right, but if the property have any value at the load the validation (required) fail. I think that cause is the render of the html:text to: input value=some value and the value is not null. If the form field is cleared in the screen is empty but code fail to validate. Are there a workaround for this? Thanks in advance. -- Juan Carlos Paramá - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:text question
Question, how can i add the test value to the html:text like below bean:define id=test name=testForm property=testers.testerName/ html:text name=username value='bean:write name=test/'/ but this is not working, any idea ? thks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]