urgent - data-source and container managed datasource
Hi There, I'm getting ready to ship off my application and I'm trying to use the application server (standalone oc4j) to hold the data source information instead of having it in struts-config.xml. Is this possible? When jDeveloper deploys to the server it builds me a data-sources.xml file which I presume is correct. When I test the connection, its fine. In web.xml I entered: resource-ref res-ref-namejdbc/bartCoreDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Where jdbc/bartCoreDS matches the location entry of the data-source in data-sources.xml. Then I took out the data-sources from struts-config.xml. I'm not terribly surprised that now my application can't find the database. The problem is I don't know where to look for instructions on how to do this or if its even possible. Is there a way to put a data-source configuration in struts-config.xml that tells it to look at the container, so that the username and password aren't in it?? If I can provide more information, I will. Time is running a bit short, so I'd really, really appreciate a quick response. Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
urgent - data-source and container managed datasource
A big thank you to Richard and Shyam! I have things working again and am back on track to get this app deployed!! Janice - Original Message - From: Janice To: [EMAIL PROTECTED] Sent: Tuesday, March 16, 2004 11:56 AM Subject: urgent - data-source and container managed datasource Hi There, I'm getting ready to ship off my application and I'm trying to use the application server (standalone oc4j) to hold the data source information instead of having it in struts-config.xml. Is this possible? When jDeveloper deploys to the server it builds me a data-sources.xml file which I presume is correct. When I test the connection, its fine. In web.xml I entered: resource-ref res-ref-namejdbc/bartCoreDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Where jdbc/bartCoreDS matches the location entry of the data-source in data-sources.xml. Then I took out the data-sources from struts-config.xml. I'm not terribly surprised that now my application can't find the database. The problem is I don't know where to look for instructions on how to do this or if its even possible. Is there a way to put a data-source configuration in struts-config.xml that tells it to look at the container, so that the username and password aren't in it?? If I can provide more information, I will. Time is running a bit short, so I'd really, really appreciate a quick response. Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can I do this with tiles?
I have some pages that are being reused to display things that are the same but different. For example: I have 3 organization types that all use the same code. But an organization type of 'client' might do a few different things than a type of 'vendor'. My decisions are based on an 'orgType' request parameter. So far, so good. Here's what I need to do: based on the orgType request parameter, make an orgType-specific call to one of my tiles. I have a tile for breadcrumbs that I pass in a path to, and then a tag on the breadcrumb tile spits out the breadcrumb trail. So far all I have in my call to the tile is: put name=breadcrumb value=/jsp/common/breadcrumb.jsp?bc=/adminMain/organizations/ but I need it to be one of these: put name=breadcrumb value=/jsp/common/breadcrumb.jsp?bc=/adminMain/contractors/ put name=breadcrumb value=/jsp/common/breadcrumb.jsp?bc=/adminMain/orgunits/ put name=breadcrumb value=/jsp/common/breadcrumb.jsp?bc=/adminMain/adminProject/clients/ So, can I do this kind of logic in my tiles-def.xml? Thanks in advance, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
need help converting from session to request scope
Hi Gang, I've been doing things badly... putting everything in session scope. The good news is that everything works beautifully :) But now that I've got 100+ actions I've decided to go put stuff into request scope. The bad news is that everything grinds to a halt. Here's an example of where I've added the scope to an action mapping: --- snip --- actionpath=/yearlyAllocation input=.yearlyAllocationForm parameter=action type=ca.bc.gov.srm.bart.actions.YearlyAllocationActions scope=request name=yearlyAllocationForm validate=false forward name=form path=.yearlyAllocationForm / forward name=list path=.yearlyAllocationList / forward name=gotolist path=/yearlyAllocation.do?action=showList / /action /--- snip --- Previously I'd left the scope line out. So my now jsp page can't find my form goodies on the page. It falls apart here: --- snip --- html:select property=yearCode html:optionsCollection property=years label=yearFull value=yearCode / /html:select /--- snip --- with a NullPointerException. But it did make it past here: --- snip --- html:form action=/yearlyAllocation?action=submitForm name=yearlyAllocationForm type=org.apache.struts.validator.DynaValidatorForm focus=yearCode /--- snip --- which I guess I'm surprised at. I'd love to put up all kinds of code, but I'm using DispatchActions, tiles, DynaValidatorForms, etc, so I'm not really sure where to start cutting and pasting. If anyone has any requests for more info, I'd be happy to oblige. Oh, this one looks important: in my method where I set up the form before passing it to the .jsp, I set up my form all pretty with lots of Strings and ArrayLists and then I do one of these: --- snip --- if ( request.equals(mapping.getScope()) ) { request.setAttribute(mapping.getAttribute(), form); } else { HttpSession session = request.getSession(); session.setAttribute(mapping.getAttribute(), form); } /--- snip --- which I thought was designed to handle this. So, to make a long story short, what else do I need to do to switch from putting all my form beans in session scope to putting them in request scope? Do I need to tell the .jsp page to look somewhere else or something? Thanks very much in advance, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
need help converting from session to request scope
Thanks for the responses, Paul and Hubert! (I wanted to send this off sooner, but my boss called and wouldn't let me off the phone for an hour! The joy of telecommuting...) In response to Paul: I would like to start storing things in the request so that I don't have to worry about cleaning up all the many objects I'm putting in the session. I was doing some reading this morning that implied that the only reason to store form beans in the session is if I was doing multi-paged forms. I am not doing that in many places, so I would rather narrow the scope and not worry about taking up too much memory. If there aren't any performance problems, I could happily leave it alone. And I would like to ask why I can't store my lists in the form bean if I'm going to request scope? What I'm doing in most cases is setting up the form bean with the lists for drop-downs (if any), and if I'm editing a widget, I populate the form with the last saved values. Then the user submits, I do an insert, update or delete and everyone's happy. In response to Hubert: I'm using DispatchActions, so the action mapping where I set up the scope=request is the same action mapping that does both ActionA (showForm) and ActionB (submitForm). I also did a little test: --- snip --- if ( request.equals(mapping.getScope()) ) { log.info(did request scope); request.setAttribute(mapping.getAttribute(), form); } else { log.info(did session scope); HttpSession session = request.getSession(); session.setAttribute(mapping.getAttribute(), form); } /--- snip --- And right before the .jsp bombs my log shows I'm doing request scope. So why can't my .jsp find the stuff in my form? After reading Hubert's second email: Sorry, but could you clarify: To use request scope, you can either: 1) Leave your Strings/ArrayLists in session scope 2) Put them in application scope 3) Put them in request scope, then change your ActionB mapping to use ActionA as input. You'll need to make sure you don't reset FormA's values in ActionA when it's for a redisplay. Obviously I'm missing something big here. Is the following thinking flawed: I can pass a formBean from ActionA via request to the .jsp to use and then when the user submits I will get a new formBean back via request? Thanks again for your help, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: need help converting from session to request scope
Me again, I just had some kind of breakthrough... I think. Because my .jsp form was specifying the name and type of the form, it wasn't picking up on the scope. If I add scope into the form declaration, I'm ok. Also if I take the name and type out of form I'm ok (but that was causing a problem at some point, so I'll have to do more testing to remember what the problem was). The only glitch is when validation fails, since my drop-downs come back empty. So I'm thinking that I can get around this, but it'll mean extra database calls and be a performance problem that way instead of just hogging the session memory. I guess this is why I was told this stuff had to be in the session... it all makes sense now. Back to the drawing board. Janice - Original Message - From: Janice To: [EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 2:03 PM Subject: need help converting from session to request scope Thanks for the responses, Paul and Hubert! (I wanted to send this off sooner, but my boss called and wouldn't let me off the phone for an hour! The joy of telecommuting...) In response to Paul: I would like to start storing things in the request so that I don't have to worry about cleaning up all the many objects I'm putting in the session. I was doing some reading this morning that implied that the only reason to store form beans in the session is if I was doing multi-paged forms. I am not doing that in many places, so I would rather narrow the scope and not worry about taking up too much memory. If there aren't any performance problems, I could happily leave it alone. And I would like to ask why I can't store my lists in the form bean if I'm going to request scope? What I'm doing in most cases is setting up the form bean with the lists for drop-downs (if any), and if I'm editing a widget, I populate the form with the last saved values. Then the user submits, I do an insert, update or delete and everyone's happy. In response to Hubert: I'm using DispatchActions, so the action mapping where I set up the scope=request is the same action mapping that does both ActionA (showForm) and ActionB (submitForm). I also did a little test: --- snip --- if ( request.equals(mapping.getScope()) ) { log.info(did request scope); request.setAttribute(mapping.getAttribute(), form); } else { log.info(did session scope); HttpSession session = request.getSession(); session.setAttribute(mapping.getAttribute(), form); } /--- snip --- And right before the .jsp bombs my log shows I'm doing request scope. So why can't my .jsp find the stuff in my form? After reading Hubert's second email: Sorry, but could you clarify: To use request scope, you can either: 1) Leave your Strings/ArrayLists in session scope 2) Put them in application scope 3) Put them in request scope, then change your ActionB mapping to use ActionA as input. You'll need to make sure you don't reset FormA's values in ActionA when it's for a redisplay. Obviously I'm missing something big here. Is the following thinking flawed: I can pass a formBean from ActionA via request to the .jsp to use and then when the user submits I will get a new formBean back via request? Thanks again for your help, Janice
preview form
Hi Gang, I have a form that the client would like to be 'previewed' before users can submit. The plan is to have a form with a button that takes the user to the exact same form, but with all the form elements set to readonly. From there the user can go back to the editable form or can submit. At least that's the plan. I'm open to other suggestions, especially of the 'best practices' variety. I would have liked to display the form information on a non-form looking page, but the problem I have is the drop-downs which have a very different value from label. I don't want the preview to display something like: person: 12353 instead of person: Jane Doe So I guess I need the drop-downs, unless you all have a workaround? My immediate problem is that html:select / doesn't support readonly... what else can I do? TIA, JJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: preview form
Hello again, Thanks for the responses. What I ended up with was having my original form take the user to the preview form where all the form elements were disabled, instead of readonly. It even provides a nice visual clue that the form isn't for input, since all the fields are slightly greyed out (I just hope the users can still read it!). Then from there the user can either accept or reject the values entered or changed. Cheers, Janice - Original Message - From: Janice To: [EMAIL PROTECTED] Sent: Monday, February 16, 2004 1:03 PM Subject: preview form Hi Gang, I have a form that the client would like to be 'previewed' before users can submit. The plan is to have a form with a button that takes the user to the exact same form, but with all the form elements set to readonly. From there the user can go back to the editable form or can submit. At least that's the plan. I'm open to other suggestions, especially of the 'best practices' variety. I would have liked to display the form information on a non-form looking page, but the problem I have is the drop-downs which have a very different value from label. I don't want the preview to display something like: person: 12353 instead of person: Jane Doe So I guess I need the drop-downs, unless you all have a workaround? My immediate problem is that html:select / doesn't support readonly... what else can I do? TIA, JJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 'response has already been committed' on protected page when I expected the login form?
I'm sorry to repost this question, but I wanted to add some more details: I experimented by adding a test page to my protected directory that does not use tiles. When I accessed that test page, got a 404: Page cannot be found. So then I changed the following in my web.xml file from: login-config auth-methodFORM/auth-method form-login-config form-login-page.login/form-login-page form-error-page.loginFailed/form-error-page /form-login-config /login-config to: login-config auth-methodFORM/auth-method form-login-config form-login-page/jsp/login/login.jsp/form-login-page form-error-page/jsp/login/login_failed.jsp/form-error-page /form-login-config /login-config Now when I access the test file (the one without tiles) I do get the login form (just the form, not in my tiles). Either way, when I access another file in the same directory that does use tiles, I still get the 'response has already been committed' in the body tile. If I remove the protection from the directory, the page works just fine. Thanks in advance for any help, Janice - Original Message - From: Janice [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 23, 2004 2:23 PM Subject: 'response has already been committed' on protected page when I expected the login form? Hi Gang, I've started putting authentication into my struts app. The problem I'm having is that as soon as I go to an area that is protected, I get the response has already been committed error in my body tile. Could somebody please tell me what I'm doing wrong? This is what I added to web.xml: security-constraint web-resource-collection web-resource-nameProtected_Pages/web-resource-name descriptionThese pages are only accessible by authorized admins/description url-pattern/jsp/admin/*/url-pattern /web-resource-collection auth-constraint descriptionThese are the roles that have access./description role-nameappAdmin/role-name /auth-constraint user-data-constraint descriptionThis is how the user data must be transmitted between the client and the server./description transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page.login/form-login-page form-error-page.loginFailed/form-error-page /form-login-config /login-config security-role role-name appAdmin /role-name /security-role My pages are defined in tiles-def.xml as: definition name=.login extends=.layout.base put name=body value=/jsp/login/login.jsp/ /definition definition name=.loginFailed extends=.layout.base put name=body value=/jsp/login/login_failed.jsp/ /definition I should note that even when I called the .jsps directly it didn't work either. I feel a little lost here... the how-tos make it sound so easy, but I can't even get the silly form to show up! Thanks in advance, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
'response has already been committed' on protected page when I expected the login form?
Hi Gang, I've started putting authentication into my struts app. The problem I'm having is that as soon as I go to an area that is protected, I get the response has already been committed error in my body tile. Could somebody please tell me what I'm doing wrong? This is what I added to web.xml: security-constraint web-resource-collection web-resource-nameProtected_Pages/web-resource-name descriptionThese pages are only accessible by authorized admins/description url-pattern/jsp/admin/*/url-pattern /web-resource-collection auth-constraint descriptionThese are the roles that have access./description role-nameappAdmin/role-name /auth-constraint user-data-constraint descriptionThis is how the user data must be transmitted between the client and the server./description transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page.login/form-login-page form-error-page.loginFailed/form-error-page /form-login-config /login-config security-role role-name appAdmin /role-name /security-role My pages are defined in tiles-def.xml as: definition name=.login extends=.layout.base put name=body value=/jsp/login/login.jsp/ /definition definition name=.loginFailed extends=.layout.base put name=body value=/jsp/login/login_failed.jsp/ /definition I should note that even when I called the .jsps directly it didn't work either. I feel a little lost here... the how-tos make it sound so easy, but I can't even get the silly form to show up! Thanks in advance, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Issues when reusing a DynaValidatorForm
I have a simple DynaValidatorForm (just 3 items: name, description, action) that is reused for several forms. The issue that I'm having is that the names of the form elements might be different from one form to the next. For example, on one page the 'name' might be called 'Project Code' and on another page it might be 'widget Short Name' and so on. So far I'm writing out distinct .jsp pages for each form, because I can't seem to get around having to do: bean:message key=projectCode.desc/ and bean:message key=widget.desc/. Is there a way to pass in some variable to the bean tag so that I can define the variable once such as: bean:message key=%= control %.desc/? So far I haven't found anything that works. Also, when I am using validation on my form, is there anything I can do to get the page-specific text to appear in my error messages? I bet someone's going to complain if I use a really generic description of name and description. Thanks in advance, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Issues when reusing a DynaValidatorForm
Thanks Richard, but I think mayhaps I didn't explain myself very well the first time, because I'm not sure that a mapped backed property will do it for me. That or I just don't understand what a mapped backed property is :) I want a name property on all of the forms that are using my DynaValidatorForm, but I want the text next to the field to read something different. So its the bean:message key=widget.desc/ that I want to change from page to page. So far simply having distinct .jsps is working, but I'd like to reduce the duplicated code. The validator is the other part of the problem... so far its looking like this: form name=simpleForm field property=code depends=required arg0 key=common.validate.code/ /field . But I want the key to be page specific. Thanks, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: ClassCastException coming from DynaValidatorForm.validate()- bug or a feature?
I went to the source to try to find out what was causing this problem, and I started to suspect that: form-property name=page type=java.lang.String initial=home / was the problem... sure enough, when I changed the name to thePage, instead of page, it worked. Would this be a bug or just a feature that I missed the documentation for? Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ClassCastException coming from DynaValidatorForm.validate()
Hello all, I did have validation, etc, working in another application, but now I'm starting a new application and I'm getting an error that I can't explain. When I submit my form, I call: ActionErrors errors = form.validate(mapping, request); which spits up this error: ** error stuff starts here ** java.lang.ClassCastException: java.lang.String org.apache.struts.action.ActionErrors org.apache.struts.validator.DynaValidatorForm.validate(org.apache.struts.act ion.ActionMapping, javax.servlet.http.HttpServletRequest) DynaValidatorForm.java:141 org.apache.struts.action.ActionForward ca.bc.gov.srm.bart.actions.AnnouncementActions.submitForm(org.apache.struts. action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) AnnouncementActions.java:137 java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) native code ** error stuff ends here, well, there's lots more of that, but you probably don't need to see the whole thing... ** All of my .jars and .tlds and .dtds are from the 1.1 release of Struts. I am using jDeveloper, but I was with the other application as well. I think my validation.xml and validator-rules.xml are being read, since if I put a typo in either one, the typo gets caught. This is my form definition: form-bean name=announcementForm type=org.apache.struts.validator.DynaValidatorForm form-property name=id type=java.lang.String / form-property name=page type=java.lang.String / form-property name=type type=java.lang.String / form-property name=heading type=java.lang.String / form-property name=desc type=java.lang.String / form-property name=expiry type=java.lang.String / form-property name=sequence type=java.lang.String / /form-bean I can remove everything from my validation.xml file that pertains to this form (its the first one), and the error still happens, so I don't think its got anything to do with my code in there. I would really, really appreciate some insight into this problem! Janice ps: Seasons' Greetings! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: validatation : the select field and checkbox field origin value lost...
Hi Ricky, After validation, struts will display whatever you specified in the input parameter of your action mapping. If you specify an action (like displayForm.do), then all of the processing that is done in that action will be performed before the page is shown. I suspect this is why the values on the form that were changed have gone back to their defaults. What you probably want to do instead is specify the .jsp page that you would normally forward to upon success (like myForm.jsp). hth, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: Getting ArrayList of objects from my form bean into my drop down list - solution
Just in case some other newbies are doing the same thing, this was my solution: html:select property=projCodeName bean:define id=codes name=projectForm property=projCodeNames/ html:options collection=codes property=name labelProperty=name/ /html:select Its making a new bean on the .jsp page with my ArrayList that was in my form bean, and then I can easily get the values from it. (I can't wait until this stuff is all second nature! I haven't even started doing anything difficult yet!) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Getting ArrayList of objects from my form bean into my drop down list
Hi, I am working on getting a drop-down list of values that are generated from a DB call to show up on my page, both before and after validating the page. It was working earlier, when I was just making a nice ArrayList of my objects and adding the list to the session. (It looked to me like it had to be in the session, since the request lost the ArrayList after validate().) That didn't seem like the best plan, so I tried to make my list part of my DynaValidatorForm. (Now if you all say that its perfectly fine to add the ArrayList of options to the session, I'll take your word for it and stop there.) So, then I changed my form to add the ArrayList like such: form-bean name=projectForm type=org.apache.struts.validator.DynaValidatorForm form-property name=nametype=java.lang.String / form-property name=description type=java.lang.String / form-property name=weight type=java.lang.String / form-property name=active type=java.lang.String / form-property name=projCodeName type=java.lang.String / form-property name=projCodeNames type=java.util.ArrayList/. /form-bean The objects that are in the ArrayList are beans that have a few attributes. So in my .jsp, I've got: html:select property=projCodeName html:options property=projCodeNames / /html:select This started out being pretty ugly. It looked like it was calling toString() on my bean. I added a toString() method and then that's what I got back, as both my option's value and label. I suppose this makes sense, since I haven't told it which attributes to put out for either. The problem is, I don't see how to specify which attributes to use. I've read and re-read: http://jakarta.apache.org/struts/userGuide/struts-html.html#options and I guess I'm missing something, because I couldn't find the answer there. I suppose this would work if my ArrayList contained nothing but Strings. But then how would I get my value and label to be different? It appears that I would need to have two collections: one for the labels and one for the values. As I'm learning struts, it seems like there's lots of slick ways to do things, and having 2 collections of Strings doesn't seem very slick. So I'm assuming I'm missing something. Could someone please clue me in as to what I'm doing wrong or not understanding? Thanks in advance, Janice (Victoria, BC) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
(newbie asking advice) in which order do I call my .do and .jsp?
Sorry if this is too basic, I'm really green, but trying to learn the right way to do things. First off, I'm using tiles, and I think I was doing things backwards, and I'd like to confirm that I've got things going the right way now. So this is what I have: (1) When I want to display a list of widgets, my link is to: /projectTypes.do?action=showList (2) My mapping looks like this (ProjectTypeCodeActions extends DispatchAction): actionpath=/projectTypes input=/projectTypeCode/project_type_code_form.jsp parameter=action scope=request type=projectTypeCode.ProjectTypeCodeActions validate=false forward name=form path=/projectTypeCode/project_type_code_form.jsp / forward name=list path=/projectTypeCode/project_type_code_list.jsp / forward name=failure path=/common/error.html / /action (3) So it goes off to the DB to get my list, and then forwards off to project_type_code_list.jsp, which contains: %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % tiles:insert page=../layouts/PPELayout.jsp tiles:put name=menuLinks value=../common/menu.jsp / tiles:put name=mainBody value=../projectTypeCode/project_type_code_list_body.jsp / /tiles:insert So, like I said, I was doing it differently before, and I'm not sure why. I was calling my .jsp page, which was calling the .do from the tiles:put. It worked ok, but I suspect this is the better way. TIA, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: (newbie asking advice) in which order do I call my .do and .jsp?
Thanks Rick, While that wasn't exactly what I was asking, I think you gave me a better answer than what I was looking for :) That makes so much more sense than what I was doing!! Janice
validation occuring before form is loaded, why?
Thank you Richard and Susan, I feel silly, of course I didn't have validate=false on the mapping for displaying the form. But now I do and its finally validating!!! Janice (now if only I can figure out how to get the tiles to work, I can really get to work!) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
what is the right way to test whether execute() is called after validate()?
I'm sorry if this is too basic, I'm still really green. I'm validating a form. This form is used for adding and editing widgets. I use the same actionHandler, where I test a request parameter and set up the form accordingly. It builds my form object and either resets it for an add, or retrieves a widget from the DB and sticks it in my object. What I found was, when my validation failed on add or edit, it was still going thru the execute() method of my actionHandler and was therefore reset()ing on add or re-building my form object on edit. So, I put in something like this instead: if ((request.getParameter(Submit) == null) || (!request.getParameter(Submit).equals(Submit))) { if (request.getParameter(addEdit).equals(edit)) { form = buildCompanyForm(request.getParameter(id), request); } else { form = new CompanyForm(); form.reset(mapping, request); } } And it works, but testing whether Submit has been pressed seems kinda nasty. I'd like to learn a better way. Thanks in advance, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
wanted: library for making one jsp page work for many forms
Hi Gang, I'm going to be developing a couple of applications in struts, which I am new to. I will need dozens of simple forms for maintaining things like code tables in the database. It seems silly to me to have a distinct .jsp page for each of these forms. I was wanting to build one .jsp page that would handle a number of these forms for me. I imagine I could build a custom tag library for this. However, never being one to re-invent the wheel, I thought I'd ask first whether this is a standard extension/library already, or if someone has code they'd like to share. I'm also looking for a similar solution for a .jsp page that displays a list of codes and values, with links to an edit or delete form. Thanks in advance, J - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]