Treeview with checkbox
Greetings. I need to make a treeview for a web page that has check boxes next to the items so that users can change their status. Has anyone done something like this before with struts? I have gotten the Struts-Layout taglibs working, but I don't see any way to configure these with checkboxes. Here is an example: Thanks for any help.
Re: After refreshing Drop Down value has default data
I changed the action mapping to: So it should be request data, but it keeps the previously selected item in the list after submitting the form and returning to the page. On 2/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Is that session form ? > > -- Original message ------ > From: Daniel Kies <[EMAIL PROTECTED]> > > Yes that is the problem I am having. > > > > On 2/13/06, Tom Ansley <[EMAIL PROTECTED]> wrote: > > > > > > Once the form has been submitted can you not set that value on the > form > > > back > > > to the default? > > > > > > -Original Message- > > > From: Daniel Kies [mailto:[EMAIL PROTECTED] > > > Sent: Monday, February 13, 2006 11:28 AM > > > To: Struts Users Mailing List > > > Subject: After refreshing Drop Down value has default data > > > > > > Hello...I have an app where you are on a page that has a drop down > with > > > select then some values. After you choose a value the form is > submitted. > > > Data is reloaded in the array list used to fill the form. WHen I get > back > > > to the page the drop down has the value in it that was previously > > > selected. > > > So if you choose "green" in the drop down, after calling the action > and > > > loading the drop down's arraylist with "Red", "Blue", and "Green", > Green > > > is > > > selected in the box. Is there a way i can avoid this so the value > goes > > > back > > > to "Select"? > > > > > > code from jsp: > > > > > > > > > > > > Select > > > > > labelProperty="name"/> > > > > > > > > > Code from action: > > > GVO gvo = new GVO(); > > > gvo.setId(1); > > > gvo.setName("Red"); > > > GVO gvo2 = new GVO(); > > > gvo2.setId(2); > > > gvo2.setName("Green"); > > > ArrayList a = new ArrayList(); > > > a.add(gvo); > > > a.add(gvo2); > > > request.setAttribute("colors", a); > > > > > > Struts config mapping: > > > > > > > > > > > > > > > > > > > > name="testForm"> > > > > > > > > > > > > > > > - > > > 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: After refreshing Drop Down value has default data
Yes that is the problem I am having. On 2/13/06, Tom Ansley <[EMAIL PROTECTED]> wrote: > > Once the form has been submitted can you not set that value on the form > back > to the default? > > -Original Message- > From: Daniel Kies [mailto:[EMAIL PROTECTED] > Sent: Monday, February 13, 2006 11:28 AM > To: Struts Users Mailing List > Subject: After refreshing Drop Down value has default data > > Hello...I have an app where you are on a page that has a drop down with > select then some values. After you choose a value the form is submitted. > Data is reloaded in the array list used to fill the form. WHen I get back > to the page the drop down has the value in it that was previously > selected. > So if you choose "green" in the drop down, after calling the action and > loading the drop down's arraylist with "Red", "Blue", and "Green", Green > is > selected in the box. Is there a way i can avoid this so the value goes > back > to "Select"? > > code from jsp: > > > > Select > labelProperty="name"/> > > > Code from action: > GVO gvo = new GVO(); > gvo.setId(1); > gvo.setName("Red"); > GVO gvo2 = new GVO(); > gvo2.setId(2); > gvo2.setName("Green"); > ArrayList a = new ArrayList(); > a.add(gvo); > a.add(gvo2); > request.setAttribute("colors", a); > > Struts config mapping: > > > > > > name="testForm"> > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
After refreshing Drop Down value has default data
Hello...I have an app where you are on a page that has a drop down with select then some values. After you choose a value the form is submitted. Data is reloaded in the array list used to fill the form. WHen I get back to the page the drop down has the value in it that was previously selected. So if you choose "green" in the drop down, after calling the action and loading the drop down's arraylist with "Red", "Blue", and "Green", Green is selected in the box. Is there a way i can avoid this so the value goes back to "Select"? code from jsp: Select Code from action: GVO gvo = new GVO(); gvo.setId(1); gvo.setName("Red"); GVO gvo2 = new GVO(); gvo2.setId(2); gvo2.setName("Green"); ArrayList a = new ArrayList(); a.add(gvo); a.add(gvo2); request.setAttribute("colors", a); Struts config mapping:
Re: Validation problems
Niall: I took your recommendation and removed the action chaning from my struts config. I am still not seeing any error text. Here is my new action mapping: On 1/27/06, Niall Pemberton <[EMAIL PROTECTED]> wrote: > > On 1/26/06, Daniel Kies <[EMAIL PROTECTED]> wrote: > > Hello. I am trying to do some standard validations, but I am failing. > Any > > ideas why? I know the errors are getting raised as the request is > > forwarding back to the initial page making the request, but the error > > messages are not showing on the page. Any help is appreciated! > > > > Struts config DynaActionForm: > > > > > > > > > input="/LoadHomePage.do" validate="true"> > > > > > > > > > > > > jsp: > > > > > > > > > > > > > > if(searchString.equals("kill")){ > > ActionErrors errors = new ActionErrors(); > > errors.add("errors", new ActionError("errors", "errors")); > > saveErrors(request, errors); > > > > return mapping.findForward("error"); > > Action chaining is generally not recommended... > > http://struts.apache.org/struts-doc-1.2.x/faqs/newbie.html#chaining > > ...however, although your input/error is mapped to another action - I > can't see anything that would prevent your errors being shown. Unless > your "LoadHomePage" is a redirect? Maybe you could try having your > input/error mapping straight to a jsp and see if the errors appear > then? Also, could you show the entry for "LoadHomePage" in your > struts-config.xml? > > Niall > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: Validation problems
Either one would work, to be consistent with other struts tags I am using, html:text is probably better. This doesn't affect the validation issue. On 1/26/06, Thomas Garben <[EMAIL PROTECTED]> wrote: > > Dan, > > Should you be using" > instead of: > > > > Tom > > > > > > Daniel Kies <[EMAIL PROTECTED]> > 01/26/2006 04:07 PM > Please respond to > "Struts Users Mailing List" > > > To > Struts Users Mailing List > cc > > Subject > Validation problems > > > > > > > Hello. I am trying to do some standard validations, but I am failing. Any > ideas why? I know the errors are getting raised as the request is > forwarding back to the initial page making the request, but the error > messages are not showing on the page. Any help is appreciated! > > Struts config DynaActionForm: > type="org.apache.struts.action.DynaActionForm"> > type="java.lang.String"> > > input="/LoadHomePage.do" validate="true"> > > > > > > jsp: > > > > > > > if(searchString.equals("kill")){ >ActionErrors errors = new ActionErrors(); >errors.add("errors", new ActionError("errors", "errors")); >saveErrors(request, errors); > >return mapping.findForward("error"); > > >
Validation problems
Hello. I am trying to do some standard validations, but I am failing. Any ideas why? I know the errors are getting raised as the request is forwarding back to the initial page making the request, but the error messages are not showing on the page. Any help is appreciated! Struts config DynaActionForm: jsp: if(searchString.equals("kill")){ ActionErrors errors = new ActionErrors(); errors.add("errors", new ActionError("errors", "errors")); saveErrors(request, errors); return mapping.findForward("error");
FormFile file type validation
Does anyone know of a validator that can be plugged into the validator framework that will check file types for FormFile? This would be so a user can't upload certain extensions like .exe and the application will catch it. thanks.
bean:write removing carriage return
greetings. I am using a bean:write tag, but it is removing carriage returns from the result outputted on the jsp. Is there any way to avoid this so the carriage return shows up and the text goes to a new line? Thanks in advance.
Re: Multiple Drop Down Menus
Do you have any examples of using javascript to populate B after A or something like that? On 12/20/05, Neil Erdwien <[EMAIL PROTECTED]> wrote: > > If the amount of data needed for drop down B isn't large, I'd load it > into Javascript objects when the original page is displayed. Then use > client-side Javascript to populate B after A is chosen. > > If the amount of data is too big, I'd investigate doing the same concept > using client-side Javascript, but query the server for B's data using > AJAX methods. > > > Daniel Kies wrote: > > Greetings. I have an app that needs to have multiple drop down boxes > that > > are related to each other. Instead of calling an action everytime the > first > > menu is selected and querying for the data in the second drop down, I > want > > to have the values in the second drop down reflect the choice of the > first > > drop down. > > > > So Drop Down A has: > > 1. Color > > 2. Size > > > > If Color is selected, drop down B has: > > 1. Blue > > 2. Red > > 3. Green > > > > If Size is selected, drop down B has: > > 1. Small > > 2. Medium > > 3. Large > > > > I figure I can do this by calling an action when the A is selected, but > how > > can I do this without calling an action after A is chosen? > > > > Thanks in advance. > > > > -- > Neil Erdwien, [EMAIL PROTECTED], Web Technologies Manager > Computing and Network Services, Kansas State University > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Multiple Drop Down Menus
Greetings. I have an app that needs to have multiple drop down boxes that are related to each other. Instead of calling an action everytime the first menu is selected and querying for the data in the second drop down, I want to have the values in the second drop down reflect the choice of the first drop down. So Drop Down A has: 1. Color 2. Size If Color is selected, drop down B has: 1. Blue 2. Red 3. Green If Size is selected, drop down B has: 1. Small 2. Medium 3. Large I figure I can do this by calling an action when the A is selected, but how can I do this without calling an action after A is chosen? Thanks in advance.
Re: DynaValidatorActionForm File Upload
Ok, thanks. I never used that property before and I overlooked it. Thanks for your help. On 12/14/05, Dave Newton <[EMAIL PROTECTED]> wrote: > > Daniel Kies wrote: > > >Here it is: > > > > > > > Should be a multipart form, no? > > Dave > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: DynaValidatorActionForm File Upload
Here it is: File: On 12/14/05, Dave Newton <[EMAIL PROTECTED]> wrote: > > Daniel Kies wrote: > > >Hello. I am using DynaValidatorActionForm and I want to use File upload > to > >upload a local file to my struts action class. Is this possible? > > > > > Sure; I use FormFiles with DynaValidatorActionForms often. > > >and jsp code: > > >property="thefile"> > > > > > What does the html:form tag look like? > > Dave > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
DynaValidatorActionForm File Upload
Hello. I am using DynaValidatorActionForm and I want to use File upload to upload a local file to my struts action class. Is this possible? Everything I have seen uses hardcoded forms. Here is my dynavalidatoraction form: and jsp code: Here is how I try to get the file out of the form: FormFile thefile= (FormFile)dynaActionForm.get("thefile"); logger.log(Level.SEVERE, "thefile "+thefile); And stack trace: Could not invoke the service() method on servlet action. Exception thrown : javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254) at org.apache.struts.action.RequestProcessor.processPopulate( RequestProcessor.java:821) at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code)) at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service( ServletWrapper.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest( ServletWrapper.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest (CacheServletWrapper.java(Compiled Code)) at com.ibm.ws.webcontainer.WebContainer.handleRequest( WebContainer.java(Compiled Code)) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready( WCChannelLink.java(Compiled Code)) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination( HttpInboundLink.java(Compiled Code)) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation( HttpInboundLink.java(Compiled Code)) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete (HttpICLReadCallback.java(Compiled Code)) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete( WorkQueueManager.java(Compiled Code)) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO( WorkQueueManager.java(Compiled Code)) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun( WorkQueueManager.java(Compiled Code)) at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run( WorkQueueManager.java(Compiled Code)) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code)) Begin backtrace for Nested Throwables org.apache.commons.beanutils.ConversionException: Cannot assign value of type 'java.lang.String' to property 'thefile' of type ' org.apache.struts.upload.FormFile' at org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:423) at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(Propert
Re: Cannot find bean in any scope
If I forward to the jsp via an action, how do I make it so when the jsp refreshes it hits the action? On 6/7/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > On 6/7/05, Daniel Kies <[EMAIL PROTECTED]> wrote: > > Greetings. Here is my problem: > > index.jsp does a redirect to my action. > > action loads a bean with data > > forwards to x.jsp > > > > x.jsp looks fine, data comes up fine. > > > > I do a refresh. I get Cannot find bean in any scope. The first time > > i have data with no problems because the action class loads the > > request with the bean w\data. > > > > The second time the bean is not in the request since i am calling the > > jsp directly (through the refresh). > > Do you redirect or forward to x.jsp? If you redirect, you lose beans > with scope less than session. > > > Question: > > 1) What is a simple way to fix this? > > Either store bean in session, or forward to jsp through action. Thus, > you actually would be reloading action. > > > 2) I thought the request kept the data in it for a refresh. Is this wrong? > > yep, this is wrong. > > Michael. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot find bean in any scope
Greetings. Here is my problem: index.jsp does a redirect to my action. action loads a bean with data forwards to x.jsp x.jsp looks fine, data comes up fine. I do a refresh. I get Cannot find bean in any scope. The first time i have data with no problems because the action class loads the request with the bean w\data. The second time the bean is not in the request since i am calling the jsp directly (through the refresh). Question: 1) What is a simple way to fix this? 2) I thought the request kept the data in it for a refresh. Is this wrong? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot find global ActionForward for name
Greetings. I am getting this error on an App and I can't seem to find out why. Any suggestions? Struts-Config: Index.jsp: <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> Result: Error 500: Cannot find global ActionForward for name start - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multi Lingual Spell Checking
Has anyone ever implemented a spell checker of any sorts that would check the spelling of text in a text box either upon submitting a form or on the html page? If you have ever gone down this path, any help is appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Radio Button Default Values
Worked great, thank you very much. On Mon, 14 Feb 2005 11:45:00 -0700, Wendy Smoak <[EMAIL PROTECTED]> wrote: > From: "Daniel Kies" <[EMAIL PROTECTED]> > > and struts config for this dynaactionform is > > > > > > > > I just can't figure out how to get UPS as the default radio button > > selected. Any suggestions? > > Did you try using the 'initial' attribute of the tag? > Example: >type="java.lang.String" > initial="N"/> > > -- > Wendy Smoak > > - > 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]
Radio Button Default Values
I am trying to configure a default value for a radio button as done by Ted Husted on - http://www.jguru.com/faq/view.jsp?EID=1028442 My action has: ArrayList shippers = new ArrayList(); shippers.add(new LabelValueBean("UPS", "UPS")); shippers.add(new LabelValueBean("Federal Express", "FEDX")); shippers.add(new LabelValueBean("AirBorne", "AIRB")); request.setAttribute ("SHIPPERS",shippers); request.setAttribute ("expectedVia","UPS"); and struts config for this dynaactionform is and in the jsp: I just can't figure out how to get UPS as the default radio button selected. Any suggestions? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Post-Back help
I was able to fix the problem that I was having by changing my input for the action from the jsp that was being used to the action mapping. That way when the validation fails, it kicks back to the original mapping and runs through that action populating the necessary beans. That way I don't need to keep anything in session. Thanks for the help. On Fri, 31 Dec 2004 01:54:48 -, Cliff <[EMAIL PROTECTED]> wrote: > > I have faced this problem too. > > I tried to get back the previous form from the session and combine > all the field that you need. This logic will happen when validator > is finding an error and it do dynamically. So That is suitable for > all the cases in the App. > > The logic I'm using is simple. It is just cover all the null fields > from previous form which is saved in session. > > Cliff > > --- In [EMAIL PROTECTED], Daniel Kies <[EMAIL PROTECTED]> wrote: > > Greetings. I am using the Validation Framework and I am having > > problems when the validator is finding an error. When the post- > back > > kicks back to the input page, it is not finding the data that was > > previously found in the request. In order for the data to be > > available when kicked back to the calling jsp, I have to put the > data > > in the session instead of the request in the initial action. > > > > My question is this: > > What do I have to do to keep the data available in the request when > > the validator is called and errors are raised? I don't want to > have > > to put everything in the session just for validation purposes. > > > > Thanks in advance. > > > > --- > -- > > 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: Validation Post-Back help
1) In my action class I put a list (statusList) into the request. 2) In the associated JSP, I read through the bean (statusList) and display the data in a drop down box (the way you suggested): 3) When I go to validate(with the framework), and fail, I get Posted back to the inputting .jsp, but when I do, my List, statusList, is no longer there. Is there a way I can configure the call so that it keeps it in the request? Do I have to add it again to the request in the jsp? My struts config has the statusList in the form used typed by a List. I have the feeling I am just mossing something simple here to get the data back in the request. Thanks. On Thu, 30 Dec 2004 14:00:30 -0700, Wendy Smoak <[EMAIL PROTECTED]> wrote: > From: "Daniel Kies" <[EMAIL PROTECTED]> > > in JSP to show the list in a drop down: > > > > > > > property="statusType"/>"> > property="statusType" /> > > > > > > Why are you not using the and (or > ) tags? You don't have to iterate over the > collection, the framework will do it for you. > > Example: > > labelProperty="value"/> > > (contactTypes is a Map sitting in Application scope, but it'll work with > other Collections in other scopes.) > > Is your problem is that you are setting the values back into the form but > they are not getting 'pre-selected' by Struts? (You need to use the Struts > tags for that to happen.) > > Or is your question _how_ to set the values in the dynamic form bean? > Should be... > ( (DynaActionForm) form ).set( "fieldName", myList ); > > Post some of the code that's giving you trouble so we can see what you're > doing instead of guessing. > > -- > Wendy Smoak > > - > 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 Post-Back help
Wendy - I don't want to use the session for storage because of scalability and memory constraints. I have read and understand the point that as long as I have the field defined in the DynaActionForm that the data will be in the request when I need it after validation fails. -How do you get a list into a list specified in the form bean? Example: in JSP to show the list in a drop down: "> **So what do I need to do to put this data back in the request so it shows up if the validation fails? I can figure it out for the other fields, just not the list. Thanks for any help. On Thu, 30 Dec 2004 10:54:12 -0700, Wendy Smoak <[EMAIL PROTECTED]> wrote: > From: "Daniel Kies" <[EMAIL PROTECTED]> > > Can you offer a decent way of > > searching through the archives? > > I like http://www.mail-archive.com. Put 'struts' in the box on the first > page, then choose the user list. > > Why are you dismissing session scope? > > -- > Wendy Smoak > > - > 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 Post-Back help
Can you suggest a good way of doing this? There 36,000 threads by subject, starting with ", Author, Date and Thread. I do not personally archive or save all these emails. I have researched through google and looked around a bunch but couldn't find what I needed. I have also looked through several books and come up short, so I am now asking on this list. Can you offer a decent way of searching through the archives? On Thu, 30 Dec 2004 10:00:22 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > This has been asked multiple times on the list and heavily discussed. check > the list archives for details. > > > > -----Original Message- > > From: Daniel Kies [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 30, 2004 9:55 AM > > To: user@struts.apache.org > > Subject: Validation Post-Back help > > > > > > Greetings. I am using the Validation Framework and I am having > > problems when the validator is finding an error. When the post-back > > kicks back to the input page, it is not finding the data that was > > previously found in the request. In order for the data to be > > available when kicked back to the calling jsp, I have to put the data > > in the session instead of the request in the initial action. > > > > My question is this: > > What do I have to do to keep the data available in the request when > > the validator is called and errors are raised? I don't want to have > > to put everything in the session just for validation purposes. > > > > Thanks in advance. > > > > - > > 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]
Validation Post-Back help
Greetings. I am using the Validation Framework and I am having problems when the validator is finding an error. When the post-back kicks back to the input page, it is not finding the data that was previously found in the request. In order for the data to be available when kicked back to the calling jsp, I have to put the data in the session instead of the request in the initial action. My question is this: What do I have to do to keep the data available in the request when the validator is called and errors are raised? I don't want to have to put everything in the session just for validation purposes. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]