Re: the difference between struts with JSTL tags and struts-el tags
Kay, Thanks for your reply. >Do you have a valid "taglib" directive in your JSP? Yes. > Do you have both the struts.jar and strutsel.jar in your WEB-INF/lib, Yes. both struts.jar and struts-el.jar >and there are no other instances of those jars in your classpath? my classpath: .;c:\j2sdk1.4.2_01\bin;c:\j2sdk1.4.2_01\lib;d:\batik\batik-1.5\lib;d:\batik\ xml-batik;d:\junit3.8.1\junit.jar >What container are you using? Jrun 4.0 updater 3 After I switched back to use struts with JSTL tags, the problem went away. I am thinking if there is no difference between struts with jstl tag and struts-el tags, I do not have to switch. What is the advantage of using struts-el tags over jstl tags? Thank you. Kathy - 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]
the difference between struts with JSTL tags and struts-el tags
All, I am confused after using struts-el tags. I was previously using standard struts tags with jstl tags as needed. After I switched to use struts-el, some of tags are no more working. for example, readonly="true" attribute in html:text tag is not working in struts-el tags. It is saying that Error: No match was found for method "setReadonly(java.lang.String)". It seems "true" becomes a string instead of boolean type in html:text tag (el). Now my question is "What are the special features in el-tags which improve struts standard tags and jstl tag?" I tried to find the answer from online docs. But there are not too much info provided on the Internet. Does anybody have the answer to my question? Thanks, Kathy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page pre-processing - reply
Manually calling execute() will work if execute() only does the initializing collections or data used on a form. Good idea. Kathy - Original Message - From: "None None" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, May 30, 2004 10:13 AM Subject: Re: Page pre-processing - reply > Is your preparation being done in an Action? If so, why not just > instantiate it yourself and call execute() manually? > > I do something I think is similar to your question in an application I just > converted to Struts... > > I have a management-type screen that has a list of users that can be > maintained. It also has detail entry fields for maintaining a selected user > or creating a new user. The initial Action that is accessed when the page > is first shown populates various drop-downs. Another Action populates the > list of users (based on some search criteria). Any time a maintenence > function is performed, like delete user, update user, etc., I instantiate > the first two Actions, call execute() on them, passing them the ActionForm > for the screen from the Action that was actually called. They do what they > need to do, populate the ActionForm, and return. So, it's like: > > UpdateUserAction { > PopulateDropDownsAction pdda = new PopulateDropDownsAction(); > pdda.execute(mapping, form, request, response); > ListUsersAction pua = new ListUsersAction(); > lua.execute(mapping, form, request, response); > return forward... > } > > So every Action that is performed on this screen will always "pre-process" > my form and get any default data populated that should be populated. > > It's of course possible I completely misunderstood your question in the > first place, but if not, this might do the trick for you. I think people > sometimes forget that you can manually call Actions from other Actions, > which is the key point. > > >From: <[EMAIL PROTECTED]> > >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > >To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > >Subject: Re: Page pre-processing - reply > >Date: Sat, 29 May 2004 23:42:22 -0400 > > > >Eric, > >The way I did was to add the collection to request in Action bean when the > >validation of the form failed. The collection was re-initialized as needed. > > > >I have not found any other way in struts yet. > > > >Kathy > > > >- Original Message - > >From: "Eric Fesler" <[EMAIL PROTECTED]> > >To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > >Sent: Saturday, May 29, 2004 11:58 AM > >Subject: Page pre-processing > > > > > > > Hi, > > > > > > I'm currently working on an application with several pages having > > > multiple combo-boxes. > > > > > > The content of the combo-boxes is closely related to other components of > > > the model. Therefore, I use a 'prepare' action to setup the model and > > > put the combo-box collections in the request scope. > > > > > > Unfortunately, this way of working is not compatible with the Struts > > > validation process. Indeed, when the validation of the form failed, the > > > request is forwarded back to the input page and the collections are not > > > initialized. > > > > > > A workaround would be to put the collections in the session scope (what > > > I finally did) but at the end the session becomes full of garbage > > > information. Another solution is to build the collection within the JSP > > > page (maybe with custom tags) but this is against the separation of the > > > view and the model. > > > > > > I was wondering if anybody had already thought about an additional > > > parameter linked to a struts-forward allowing page pre-processing. This > > > parameter could point to a new kind of model action that will complete > > > the model with information needed by the view any time the forward is > > > activated. > > > > > > Or... I'm missing something ... > > > > > > > > > How do you handle such a case? > > > > > > Thanks, > > > > > > --Eric > > > > > > > > > > > > - > > > 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] > > > > _ > FREE pop-up blocking with the new MSN Toolbar - get it now! > http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ > > > - > 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: Page pre-processing - reply
Eric, The way I did was to add the collection to request in Action bean when the validation of the form failed. The collection was re-initialized as needed. I have not found any other way in struts yet. Kathy - Original Message - From: "Eric Fesler" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Saturday, May 29, 2004 11:58 AM Subject: Page pre-processing > Hi, > > I'm currently working on an application with several pages having > multiple combo-boxes. > > The content of the combo-boxes is closely related to other components of > the model. Therefore, I use a 'prepare' action to setup the model and > put the combo-box collections in the request scope. > > Unfortunately, this way of working is not compatible with the Struts > validation process. Indeed, when the validation of the form failed, the > request is forwarded back to the input page and the collections are not > initialized. > > A workaround would be to put the collections in the session scope (what > I finally did) but at the end the session becomes full of garbage > information. Another solution is to build the collection within the JSP > page (maybe with custom tags) but this is against the separation of the > view and the model. > > I was wondering if anybody had already thought about an additional > parameter linked to a struts-forward allowing page pre-processing. This > parameter could point to a new kind of model action that will complete > the model with information needed by the view any time the forward is > activated. > > Or... I'm missing something ... > > > How do you handle such a case? > > Thanks, > > --Eric > > > > - > 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: presentation tag- Thank you.
Mark and Joe, Thank you very much for your info. I will try it out. :) Kathy . - Original Message - From: "Joe Germuska" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, May 27, 2004 5:15 PM Subject: Re: presentation tag > At 4:54 PM -0400 5/27/04, Kathy Zhou wrote: > >How could I show 3 elements of a ArrayList per line on the page with > > tag. > > > >My code is: > >HashMap ilist =..; > >Its value is a ArrayList of javabeans having getter/setter methods. > > > > > > c:out value="${vissue.key}"/> > > > > <%--- need 3 var values > >per line --%> > > > > > > > >it shows me one pcode value per line on html page. But I want to show three > >pcodes per line. Since there is no index number I could use (I may be > >wrong) on the second tag, how could I make it? Any suggestions? > > Use the "varStatus" attribute of c:forEach to specify the name under > which the tag will define a "LoopTagStatus" bean. > > http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/c/forEach.html > http://java.sun.com/webservices/docs/1.3/api/javax/servlet/jsp/jstl/core/Loo pTagStatus.html > > The LoopTagStatus bean has an index property. > > Joe > > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com >"Imagine if every Thursday your shoes exploded if you tied them > the usual way. This happens to us all the time with computers, and > nobody thinks of complaining." > -- Jef Raskin > > - > 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]
set default values for form fields - follow-up
I think the answer I got from online resources is I need to use either DynaValidatorForm or my own ActionForm, but not both. It seems that I could not overwrite reset(...) method in DynaValidatorForm by extending it. Correct me if I am wrong. Thanks, Kathy - Original Message - From: <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Saturday, May 15, 2004 5:24 PM Subject: Re: How to set an ActionForm to null > I am using DynaValidatorForm but I need to set the default values for some > text fields in a form. Therefore, I write a ActionForm which extends > DynaValidatorForm and use reset method to set default values. The values > were not shown after the form was loaded. > I must miss something here. Could anyone provide some hints? Thanks a lot. > > Kathy > > > - > 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]
Sorry I was using a wrong subject in my previous msg, which is not related to the subject "set ActionForm to null".
- Original Message - From: "Niall Pemberton" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "pls" <[EMAIL PROTECTED]> Sent: Saturday, May 15, 2004 4:43 PM Subject: Re: How to set an ActionForm to null > This is expected behaviour, when you forward to your second Action Struts > will go through all its normal steps, finding/creating the ActionForm, > populating the form from the request, validating and then calling the > Action's execute method. So setting it to null isn't going to work, you need > to rethink how you design this. > > Niall > > - Original Message - > From: "pls" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, May 14, 2004 5:33 AM > Subject: How to set an ActionForm to null > > > > hi there, > > > > i am trying to set an actionform to null after inserting it's properties > > into a DB. > > then, control is forwarded to a different action and the info is read from > > the DB back into the actionform for display by a JSP. > > > > the only part that is giving me trouble is with explicitly setting my > > actionform "MBForm" to null. After several form submissions and a DB > > update, the first Action attempts to clear the values in MBForm: > > > > request.getSession().setAttribute("MBForm", null); > > > > after this, control is forwarded to the second Action which handles the > > display. it checks to see if MBForm is null and, if it is, it fills > MBForm > > from a DB. in between these two actions, the controller servlet is > > automatically refilling the MBForm with the values that I just nullified.. > > the only bean property that stays empty is myHash which represents several > > groups of multiboxes. i believe this is a result of the MBForm reset() > > method which contains the following: > > > > myHash.put(multiBoxCategories, new Integer[0]); //resets several > > groups of multiboxes > > > > setting other properties to null in the reset() method is not the solution > > as it wipes the value out after every (but somehow it doesn't do the same > > thing to the multiboxes?!?) > > > > let me know if this enough background for you to help me diagnose the > > problem.. any discussion of reset() or is welcome.. thanks > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set an ActionForm to null
I am using DynaValidatorForm but I need to set the default values for some text fields in a form. Therefore, I write a ActionForm which extends DynaValidatorForm and use reset method to set default values. The values were not shown after the form was loaded. I must miss something here. Could anyone provide some hints? Thanks a lot. Kathy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic tag
I am new to struts. I have a question regarding logic tag. I was replacing those if else if . end if stuffs with logic tags on jsp pages. For example: if num==1 {// condition 1 block 1; }else if num==2 {// condition 2 block 2; } Usually if condition 1 is true, condition 2 does not be evaluated. Now if I use tag as follows: (condition 1) block 1; (condition 2) block 2; It seems that condition 2 is always evaluated no matter what the result of condition 1 is. It would be a performance penalty if this is the case. Am I wrong? Thanks for help, Kathy