Re: dojo 1.1 in struts 2.0.11 portlets
tom tom wrote: Thanks Jeromy, Is there any reason why YUI datagrid instead of dojo 1.1 grid, Isn't it risky to depend on YUI datagrid, Thanks Moving to YUI datagrid is no riskier than moving to Dojo 1.1. They're both good libraries. Dojo 1.1 is very different than 0.4 but not as different as YUI. Each use different programming models and approaches (as do the other libraries I referenced) so choose one that you're comfortable or productive with. In fact, the very first thing I did with YUI was create a small test action with an ajax datagrid. Anyway watch this video tutorial about the DojoX datagrid: http://dojocampus.org/content/2008/02/17/dojox-grid/ Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to stop ArrayIndexOutOfBoundsException from being thrown when using DynaActionForm
I'm using struts 1.2.7 struts-config.xml === When the number of choices in the jsp page exceed the size it's throwing ArrayIndexOutOfBoundsException. Please explain in detail how to stop it from being thrown.
Re: dojo 1.1 in struts 2.0.11 portlets
Thanks Jeromy, Is there any reason why YUI datagrid instead of dojo 1.1 grid, Isn't it risky to depend on YUI datagrid, Thanks --- Jeromy Evans <[EMAIL PROTECTED]> wrote: > tom tom wrote: > > Thanks Jeromy, > > > > If we use direct dojo calls (dojo 1.1) without > using > > struts ajax tags, Will there be any issues linking > > these components with server side Struts Action > and > > form classes, > > > > e.g if I have a dojo 1.1 Grib will I be able to > > utilize the serverside struts action classes, are > > there any best practice for this. > > > > My first objective is to have dojo Grid inside a > jsp, > > with CRUD/sorting and pagination > > > > And > > > > Link this Grid with the Struts 2 Action classes, > > > > Is there any practices to follow to achieve, is > this > > doable > > > > Thanks > > > > > > Hi haven't used Dojo's grid myself so I can only > speculate on a suitable > approach, but I do use the YUI datagrid with a json > datasource and all > the features you described. > Struts2 actions are actually very good at this. > Create an action that > will be the datasource for the grid (on for the > page; for the grid). I > use the action to setup a bean that matches the > model used by grid, and > then use the JSON plugin result or REST plugin to > serialize the bean as > JSON or XML. I created a factory that could create > an appropriate table > model from a collection of beans. If you make it > match exactly what > dojo expects then there'll be very little work to do > on the client-side. > If you make the model generic you can reuse it for > all your different > grids; this is the kind of thing that does belong in > a dojo plugin. > regards, > Jeromy Evans > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dojo 1.1 in struts 2.0.11 portlets
tom tom wrote: Thanks Jeromy, If we use direct dojo calls (dojo 1.1) without using struts ajax tags, Will there be any issues linking these components with server side Struts Action and form classes, e.g if I have a dojo 1.1 Grib will I be able to utilize the serverside struts action classes, are there any best practice for this. My first objective is to have dojo Grid inside a jsp, with CRUD/sorting and pagination And Link this Grid with the Struts 2 Action classes, Is there any practices to follow to achieve, is this doable Thanks Hi haven't used Dojo's grid myself so I can only speculate on a suitable approach, but I do use the YUI datagrid with a json datasource and all the features you described. Struts2 actions are actually very good at this. Create an action that will be the datasource for the grid (on for the page; for the grid). I use the action to setup a bean that matches the model used by grid, and then use the JSON plugin result or REST plugin to serialize the bean as JSON or XML. I created a factory that could create an appropriate table model from a collection of beans. If you make it match exactly what dojo expects then there'll be very little work to do on the client-side. If you make the model generic you can reuse it for all your different grids; this is the kind of thing that does belong in a dojo plugin. regards, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Grid working with Stuts2 Serverside
Hi, Has anyone got any editable grid e.g dojo 1.1 (supports CRUD) working with server side Struts2 action classes. or any other grid working with struts2, If so, will it be possible to share some samples, We are in the process of finding a intelligent AJAX based DATA grid working with struts2 Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: howto have a readonly on ?
is just an , not a text field and a browse button. There is no browser-independent way to control one part and not the other. You may need to use a file upload library widget instead. Through browser detection they can obscure the text input so user's don't know it's there and can't tab to it, then add another read only text input that's populated via javascript. The technique is different for each browser so just use find a library to use. There isn't one included with Struts 2. The readonly attribute of s:file is just the readonly attribute of all html input tags that makes the input readonly as opposed to disabled. I'm not sure it's even applied. xianwinwin wrote: I wonder what is the "readonly" for I wish the user to specify the path only with the Browse button but will not be able to change the path on field. In other words, once the user has specified the path (by the browse) he will not be able to change it directly from the textfield as in make changes (s:file has a textfield) I checked the properties of file on: http://struts.apache.org/2.x/docs/file.html but didn't see any readonly. does anyone know what will work for this case? thank you! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tree Component
Mississippi John Hurt wrote: Anyone know of a Tree component that can be used where the web framework is not Struts nor JSF? We aren't using either framework but would like to use a tree component. Any suggestions? Thanks. Tree's are a client-library feature that can be used independently of the selected server-side framework. Modern client-side frameworks allow the tree to be built from json, xml, html markup or programatically. Choose your preferred client-side library: http://developer.yahoo.com/yui/treeview/ http://dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/advanced-editing-and-display/tree http://docs.jquery.com/UI/Tree http://code.google.com/p/mootools-ui/wiki/TreeWidget http://script.aculo.us/playground/test/functional/sortable_tree_test.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts2 migration
kal stevens wrote: My company has migrated from struts1 to struts2, and we have had a few continual problems that we can not figure out how to deal with. First when we redeploy our application we have to remove everything in the work/Catalina directory, or the application may not be redeployed correctly. we have tried both a symbolic link from the webapps directory to a war file, and from the webapps directory to an exploded directory. Can someone point me to any information on how to fix this? or what might be causing the issue. Struts2 leaves some threadlocals active that prevent it from shutting down cleanly. There is no fix in 2.0.11.x. There is a fix in 2.1.x. https://issues.apache.org/struts/browse/WW-2167 If there is a 2.0.12 release I'd vote for this 'fix' to be applied. Another issue is that when someone types in a bogus url we get an entry in the log4j logging So if someone types in www.example.com/member/visitors.do we get 2008-05-05 17:23:31,898 ERROR [Dispatcher] Could not find action or result There is no Action mapped for namespace /member and action name visitors. - [unknown location] Is there a recommended way of dealing with this? Change the setting for log4j. Set the logging level for org.apache.struts2.dispatcher.Dispatcher to none. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts2 migration
My company has migrated from struts1 to struts2, and we have had a few continual problems that we can not figure out how to deal with. First when we redeploy our application we have to remove everything in the work/Catalina directory, or the application may not be redeployed correctly. we have tried both a symbolic link from the webapps directory to a war file, and from the webapps directory to an exploded directory. Can someone point me to any information on how to fix this? or what might be causing the issue. Another issue is that when someone types in a bogus url we get an entry in the log4j logging So if someone types in www.example.com/member/visitors.do we get 2008-05-05 17:23:31,898 ERROR [Dispatcher] Could not find action or result There is no Action mapped for namespace /member and action name visitors. - [unknown location] Is there a recommended way of dealing with this? My boss wants no errors in the logfile. Kal
howto have a readonly on ?
I wonder what is the "readonly" for I wish the user to specify the path only with the Browse button but will not be able to change the path on field. In other words, once the user has specified the path (by the browse) he will not be able to change it directly from the textfield as in make changes (s:file has a textfield) I checked the properties of file on: http://struts.apache.org/2.x/docs/file.html but didn't see any readonly. does anyone know what will work for this case? thank you! -- View this message in context: http://www.nabble.com/howto-have-a-readonly-on-%3Cs%3Afile...%3Etp17071484p17071484.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 1 - using POI and FormFile to read an excel file
Hello, I am currently using Struts 1 - FormFile to uplaod various documents. Now I have a requirement to read an excel file as the user uploads it. For this I am using Apache POI. this is how poi reads an excel sheet InputStream myxls = new FileInputStream("workbook.xls")); HSSFWorkbook wb = new HSSFWorkbook(myxls); Does someone know a way so that I can give the FormFile object to the HSSFWorkBook Constructor? Basically I will be getting the uploaded excel file from the user as userObject.getUploadedFile() //which returns a FormFile object. Thanks for any help!! -bhaarat
Re: [Struts2] Exception starting filter (Connection Timed Out)
The Spring context listener is needed only if you do use Spring. If you do not, then this might be causing the error as Tomcat was unable to find the Spring classes. Try removing this: org.springframework.web.context.ContextLoaderListener org.springframework.web.context.request.RequestContextListener Pierre Thibaudeau-4 wrote: > > Just moving from Struts1 to Struts2.0.11. > > No problem on Tomcat 6.0.16. > However, I get the following exception on startup with Tomcat 6.0.14. > > Does anyone know a way round this? > (I've included excerpts from web.xml further down.) > > -- View this message in context: http://www.nabble.com/-Struts2--Exception-starting-filter-%28Connection-Timed-Out%29-tp16953438p17071258.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2: Action chaining behaving differently when validations fire
I just re-read my post and noticed that the Struts configuration for the testB action somehow got mangled. The correct configuration for TestB is testA display -- View this message in context: http://www.nabble.com/Struts-2%3A-Action-chaining-behaving-differently-when-validations-fire-tp17065631p17070480.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: S2 - email client as action result
Thanks a lot for the suggestions. I ended up with an updated version of option 1. I played with options 1 and 2. Option 2 is very simple with http redirect. However, it leaves a blank window that I cannot close. For option 1, I cannot get window.location="mailto:..."; to work. I had to use window.open("mailto:...";); So that leaves two blank windows. But I can close them with javascript. -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Sunday, May 04, 2008 10:47 PM To: Struts Users Mailing List Subject: Re: S2 - email client as action result Jiang, Jane (NIH/NCI) [C] wrote: > I have a S2 action that looks up email address in the database. It > needs to open up an email client as the result with the address > populated (as if clicked on > mailto:[EMAIL PROTECTED]). > > What is the best way to set up the s2 result? > > Many thanks for your help, > > Jane > > > There's little you can do from within an action to request the client to launch a mail application. Here are some things to try, in order of likelihood of them working. 1. You could try return a page that contains javascript that attempts to open a mail program via the mailto: url. window.location="mailto:...";. If you're along targeting IE you could use activex. 2. Perhaps you return a "redirect" result that redirects to "mailto:[EMAIL PROTECTED]". I doubt that all browsers would accept that. 3. Perhaps you could return an email content type (eg. a .eml file). I doubt that all browsers would accept that. - 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]
Tree Component
Anyone know of a Tree component that can be used where the web framework is not Struts nor JSF? We aren't using either framework but would like to use a tree component. Any suggestions? Thanks.
Re: Struts 1 "plugin" equivalent...
JeanNiBee wrote: > > Hi > > Is this available 'out of the box' for a standard Struts 2 running on say > Tomcat 5.5 / Jetty 6+. Unfortunately these are the limiting factors of the > environment I'm working in. > > Thanks. > Answering my own question. This available and usable in Jetty 6 with no additional downloads. Thanks -- View this message in context: http://www.nabble.com/Struts-1-%22plugin%22-equivalent...-tp17066694p17067035.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1 "plugin" equivalent...
Wendy Smoak-3 wrote: > > It's not Struts-specific-- consider using a ServletContextListener for > this. > > http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContextListener.html > > -- > Wendy > Hi Is this available 'out of the box' for a standard Struts 2 running on say Tomcat 5.5 / Jetty 6+. Unfortunately these are the limiting factors of the environment I'm working in. Thanks. -- View this message in context: http://www.nabble.com/Struts-1-%22plugin%22-equivalent...-tp17066694p17066895.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1 "plugin" equivalent...
On Mon, May 5, 2008 at 10:24 AM, JeanNiBee <[EMAIL PROTECTED]> wrote: > New to Struts 2 and just trying to make the changes. In Struts 1 we had a > plug in mechanism that would be executed when the application started up. > This was a good place to configure pools and log files and such. What does > Struts 2 has to handle this same feature. It's not Struts-specific-- consider using a ServletContextListener for this. http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContextListener.html -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 1 "plugin" equivalent...
Hi New to Struts 2 and just trying to make the changes. In Struts 1 we had a plug in mechanism that would be executed when the application started up. This was a good place to configure pools and log files and such. What does Struts 2 has to handle this same feature. Thanks. P.S. I realize that plug in in the Struts 1 sense may not be the same as in the Struts 2 sense, but I'm mainly trying to setup and initialize resources on application start up. thanks. -- View this message in context: http://www.nabble.com/Struts-1-%22plugin%22-equivalent...-tp17066694p17066694.html Sent from the Struts - User mailing list archive at Nabble.com.
Struts 2: Action chaining behaving differently when validations fire
All, I’m experiencing some interesting behavior when forwarding via action chaining as a result of input validation. In a non-error situation, action chaining works as expected – that is the service method of the chained action is invoked as expected. However, what I am noticing is that when a validation error fires, the service method of the chained action is bypassed entirely – instead the request is forwarded to the result defined in the struts mapping of the action class. To test this, I created two simple classes, testA and testB. testA is used to build the data to display a page and testB is used to collect the data from the page. The Struts configuration is the following (Spring is being used as the object factory): testA.jsp testA display The display method of testA always returns INPUT. The submit method of B always returns INPUT. This allows me to test the same result of INPUT – one invoked via an input validation error and the second during normal application flow. When testB is invoked and no validation errors fire (INPUT is returned from the service method), I see the following methods invoked on the back-end: TestB.submit TestA.display However, when testB is invoked and validation errors fire, TestA.display is not invoked. Instead, the input mapping is read and the request is forwarded to testA.jsp per the mapping. Ideally, I’d like the testA action to fire when validation fires. Eric Getchell | Sr. Technologist Distributed Logic Corporation 600 Unicorn Park Woburn, MA 01801 -- View this message in context: http://www.nabble.com/Struts-2%3A-Action-chaining-behaving-differently-when-validations-fire-tp17065631p17065631.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2 Losing Session in interceptor
If the session is expired, adding the messages to it won't help much. Why don't you forward to the login page, instead of redirecting, and put those messages in the request context? musachy On Mon, May 5, 2008 at 11:09 AM, JRD <[EMAIL PROTECTED]> wrote: > > Hey there, I have built an interceptor to store and retrieve ActionErrors > using the session for redirect-action results. The weird thing is I seem to > lose the values the first time it is run through. > > private static final String KEY="org.etc..."; > > public String intercept(ActionInvocation actionInvocation) throws Exception > { > ActionContext actionContext = actionInvocation.getInvocationContext(); > Map session = actionContext.getSession(); > > if (session.containsKey(KEY)) { > Collection actionErrors = (Collection) session.remove(KEY); > if (actionInvocation.getAction() instanceof ValidationAware) { > ((ValidationAware) > actionInvocation.getAction()).setActionErrors(actionErrors); > } > } > > String result = actionInvocation.invoke(); > > if (actionInvocation.getResult() instanceof ServletActionRedirectResult > && actionInvocation.getAction() instanceof ValidationAware) { > if (action.hasActionErrors()) { > session.put(KEY, action.getActionErrors()); > } > } > > return result; > } > > So say I have an invalid session (or timeout). I catch the exception and > then chain to an action that will build the error message and redirect back > to the login page. When I step through the interceptor it will be fired > twice. The first time it is being fired by the action that built the error > message. Everything looks ok and it adds the action errors to the session. > The second time is for the action that displays the login page but when that > interceptor is fired, the session that is returned is empty. > > This only happens the first time I do this, if I continue to throw > exceptions everything works as I had expected. > > All help is appreciated, > Jonathan > -- > View this message in context: > http://www.nabble.com/S2-Losing-Session-in-interceptor-tp17063809p17063809.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2 Losing Session in interceptor
Hey there, I have built an interceptor to store and retrieve ActionErrors using the session for redirect-action results. The weird thing is I seem to lose the values the first time it is run through. private static final String KEY="org.etc..."; public String intercept(ActionInvocation actionInvocation) throws Exception { ActionContext actionContext = actionInvocation.getInvocationContext(); Map session = actionContext.getSession(); if (session.containsKey(KEY)) { Collection actionErrors = (Collection) session.remove(KEY); if (actionInvocation.getAction() instanceof ValidationAware) { ((ValidationAware) actionInvocation.getAction()).setActionErrors(actionErrors); } } String result = actionInvocation.invoke(); if (actionInvocation.getResult() instanceof ServletActionRedirectResult && actionInvocation.getAction() instanceof ValidationAware) { if (action.hasActionErrors()) { session.put(KEY, action.getActionErrors()); } } return result; } So say I have an invalid session (or timeout). I catch the exception and then chain to an action that will build the error message and redirect back to the login page. When I step through the interceptor it will be fired twice. The first time it is being fired by the action that built the error message. Everything looks ok and it adds the action errors to the session. The second time is for the action that displays the login page but when that interceptor is fired, the session that is returned is empty. This only happens the first time I do this, if I continue to throw exceptions everything works as I had expected. All help is appreciated, Jonathan -- View this message in context: http://www.nabble.com/S2-Losing-Session-in-interceptor-tp17063809p17063809.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get dynamic number of arguments into ActionForm
I accomplished this without using the DynaActionForm. Its somewhat a crude way but it works. When stuck with constraints what is one to do? Here is an example, in the JSP I have coded the form element: Once rendered in the HTML: In the form bean: private List beneficiaries = new ArrayList(); public BeneficiaryVO getBeneficiaries(int index) { while (index >= beneficiaries.size()) { beneficiaries.add(new BeneficiaryVO()); } return (BeneficiaryVO) beneficiaries.get(index); } HTH, Glenn
Re: Plz help not getting o/p when changed to validator form
Did you restart the application? I believe that config file gets loaded at startup. - Glenn On Mon, May 5, 2008 at 10:25 AM, Raghu varma bhupathiraju < [EMAIL PROTECTED]> wrote: > > Hi I have the following application done successfully with out validation > > HomePage.jsp > // > <%@ taglib uri="/tags/struts-bean" prefix="bean" %> > <%@ taglib uri="/tags/struts-html" prefix="html" %> > <%@ taglib uri="/tags/struts-logic" prefix="logic" %> > > <[EMAIL PROTECTED] import="java.sql.*"%> > > > function set(){ > > var count=document.forms[0].status.length; > > document.forms[0].avalues.value=""; > > for(var i=0;iif(document.forms[0].status[i].checked==true){ > document.forms[0].status[i].value="checked"; > }else{ > document.forms[0].status[i].value="ignore"; > } > > > > document.forms[0].avalues.value+=document.forms[0].status[i].value+" "; > > } > > > } > > > > > > > > <%!Connection con=null; > Statement stmt=null; > ResultSet rs=null;%> > <% try{ > Class.forName("com.mysql.jdbc.Driver"); > Connection > > con=DriverManager.getConnection("jdbc:mysql://localhost:3306/raghu","root","root"); > stmt=con.createStatement(); > String str="select uname from users"; > rs=stmt.executeQuery(str); > } > catch(Exception ex){ > ex.printStackTrace(); > } > %> > > > > > > > > /> > > select > Delete > > > > > > <% if(rs!=null){ > while(rs.next()){%> > > value="unchecked"/> > ><%=rs.getString(1)%> > <%}}else{}%> > > > > > > > / > Config file > > > > "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" > "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >name="inputForm" > >type="com.bob.StrutsTask.TaskForm"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >path="/process" name="inputForm" > >type="com.bob.StrutsTask.StrutsAction" parameter="parameter" > >input="/pages/HomePage.jsp" > > > > > >path="/process2" name="inputForm" > >type="com.bob.StrutsTask.StrutsAction" parameter="parameter" > >input="/pages/add.jsp" > > > > path="/process3" name="inputForm" > >type="com.bob.StrutsTask.UserAction" > >input="/pages/HomePage.jsp"> > > > > > > > > > > > > > > > processorClass="org.apache.struts.tiles.TilesRequestProcessor"/> > > > > > > > > > > > > > > > > > > > > > > > > value="/WEB-INF/tiles-defs.xml" /> > > > > > > > >property="pathnames" >value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > > > > TaskForm.java > package com.bob.StrutsTask; > > > import org.apache.struts.action.ActionForm; > > > public class TaskForm extends ActionForm{ >String parameter=""; >String action=""; >String uname=""; >String password=""; > String repassword=""; >String role=""; >String fname=""; >String lname=""; >String company=""; >String email=""; >String phone=""; >String baddress=""; >String saddress=""; >String bcity=""; >String scity=""; >String bstate=""; >String sstate=""; >String bzip=""; >String szip=""; >String bcountry=""; >String scountry=""; >String status[]; >String user=""; >String avalues=""; >public String getAction() { >return action; >} >public void setAction(String action) { >this.action = action; >} > >public String getCompany() { >return company; >} >public void setCompany(String company) { >this.company = company; >} >public String getEmail() { >return email; >} >public void setEmail(String email) { >this.email = email; >} >public String getFname() { >return fname; >} >public void setFname(String fname) { >this.fname = fname; >} >public String getLname() { >return lname; >} >public void setLname(String lname) { >this.lname = lname; >} >public String getParameter() { >return parameter; >} >public void setParameter(String parameter) { >this.parameter = parameter; >} >public String getPassword() { >return password; >} >public void setPassword(String password) { >this.password = p
Message arguments with v1.2.7
Hi, Using v1.2.7 of struts is there any way to determine if a message obtained from the resource file has any arguments? Example: This message has {0} of {1} arguments. I'd like to know that this message has 2 arguments. Many thanks, Glenn
Plz help not getting o/p when changed to validator form
Hi I have the following application done successfully with out validation HomePage.jsp // <%@ taglib uri="/tags/struts-bean" prefix="bean" %> <%@ taglib uri="/tags/struts-html" prefix="html" %> <%@ taglib uri="/tags/struts-logic" prefix="logic" %> <[EMAIL PROTECTED] import="java.sql.*"%> function set(){ var count=document.forms[0].status.length; document.forms[0].avalues.value=""; for(var i=0;i<% try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/raghu","root","root"); stmt=con.createStatement(); String str="select uname from users"; rs=stmt.executeQuery(str); } catch(Exception ex){ ex.printStackTrace(); } %> select Delete <% if(rs!=null){ while(rs.next()){%> <%=rs.getString(1)%> <%}}else{}%> / Config file http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";> TaskForm.java package com.bob.StrutsTask; import org.apache.struts.action.ActionForm; public class TaskForm extends ActionForm{ String parameter=""; String action=""; String uname=""; String password=""; String repassword=""; String role=""; String fname=""; String lname=""; String company=""; String email=""; String phone=""; String baddress=""; String saddress=""; String bcity=""; String scity=""; String bstate=""; String sstate=""; String bzip=""; String szip=""; String bcountry=""; String scountry=""; String status[]; String user=""; String avalues=""; public String getAction() { return action; } public void setAction(String action) { this.action = action; } public String getCompany() { return company; } public void setCompany(String company) { this.company = company; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFname() { return fname; } public void setFname(String fname) { this.fname = fname; } public String getLname() { return lname; } public void setLname(String lname) { this.lname = lname; } public String getParameter() { return parameter; } public void setParameter(String parameter) { this.parameter = parameter; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getRole() { return role; } public void setRole(String role) { this.role = role; } public String getUname() { return uname; } public void setUname(String uname) { this.uname = uname; } public String getBaddress() { return baddress; } public void setBaddress(String address) { baddress = address; } public String getBcity() { return bcity; } public void setBcity(String bcity) { this.bcity = bcity; } public String getBcountry() { return bcountry; } public void setBcountry(String bcountry) { this.bcountry = bcountry; } public String getBstate() { return bstate; } public void setBstate(String bstate) { this.bstate = bstate; } public String getBzip() { return bzip; } public void setBzip(String bzip) { this.bzip = bzip;
Re: How to get dynamic number of arguments into ActionForm
First thing is I can't use Struts 2.0. I think you didn't understand my problem. So i'm giving all the details from struts-config.xml file onwards... struts-config.xml pollsForm.jsp == If i use the above form the choices that are entered by user are recived in the ActionForm as follows: MultipleFormAction.java --- execute() === DynaActionForm dynaForm = (DynaActionForm)form; String[] choices = (String[]) dynaForm.get("choices"); System.out.println(""); for(int i=0;i"+choices[i]+""); } System.out.println(""); But if it use the choices fields in array form i.e., pollsForm.jsp == If i follow the above procedure i'm getting ArrayIndexOutOfBoundsException. I tried setting size attribute in element. But When that size exceeds i'm getting the same exception. So what i want is to add dynamic number of choce-fields in the above html-array type form and get them into my ActionForm object. Please friends help!!! On Mon, May 5, 2008 at 6:30 AM, Martin Gainty <[EMAIL PROTECTED]> wrote: > Why not use Autocompleter? > > When used on the "simple" theme, the autocompleter can be used like the > ComboBox. > When used on the "ajax" theme, the list can be retieved from an action. > > > http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/components/Autocompleter.html > - Original Message - From: "Mead Lai" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Sent: Sunday, May 04, 2008 8:43 PM > Subject: Re: How to get dynamic number of arguments into ActionForm > > > > List type >> >> On Sun, May 4, 2008 at 7:51 PM, venkat reddy <[EMAIL PROTECTED]> >> wrote: >> >>> I'm using struts 1.2.7 >>> >>> I've a poll-posting-form in adminstrator section of my application. >>> format >>> of the form is as follows. >>> >>> pollsubject: String >>> lastDate:String >>> choice1:String >>> choice2:String >>> . >>> . >>> . >>> Add another option >>> >>> As you can see here, the number of choices are dynamic and i want to add >>> a >>> link to give the administrator another choice field. >>> >>> Now, how can i get these dynamic fields into my ActionForm and what type >>> of >>> object should i declare in tag. explain in detail plz >>> >>> >> - >> 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: Redirect-Action type result warns of caught exception when passing param
Hello Brad, Excellent! Precise and clear. Regards, Kety. Brad A Cupit wrote: > >> I'm of the opinion that an exception in my >> console means something is amiss though... > > you've stumbled upon a little wart in the code. First things first, the > exception is harmless and can be safely ignored. > > A more detailed explanation can be found in a comment within > ObjectFactory.buildResult(..), posted below (slightly reformatted): > > // ognl exceptions could be thrown and be ok if, for example, the result > // uses parameters in ways other than as properties for the result > object. > // For example, the redirect result from Struts 2 allows any parameters > // to be set on the result, which it appends to the redirecting url. > // These parameters wouldn't have a corresponding setter on the result > // object, so an OGNL exception could be thrown. Still, this is a > misuse > // of exceptions, so we should look at improving it. > > Basically, parameters for the result are first set via setters on the > Result object itself. If they don't exist, an exception is thrown and > ignored. ServletRedirectResult and ServletActionRedirectResult both use > params to mean "query string/url parameters" as opposed to properties on > the Result object, so when using params on ServletRedirectResult or > ServletActionRedirectResult, the exception is expected and acceptable. > > Brad Cupit > Louisiana State University - UIS > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Redirect-Action-type-result-warns-of-caught-exception-when-passing-param-tp16987947p17061225.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to confirm eclipse wtp contain struts 2.x?
Hi all. I have released an eclipse plugin for struts2, available here: http://mvcwebproject.sourceforge.net/ It is not just a plugin for struts 2: it may be used as a basis to develop plugins for other MVC frameworks, but it is currently working for Struts2 only. It is still far not complete, but it may help... I'm still working on it, and I hope I will release a new version in a few days (or months...). Anyway, any comment will be appreciated ;) . Sylvain. Piero Sartini-3 wrote: > >> yes, I did go to the site. but, i'm not sure on how to make it as a >> plugin to deploy in eclipse 3.3. > > There is no plugin for Eclipse or any other IDE that I know. There is the > beginning of a NetBeans plugin... but I did not look at it yet. > >> i did downloaded the war file and import into eclipse 3.3, it 's working >> fine. is it every project I just need to copy 5 files to Web App >> Libraries, >> commons-logging-1.0.4.jar >> freemarker=2.3.8.jar >> ognl-2.6.11.jar >> struts2-core-2.0.11.jar >> xwork-2.0.4.jar >> ? > > These and any struts2 plugins you want to use. The "Blank" Application is > a > good starting point for own applications. > > If you do use maven2, there is an easier way: > mvn archetype:create -DgroupId=org.yoursite \ >-DartifactId=appname \ >-DarchetypeGroupId=org.apache.struts \ >-DarchetypeArtifactId=struts2-archetype-starter \ >-DarchetypeVersion=2.0.11 \ > > -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository > >> then, consider is struts enabled? > > The JARs alone do not enable s2. You need the right entrys in web.xml and > put > the struts configuration file in place. > > > Piero > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/how-to-confirm-eclipse-wtp-contain-struts-2.x--tp16380757p17059848.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question: Freemarker and Tiles?
2008/5/5 Marc Eckart <[EMAIL PROTECTED]>: > Hi, > > we try to use Freemarker with styles but we don't know how :-) > > I found the struts2 showcase > > http://www.planetstruts.org/struts2-showcase/tiles/freemarkerLayout.action > > But I don't know how the tiles.xml should look like for this. > > Can the source be downloaded or checked out from a svn or something like > this. > I haven't found anything yet. Here it is: http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/ Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question: Freemarker and Tiles?
Hi, we try to use Freemarker with styles but we don't know how :-) I found the struts2 showcase http://www.planetstruts.org/struts2-showcase/tiles/freemarkerLayout.action But I don't know how the tiles.xml should look like for this. Can the source be downloaded or checked out from a svn or something like this. I haven't found anything yet. Thanks in advance. Best Regards, Marc
Re: dojo 1.1 in struts 2.0.11 portlets
Thanks Jeromy, If we use direct dojo calls (dojo 1.1) without using struts ajax tags, Will there be any issues linking these components with server side Struts Action and form classes, e.g if I have a dojo 1.1 Grib will I be able to utilize the serverside struts action classes, are there any best practice for this. My first objective is to have dojo Grid inside a jsp, with CRUD/sorting and pagination And Link this Grid with the Struts 2 Action classes, Is there any practices to follow to achieve, is this doable Thanks --- Jeromy Evans <[EMAIL PROTECTED]> wrote: > tom tom wrote: > > Hi, > > > > In order to leverage the full capabilities of dojo > 1.1 > > (latest) with the latest stable struts version. > What > > exactlyt the best practice. > > > > The things we concerned are as followes > > > > 1) Will there be a conflict in the different dojo > > versions in struts 2.0.11 and dojo 1.1 > > > > > Yes, the Struts2 ajax-theme tags will conflict with > Dojo 1.1. Don't use > tue struts2 ajax-themed tags. > > 2) Will it impact any struts tags behaviours etc. > > > > > Yes, definitely as the Struts2 ajax tags are for > Dojo 0.4.x. > > If there is a better way to explore the new > features > > of dojo pls do let us know, or any other best > practice > > > > > Yes, use Dojo 1.1 directly within your JSP. Don't > attempt to use the > Struts 2 ajax tags (dojo 0.4) at the same time as > Dojo 1.1. Juse use > the css/xhtml themed struts tags and dojo's own > markup and widgets. > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]