Re: Security @ Struts2, using Acegy or Inspector
Hi, > so, if I extend this action, the action will query and get security > permission from database.. because i prefer database driven .. You can do this with Acegi and even combine database with LDAP or with something else. I have used such solution in my projects. > but i thinking a interceptor, but new in this area, i prefer a pattern that > filter any action Here you have simple solution how to integrate Acegi with Struts2 http://struts.apache.org/2.x/docs/can-we-use-acegi-security-with-the-framework.html Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xml based validation vs Annotations based validation
Hi, > Wanted to get opinion from the struts2 user community if there are any > advantages/disadvantages of using one approach over another (Xml vs Annotation > based validation). Nope ;-) There is no one good answer for your question, because it depends ;-) For me, the best thing is, you can combine all this two approach together and even more, add method base validation (validate() and validateXXX() ) to this stack. I made some small test app to show such approach, you can download it from here http://jdn.pl/files/test-app_0.zip (the site is in Polish ;-) Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actionerrors & the Store Interceptor
On Wed, Apr 2, 2008 at 11:17 PM, Al Sutton <[EMAIL PROTECTED]> wrote: > Chris, > > I've used the StoreInterceptor and my opinion is that it just isn't > flexible enough to use. > > To illustrate the point, consider try following; > > 1) You have a View Action which displays all of the data of a specific > type, which uses the StoreInterceptor in retrieve in order to show > confirmation messages from an Update action. > > 2) You have an Edit Action which sends the user to edit.jsp via the > dispatcher result type. edit.jsp has a menu taking the user to other places > in the app. > > 3) You have an Update Action which is called by submitting a form on > edit.jsp, this can return the user to edit.jsp using the dispatcher if there > is a problem with the form data, or it can take the user to the View Action > via a redirect if everything is OK. The Update Action uses the > StoreInterceptor in STORE mode in order to send a confirmation back to the > View Action. > > Now, if the user gets to the edit stage submits the form, but has made a > mistake which sends them back to edit.jsp, clicks on the menu to go to > another action they end up seeing the error message twice, once when the get > redirected back to edit.jsp from the UpdateAction, and a second time when > they click on any of the links from the menu on edit.jsp. > > If you want to track the resolution of this, you may want to look at the > JIRA issue I raised about 10 months ago... > https://issues.apache.org/struts/browse/WW-1963 > Yup, that pretty much describes exactly what we're seeing. I think the simplest fix would be to add a parameter to the , and tags, something like remove="true", that when the message has been displayed, it removes it from the list. That way, if the result ends up forwarding rather than redirecting, and the messages get shown and removed, there will be nothing for the store interceptor to store and the messages will be displayed only once. It should be a fairly simple fix and be completely backward compatible with anyone showing the messages multiple times on purpose. Unfortunately I haven't been able to find a good work-around to this and I really don't have the time in my project to not only learn the code well enough to make this change, but then learn maven and enough of the build procedures to integrate it into my project. I would love to hear from ANYONE who has figured a way out of this spiral. Thanks. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actionerrors & the Store Interceptor
Chris, I've used the StoreInterceptor and my opinion is that it just isn't flexible enough to use. To illustrate the point, consider try following; 1) You have a View Action which displays all of the data of a specific type, which uses the StoreInterceptor in retrieve in order to show confirmation messages from an Update action. 2) You have an Edit Action which sends the user to edit.jsp via the dispatcher result type. edit.jsp has a menu taking the user to other places in the app. 3) You have an Update Action which is called by submitting a form on edit.jsp, this can return the user to edit.jsp using the dispatcher if there is a problem with the form data, or it can take the user to the View Action via a redirect if everything is OK. The Update Action uses the StoreInterceptor in STORE mode in order to send a confirmation back to the View Action. Now, if the user gets to the edit stage submits the form, but has made a mistake which sends them back to edit.jsp, clicks on the menu to go to another action they end up seeing the error message twice, once when the get redirected back to edit.jsp from the UpdateAction, and a second time when they click on any of the links from the menu on edit.jsp. If you want to track the resolution of this, you may want to look at the JIRA issue I raised about 10 months ago... https://issues.apache.org/struts/browse/WW-1963 Al. - Original Message - From: "Chris Pratt" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Wednesday, April 02, 2008 10:55 PM Subject: Re: Actionerrors & the Store Interceptor Sorry Lucas, I'm still not seeing how that will help differentiate between which result's need the messages collected and which don't? And I have to agree with Laurie, that I don't understand the difference between the store interceptor and what you're proposing. (*Chris*) On Wed, Apr 2, 2008 at 2:47 PM, Lukasz Lenart <[EMAIL PROTECTED]> wrote: > Umm, that's what the Store Interceptor is. Not exactly, you have to specify for which action store the messages, and for which retrieve them back. There is no magic, everything hand coded ;-) Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - 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: Struts 2.1 TabbedPanel scenario
First of all, thanks for replying. I really appreciate it. Making a single action class will make the classes very bulky and complex. I dont want to have that. I used the remote tabs functionality in tabbed panel but all it does is that it goes into a infinite recursive loop. It adds infinite number of tabs and the page hangs. Maybe its an implementation error. I dont know how to make the dataset common other than make one action class which in my case is certainly achievable but not acceptable. Let me make the scenario a bit more understandable. I am working on a product which generates jsp pages and action classes in struts 2. Lets suppose that the user has built two different jsps and action classes. They work separately perfectly. Now, we are giving him the option to make a tabbed pane by using those two sets of jsps and action classes. One way would be to merge them and make one jsp and one action class. Which in my case is again achievable but very complex and the code will not be readable. The next idea which came to my mind (i dont know if it is achievable or not) is to make one jsp but have two separate action classes. Each tab remotely accessing the dataset of each action class. There is no other idea which is coming to my mind at the moment. So, any other idea will be highly appreciated. The worst thing is that the solution must be generic. :,( Thanks again, Shoaib Ahmad Gauhar Laurie Harper wrote: > > Shoaib Gauhar wrote: >> Hello, >> >> Here is the scenrio. I have two action classes. ClassA and ClassB. There >> is >> no relationship among these classes. You might say that if there is no >> relationship then why i have to put them in one single jsp. Well its a >> client's requirement. > > That's an implementation detail, not a functional requirement. Why does > the client care how you structure your actions? > >> In a single jsp there are two tabs. Tab1ForClassA and Tab2ForClassB. >> >> Each tab has fields concerned to their classes as defined above. Tab1 -> >> ClassA and Tab2 -> ClassB. >> >> Can we do it? I have tried this but what happens is that when i submit >> the >> data on Tab1, Tab2's data becomes empty. > > A request is only processed by one action. If you need both actions to > be able to process all the input from both tabs, you'll have to have > them both aware of the full dataset. There are a number of ways you > might achieve that, depending on what you're trying to achieve. > >> So, any ideas will be highly appreciated. Furthermore, i am quite new to >> tabbed panel and would require clear tips and ideas. > > I haven't used that widget in Struts 2 so can't offer specific tips. > However, if you start by defining the functional requirements (rather > than the implementation details), it'll be easier to offer advice. > > L. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Struts-2.1-TabbedPanel-scenario-tp16446729p16465807.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]
issue
Hi All, I am using Struts 2.0.11 on RAD7, Webspher 6.1, JDK 1.5. I am trying to create radio buttons using a dynamic Map as below: But when I try to load the page, it is giving Freemaker Template exception as below(I haven't pasted entire stack trace for readability) : * FreeMarker template error!* Error on line 31, column 9 in template/simple/radiomap.ftl stack.findString(parameters.listValue) is undefined. It cannot be assigned to itemValue The problematic instruction: -- ==> assignment: itemValue=stack.findString(parameters.listValue) [on line 31, column 9 in template/simple/radiomap.ftl] in user-directive s.iterator [on line 23, column 1 in template/simple/radiomap.ftl] -- Java backtrace for programmers: -- freemarker.core.InvalidReferenceException: Error on line 31, column 9 in template/simple/radiomap.ftl stack.findString(parameters.listValue) is undefined. It cannot be assigned to itemValue at freemarker.core.Assignment.accept(Assignment.java:111) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IfBlock.accept(IfBlock.java:82) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.visit(Environment.java:233) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:116) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:232) at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:168) at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:530) at org.apache.struts2.components.UIBean.end(UIBean.java:484) at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43) at com.ibm._jsp._features_5F_form_5F_content._jspx_meth_s_radio_1(_features_5F_form_5F_content.java:1806) at com.ibm._jsp._features_5F_form_5F_content._jspx_meth_s_if_12(_features_5F_form_5F_content.java:1847) at com.ibm._jsp._features_5F_form_5F_content._jspx_meth_s_iterator_1(_features_5F_form_5F_content.java:1956) at com.ibm._jsp._features_5F_form_5F_content._jspx_meth_s_if_2(_features_5F_form_5F_content.java:1994) at com.ibm._jsp._features_5F_form_5F_content._jspx_meth_s_if_1(_features_5F_form_5F_content.java:2031) at com.ibm._jsp._features_5F_form_5F_content._jspx_meth_s_iterator_0(_features_5F_form_5F_content.java:3493) at com.ibm._jsp._features_5F_form_5F_content._jspService(_features_5F_form_5F_content.java:273) at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) But If I change the value for value attribute in tag to '01' or '02' or something then it works fine and display 1 and 2 instead of '01' and '02' for label. So, is this some bug in in Struts2? What is the solution if I want to dynamically create Map and assign it to list attribute of ? Thanks a lot in advance for the help one more time..
Re: Hidden field null in IE
Ok. Lets go: I have a javascript function that sets a value of a hidden field : hidden field: Javascript function: function adiciona(){ document.getElementById('mode').value='add'; } In my form i have a The problem is that the field is not set when i am using IE. -- newton.dave wrote: > > Can you reduce that to a minimal use-case and repost? It's hard to wade > through that much HTML/JavaScript/Java/JSP to find out what's actually > happening. > > Dave > > --- phms <[EMAIL PROTECTED]> wrote: > >> >> Folks, >> >> I have a JSP page in which i need to set a hidden field (mode) using >> javascript and send it to a form using struts. The code works on Firefox >> but in IE the field is not modifyed (null). Below is my code: >> >> <%@ page language="java" %> >> <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean" %> >> <%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %> >> <%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic" %> >> >> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> >> http://www.w3.org/1999/xhtml";> >> >> <%@ page import="java.util.List" %> >> <%@ page import="com.redewireless.psiw.common.business.Facade" %> >> <%@ page import="com.redewireless.psiw.common.model.PsiwUser" %> >> <%@ page import="com.redewireless.psiw.common.util.Constants" %> >> <%@ page >> import="com.redewireless.psiw.applications.smsmanager.model.SmsGroup" %> >> <%@ page >> import="com.redewireless.psiw.applications.smsmanager.model.SmsGroupMember" >> %> >> <%@ page import="com.redewireless.psiw.common.util.WordWrapper" %> >> >> >> > /> >> mobiw : Plataforma de Serviços de Interatividade Wireless >> >> >> >> >> >> > /> >> >> >> > type="text/css" rel="stylesheet" /> >> >> >> >> >> >> >> >> >> >> '; >> >> function adiciona(){ >> document.forms[0].smsGroupId.value=""; >> document.forms[0].name.value=""; >> document.forms[0].description.value=""; >> document.forms[0].mode.value="add"; >> document.forms[0].submit(); >> return true; >> >> } >> --> >> >> > bottommargin="0" marginwidth="0" marginheight="0"> >> >> <% >> //Global variables >> Facade facade = Facade.getInstance(); >> PsiwUser user = (PsiwUser) >> request.getSession().getAttribute(Constants.USER_KEY); >> List groups = facade.getSmsGroups(user); >> %> >> >> >> imagens/espaco.gif >> >> >> >> >> imagens/topo_sec.gif >> >> >> >> <%@ include file="topo.jsp" %> >> >> >> >> >> >> >> >> > action="ManageSmsGroup" enctype="multipart/form-data"> >> >> >> > styleId="description"/> >> > styleId="smsGroupId"/> >> >> >> >> >> sec_msg_menu_operacoes.jsp >> GERENCIAMENTO DE ENVIO DE MENSAGENS > >> GERENCIAMENTO DE GRUPOS >> >> >> >> >> >> >> >> >> imagens/seta_cinza.gif Gerenciamento >> de grupos> /> >> >> >> >> >> > cellspacing="0" cellpadding="0"> >> >> > value="success"> >> > background="imagens/linha_sucesso.gif" align="center" >> valign="middle" height="32"> >> >> >> Operação realizada com sucesso! >> >> >> >> > value="error"> >> > background="imagens/linha_erro.gif" align="center" >> valign="middle" height="32"> >> >> >> Operação não pôde ser realizada. Tente novamente mais tarde.> /> >> >>
Re: rrrrr...why my field returns null????
thank you Laurie for your reply. I made a type - its str not the Note. so the str is null :-( when I remove the theme="ajax" it works fine. BUT I need it there (the idea that the form will disappear once the action is completed). how do I get the value of the str? rr :-( I've been trying different variation - nothing! thanks for any pointer! Laurie Harper wrote: > > Your action doesn't have a bean of name/type Note, it only has a single > String property 'str'. Did you mean this property is not being set? From > the code you've included, it should be set from the textfield so you > must have something configured wrong. What does your action mapping look > like? Are you using the default interceptor stack or have you specified > a different one? > > L. > > xianwinwin wrote: >> Can anyone advise why my bean is null. >> >> I have the following jsp page: >> >> >> >> >> >> >> >> > theme="ajax" >> id="myForm" >> cssStyle="font-size : 8pt; font-family: verdana" >> action="notes_insert" >> method="post" > >> >> > required="true"/> >> >> >> >> >> >> >> when the user cllicks submit - the action 'insert' kicksin but the bean >> (Note) is null (yes, i have getter and setter) >> >> >> >> >> //action >> @Validation >> public class NoteAction extends BaseSupport implements Serializable >> { >> private String str; >> >> >> @SkipValidation >> public String insert() >> { >> System.out.println("the value is "+ str); >> } >> >> >> public String getStr() >> { >> return str; >> } >> >> public void setStr(String str) >> { >> this.str = str; >> } >> } >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/r...why-my-field-returns-null-tp16449038p16461868.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: Security @ Struts2, using Acegy or Inspector
> If you anticipate having the complexity of a full ACL implementation, I'd > just go ahead and use AceGI; why re-invent all that machinery? If you decide > to roll your own, though, then the interceptor can access the action through > the ActionInvocation object and, through the action, can access your POJO > via whatever mechanism you want -- via ModelDriven's getModel() method, > through an interceptor-specific interface you design, or whatever. my idea is to make a class that extend Action so, if I extend this action, the action will query and get security permission from database.. because i prefer database driven .. but i thinking a interceptor, but new in this area, i prefer a pattern that filter any action but.. i am loking also in AOP of spring or may be a HTTPFilter mechanism (still dont know, how to implement Struts2 based in the httpfilter) F
Re: [OT] Struts - Spring - hibernate and lazy initialization
Oki, thanks, I've posted to Spring mailing list with my problem ^g^ On Wed, Apr 2, 2008 at 11:14 PM, Laurie Harper <[EMAIL PROTECTED]> wrote: > This isn't really a Struts issue, since you're asking how to drive your > service/dao layout from a thread outside the context of a Struts-served > request. What you need to do in that case is to manage the Hibernate session > from your worker thread. The thread needs to setup and open the Hibernate > session before starting its work, and clean it up afterwards. > > Since you're using Spring to wire your dependencies, you probably need to > go through Spring to setup the Hibernate session for the worker thread. The > Spring forums are probably the best place to seek advice with that. > > L. > > > Yayo wrote: > > > Sorry, more explanation is needed... I've got to launch a "batch > > process" > > it's not a batch but it's a long lasting process that could raise a > > timeout > > and tomcat will kill the worker thread... So I've launched a worker of > > my > > own to do the job and inform the user with a progress indicator or the > > like. > > > > Also I may want to launch my workers using Quartz scheduling features > > but... > > A new thread doesn't have an Hibernate Session attached to it. > > > > Now the circular reference. When I add proxies to my manager layer with > > an > > hibernateInterceptor wich needs a sessionFactory. Under the managers > > there > > are DAOs which depend on sessionFactory too and that's the cyclic > > reference. > > > > Now the trace. Notice that this is just a cut from it but the "cause" is > > just the same stack trace > > > > > > Related cause: > > org.springframework.beans.factory.BeanCreationException: Error creating > > bean > > with name 'filterManager' defined in ServletContext resource > > [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean > > 'filterManagerTarget' while setting bean property 'target'; nested > > exception > > is org.springframework.beans.factory.BeanCreationException: Error > > creating > > bean with name 'filterManagerTarget' defined in ServletContext resource > > [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean > > 'filterDao' > > while setting bean property 'filterDao'; nested exception is > > org.springframework.beans.factory.BeanCreationException: Error creating > > bean > > with name 'filterDao' defined in ServletContext resource > > [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean > > 'sessionFactory' while setting bean property 'sessionFactory'; nested > > exception is org.springframework.beans.factory.BeanCreationException: > > Error > > creating bean with name 'sessionFactory' defined in ServletContext > > resource > > [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean > > 'dataSource' while setting bean property 'dataSource'; nested exception > > is > > org.springframework.beans.factory.BeanCurrentlyInCreationException: > > Error > > creating bean with name 'dataSource': FactoryBean which is currently in > > creation returned null from getObject > > Related cause: org.springframework.beans.factory.BeanCreationException: > > Error creating bean with name 'filterManager' defined in ServletContext > > resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to > > bean > > 'filterManagerTarget' while setting bean property 'target'; nested > > exception > > is org.springframework.beans.factory.BeanCreationException: Error > > creating > > bean with name 'filterManagerTarget' defined in ServletContext resource > > [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean > > 'filterDao' > > while setting bean property 'filterDao'; nested exception is > > org.springframework.beans.factory.BeanCreationException: Error creating > > bean > > with name 'filterDao' defined in ServletContext resource > > [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean > > 'sessionFactory' while setting bean property 'sessionFactory'; nested > > exception is org.springframework.beans.factory.BeanCreationException: > > Error > > creating bean with name 'sessionFactory' defined in ServletContext > > resource > > [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean > > 'dataSource' while setting bean property 'dataSource'; nested exception > > is > > org.springframework.beans.factory.BeanCurrentlyInCreationException: > > Error > > creating bean with name 'dataSource': FactoryBean which is currently in > > creation returned null from getObject > > Related cause: org.springframework.beans.factory.BeanCreationException: > > Error creating bean with name 'filterManager' defined in ServletContext > > resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to > > bean > > 'filterManagerTarget' while setting bean property 'target'; nested > > exception > > is org.springframework.beans.factory.BeanCreationException: Error > > creating > > bean with name 'filterManagerTarget' defined in ServletContext resource > > [/WEB-INF/spring/m
Re: Optiontransferselect list issue
Well, I got it working...thanks for the sanity check, Laurie! The user.groups collection was not getting assigned appropriately at the bottom of a long, dark path of assignment logic. I suppose a null collection really isn't technically a collection, hence the exception error message, but the message could have been a little less obtuse. Apparently null variables really are useless! :) -Ryan On 4/2/08, Laurie Harper <[EMAIL PROTECTED]> wrote: > > Have you double-checked that getUser().getGroups() is returning what it > should be? I.e. getUser() is not returning null; getUser().getGroups() is > really returning a collection? As a sanity check, what happens if you > include the following in your JSP: > >user: > > > >user.groups: > > > > L. > > ryangr wrote: > > > Are you just missing the getter for user? Struts2 has to call > > > getUser().getGroups(). > > > > > > > The action has getters and setters for both user and groups, and the > > user > > object has a getter/setter for its groups attribute. > > > > I never have these two attributes pointing to the same property. It > > > may work, but it's the first place I'd look for type conversion problems. > > > My list attribute always points to a List with key and value entries > > > for the select and the name attribute always points to a String[] that > > > will > > > contain the selected key values. > > > > > > > Thanks for the pointer on that, I was wondering what the difference > > between > > them was; however, I don't think that is quite the issue in this case > > (yet). > > Taking your advice on having a String[] for the name attribute, I can do > > an > > and that collection > > displays its data, but when I have > name="groupKeys" /> the JSP throws the same exception as the > > snippet that is causing headaches. > > > > Apr 2, 2008 10:33:18 AM org.apache.catalina.core.ApplicationDispatcher > > invoke > > SEVERE: Servlet.service() for servlet jsp threw exception > > tag 'updownselect', field 'list': The requested list key 'user.groups' > > could > > not be resolved as a collection/array/map/enumeration/iterator type. > > Example: people or people.{name} - [unknown location] > > > > It is baffling me at this point because they are the same data type, and > > getters/setters exist for all the related objects... *scratches head* > > > > -Ryan > > > > > > Jeromy Evans - Blue Sky Minds wrote: > > > > > ryangr wrote: > > > > > > With that being said...I can populate the list "groups" just fine, > > > > but > > > > when > > > > I try to use "user.groups" to get the other list it throws an > > > > exception > > > > that > > > > says: "The requested list key 'user.groups' could not be resolved as > > > > a > > > > collection/array/map/enumeration/iterator type." What am I doing > > > > wrong? > > > > It's > > > > probably pretty obvious, but this hasn't exactly been a good week > > > > for > > > > concentration so far. ;) > > > > > > > > > > > Are you just missing the getter for user? Struts2 has to call > > > getUser().getGroups(). > > > > > > > > > I have the following for code in my JSP: > > > > > > > > > > >name="user.groups" > > > > > > > > list="user.groups" > > > > > > > I never have these two attributes pointing to the same property. It > > > may work, but it's the first place I'd look for type conversion problems. > > > My list attribute always points to a List with key and value entries > > > for the select and the name attribute always points to a String[] that > > > will > > > contain the selected key values. > > > > > > > > > > > > > > > > > > - > > > 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] > >
xml based validation vs Annotations based validation
Hi, Wanted to get opinion from the struts2 user community if there are any advantages/disadvantages of using one approach over another (Xml vs Annotation based validation). Thanks, -Akash - You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
Re: Using sets of objects with tags
--- [EMAIL PROTECTED] wrote: > by using the "setname[id].fieldname" format above, would I simply > be able to access the entire set in the following Action by a getter > and setter with a like named set (i.e. "setname")? Yep. You might want to check out the type conversion docs [1] if you haven't already. It gives a rough overview of this functionality. Dave [1] http://struts.apache.org/2.0.11.1/docs/type-conversion.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actionerrors & the Store Interceptor
Sorry Lucas, I'm still not seeing how that will help differentiate between which result's need the messages collected and which don't? And I have to agree with Laurie, that I don't understand the difference between the store interceptor and what you're proposing. (*Chris*) On Wed, Apr 2, 2008 at 2:47 PM, Lukasz Lenart <[EMAIL PROTECTED]> wrote: > > Umm, that's what the Store Interceptor is. > > Not exactly, you have to specify for which action store the messages, > and for which retrieve them back. There is no magic, everything hand > coded ;-) > > > > Regards > -- > Lukasz > > http://www.linkedin.com/in/lukaszlenart > > - > > > 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: Using sets of objects with tags
> You're not relating the fields to the students collection in any way. > > You'd need a collection of students in your action (probably mapped by > ID), > and each field would use something like "student[id].firstname" as the > field > name. > > The code you've provided (below) will just create a bunch of fields named > "lastName", "firstName", etc. rather than being associated with your > "students" set. > > Dave > I was curious about that. The code snippet I provided does actually properly prefill the text fields from the proper members of the set as long as the text field name matches the string fields of the Student object. However, as you indicated, once filled, there was no connection to the set. I think I understand now. That being said, by using the "setname[id].fieldname" format above, would I simply be able to access the entire set in the following Action by a getter and setter with a like named set (i.e. "setname")? --Jared - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actionerrors & the Store Interceptor
> Umm, that's what the Store Interceptor is. Not exactly, you have to specify for which action store the messages, and for which retrieve them back. There is no magic, everything hand coded ;-) Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actionerrors & the Store Interceptor
Thanks Laurie, any ideas on the original problem? (*Chris*) On Wed, Apr 2, 2008 at 2:19 PM, Laurie Harper <[EMAIL PROTECTED]> wrote: > Lukasz Lenart wrote: > > > Hi, > > > > I think the best solution is to develop two Interceptors, one will run > > after action invocation and will store messages in session or some > > other objects from given request key. And second one, which will be > > run before action invocation, that will retrieve such stored messages > > from session and put them in to the request. > > > > Umm, that's what the Store Interceptor is. > > > > > We have some similar solution but for Struts1. We subclassed > > DispatchAction and after invocking execute() method we storing in > > session messaged from given request key. And before next execute(), we > > are checking such key in session and retrieving them back to the > > request. > > > > I thought Struts1 handled that automatically, but ok, if what you have > works... > > L. > > > > > - > 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: [s2] conversion validator and repopulateField
Ok, I think I have the solution to my own problem. Since reviewdate is a date field, I was using the s:date tag in my jsp, like this: name="moviereview.reviewdate" size="12" maxlength="10"/ I gather that reviewdate can't be set properly when I use the date tag like this since what's being repopulated most likely won't be a valid date. To get around this, I just added a test for the presence of fielderrors before using the s:date tag. If none are there, then use the date tag. If it is there, then just display the reviewdate field directly. Kevin On Apr 2, 2008, at Wednesday, April 2, 2008 - 5:02 PM, Kevin Wade wrote: Hello. I am having a problem getting "repopulateField" to work. In short, I have added date validation to one of my actions. In my validation xml file, I have this: true Date of Review entered is not a valid date. 01/01/2007 12/31/2008 Date of Review is out of range. My problem is that "repopulateField" is not actually repopulating the moviereview.reviewdate field on a conversion error. The field is blank. In my action, I have a "moviereview" object that has a getter and setter (i.e. "setMoviereview() and getMoviereview()"). So, "reviewdate" is a Date that belongs to that parent object. I don't know if that's related at all, though. Any idea why this isn't working? Kevin
Re: Using sets of objects with tags
You're not relating the fields to the students collection in any way. You'd need a collection of students in your action (probably mapped by ID), and each field would use something like "student[id].firstname" as the field name. The code you've provided (below) will just create a bunch of fields named "lastName", "firstName", etc. rather than being associated with your "students" set. Dave --- [EMAIL PROTECTED] wrote: > > You don't need to 'parse the stream', Struts does that for you. Struts > > will call the setters on the objects in your set to pass the form inputs > > into them. In other words, the result you want to achieve is what > > happens automatically, provided you specify your input fields correctly. > > H, thought I had tried that. How do I retrieve those objects then? > > For example, in the first Action I create a set named 'students', and fill > it with Student objects. > > In the .jsp, I iterate over the set of students, like so: > (please ignore the table, this is just preliminary formatting, .css is on > the way) > > > > > > . > > > > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using sets of objects with tags
> > You don't need to 'parse the stream', Struts does that for you. Struts > will call the setters on the objects in your set to pass the form inputs > into them. In other words, the result you want to achieve is what > happens automatically, provided you specify your input fields correctly. > > L. > H, thought I had tried that. How do I retrieve those objects then? For example, in the first Action I create a set named 'students', and fill it with Student objects. In the .jsp, I iterate over the set of students, like so: (please ignore the table, this is just preliminary formatting, .css is on the way) . Is this incorrect? If not, how then do I retrieve the set of modified student objects in the submit Action? -Jared - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actionerrors & the Store Interceptor
Lukasz Lenart wrote: Hi, I think the best solution is to develop two Interceptors, one will run after action invocation and will store messages in session or some other objects from given request key. And second one, which will be run before action invocation, that will retrieve such stored messages from session and put them in to the request. Umm, that's what the Store Interceptor is. We have some similar solution but for Struts1. We subclassed DispatchAction and after invocking execute() method we storing in session messaged from given request key. And before next execute(), we are checking such key in session and retrieving them back to the request. I thought Struts1 handled that automatically, but ok, if what you have works... L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Struts - Spring - hibernate and lazy initialization
This isn't really a Struts issue, since you're asking how to drive your service/dao layout from a thread outside the context of a Struts-served request. What you need to do in that case is to manage the Hibernate session from your worker thread. The thread needs to setup and open the Hibernate session before starting its work, and clean it up afterwards. Since you're using Spring to wire your dependencies, you probably need to go through Spring to setup the Hibernate session for the worker thread. The Spring forums are probably the best place to seek advice with that. L. Yayo wrote: Sorry, more explanation is needed... I've got to launch a "batch process" it's not a batch but it's a long lasting process that could raise a timeout and tomcat will kill the worker thread... So I've launched a worker of my own to do the job and inform the user with a progress indicator or the like. Also I may want to launch my workers using Quartz scheduling features but... A new thread doesn't have an Hibernate Session attached to it. Now the circular reference. When I add proxies to my manager layer with an hibernateInterceptor wich needs a sessionFactory. Under the managers there are DAOs which depend on sessionFactory too and that's the cyclic reference. Now the trace. Notice that this is just a cut from it but the "cause" is just the same stack trace Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManager' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterManagerTarget' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManagerTarget' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterDao' while setting bean property 'filterDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterDao' defined in ServletContext resource [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'dataSource': FactoryBean which is currently in creation returned null from getObject Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManager' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterManagerTarget' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManagerTarget' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterDao' while setting bean property 'filterDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterDao' defined in ServletContext resource [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'dataSource': FactoryBean which is currently in creation returned null from getObject Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManager' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterManagerTarget' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManagerTarget' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterDao' while setting bean property 'filterDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterDao' defined in ServletContext resource [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in Servlet
Re: rrrrr...why my field returns null????
Your action doesn't have a bean of name/type Note, it only has a single String property 'str'. Did you mean this property is not being set? From the code you've included, it should be set from the textfield so you must have something configured wrong. What does your action mapping look like? Are you using the default interceptor stack or have you specified a different one? L. xianwinwin wrote: Can anyone advise why my bean is null. I have the following jsp page: theme="ajax" id="myForm" cssStyle="font-size : 8pt; font-family: verdana" action="notes_insert" method="post" > when the user cllicks submit - the action 'insert' kicksin but the bean (Note) is null (yes, i have getter and setter) //action @Validation public class NoteAction extends BaseSupport implements Serializable { private String str; @SkipValidation public String insert() { System.out.println("the value is "+ str); } public String getStr() { return str; } public void setStr(String str) { this.str = str; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using sets of objects with tags
[EMAIL PROTECTED] wrote: Struts 2? Sorry, yes I am using Struts 2. Er, what other forums would you have tried? Varied coding forums that happened to have a struts/hibernate/whatever-else subsection Use map- (and/or) index-based field names. Trivial with S2, don't actually remember for S1. I may not understand what you are saying. I have a set of varying size that needs to generate modifiable text fields for each element in the set. This means that within my Action I simply load up a Set/Map and then in the .jsp use the iterator tag to pre-fill the text fields. The text fields are inside a form tag. If I use index based field names, other than directly parsing the stream, is there a way to retrieve the modifications made to the text fields in the Action to which I submit the form? You don't need to 'parse the stream', Struts does that for you. Struts will call the setters on the objects in your set to pass the form inputs into them. In other words, the result you want to achieve is what happens automatically, provided you specify your input fields correctly. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hidden field null in IE
--- Musachy Barroso <[EMAIL PROTECTED]> wrote: > Oh my eyes!, now seriously, that is kind of hard to read (and you > didn't even say what field it was). > > On Wed, Apr 2, 2008 at 4:35 PM, phms <[EMAIL PROTECTED]> wrote: > > I have a JSP page in which i need to set a hidden field **(mode)** using :p Beat you to asking for a better example, though :D Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[s2] conversion validator and repopulateField
Hello. I am having a problem getting "repopulateField" to work. In short, I have added date validation to one of my actions. In my validation xml file, I have this: true Date of Review entered is not a valid date. 01/01/2007 12/31/2008 Date of Review is out of range. My problem is that "repopulateField" is not actually repopulating the moviereview.reviewdate field on a conversion error. The field is blank. In my action, I have a "moviereview" object that has a getter and setter (i.e. "setMoviereview() and getMoviereview()"). So, "reviewdate" is a Date that belongs to that parent object. I don't know if that's related at all, though. Any idea why this isn't working? Kevin
Re: Hidden field null in IE
Can you reduce that to a minimal use-case and repost? It's hard to wade through that much HTML/JavaScript/Java/JSP to find out what's actually happening. Dave --- phms <[EMAIL PROTECTED]> wrote: > > Folks, > > I have a JSP page in which i need to set a hidden field (mode) using > javascript and send it to a form using struts. The code works on Firefox > but in IE the field is not modifyed (null). Below is my code: > > <%@ page language="java" %> > <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean" %> > <%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %> > <%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic" %> > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > <%@ page import="java.util.List" %> > <%@ page import="com.redewireless.psiw.common.business.Facade" %> > <%@ page import="com.redewireless.psiw.common.model.PsiwUser" %> > <%@ page import="com.redewireless.psiw.common.util.Constants" %> > <%@ page > import="com.redewireless.psiw.applications.smsmanager.model.SmsGroup" %> > <%@ page > import="com.redewireless.psiw.applications.smsmanager.model.SmsGroupMember" > %> > <%@ page import="com.redewireless.psiw.common.util.WordWrapper" %> > > > > mobiw : Plataforma de Serviços de Interatividade Wireless > > > > > > > > > type="text/css" rel="stylesheet" /> > > > > > > > > > > '; > > function adiciona(){ > document.forms[0].smsGroupId.value=""; > document.forms[0].name.value=""; > document.forms[0].description.value=""; > document.forms[0].mode.value="add"; > document.forms[0].submit(); > return true; > > } > --> > > bottommargin="0" marginwidth="0" marginheight="0"> > > <% > //Global variables > Facade facade = Facade.getInstance(); > PsiwUser user = (PsiwUser) > request.getSession().getAttribute(Constants.USER_KEY); > List groups = facade.getSmsGroups(user); > %> > > >imagens/espaco.gif > > > > > imagens/topo_sec.gif > > > > <%@ include file="topo.jsp" %> > > > > > > > >action="ManageSmsGroup" enctype="multipart/form-data"> > > >styleId="description"/> >styleId="smsGroupId"/> > > > > >sec_msg_menu_operacoes.jsp > GERENCIAMENTO DE ENVIO DE MENSAGENS > > GERENCIAMENTO DE GRUPOS > > > > > > > > >imagens/seta_cinza.gif Gerenciamento > de grupos /> > > > > >cellspacing="0" cellpadding="0"> > >value="success"> >background="imagens/linha_sucesso.gif" align="center" > valign="middle" height="32"> > > > Operação realizada com sucesso! > > > >value="error"> >background="imagens/linha_erro.gif" align="center" > valign="middle" height="32"> > > > Operação não pôde ser realizada. Tente novamente mais tarde. > > > > > > >value="none"> > > > >
Re: Actionerrors & the Store Interceptor
Hi, I think the best solution is to develop two Interceptors, one will run after action invocation and will store messages in session or some other objects from given request key. And second one, which will be run before action invocation, that will retrieve such stored messages from session and put them in to the request. We have some similar solution but for Struts1. We subclassed DispatchAction and after invocking execute() method we storing in session messaged from given request key. And before next execute(), we are checking such key in session and retrieving them back to the request. Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hidden field null in IE
Oh my eyes!, now seriously, that is kind of hard to read (and you didn't even say what field it was). Tips: * Put all that inlined javascript in functions. * Check for javascript errors on the page * Minimize the example to something small that replicates the problem * This is not an struts problem but we might give you a hand if you provide an small example regards musachy On Wed, Apr 2, 2008 at 4:35 PM, phms <[EMAIL PROTECTED]> wrote: > > Folks, > > I have a JSP page in which i need to set a hidden field (mode) using > javascript and send it to a form using struts. The code works on Firefox > but in IE the field is not modifyed (null). Below is my code: > > <%@ page language="java" %> > <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean" %> > <%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %> > <%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic" %> > >"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > <%@ page import="java.util.List" %> > <%@ page import="com.redewireless.psiw.common.business.Facade" %> > <%@ page import="com.redewireless.psiw.common.model.PsiwUser" %> > <%@ page import="com.redewireless.psiw.common.util.Constants" %> > <%@ page > import="com.redewireless.psiw.applications.smsmanager.model.SmsGroup" %> > <%@ page > import="com.redewireless.psiw.applications.smsmanager.model.SmsGroupMember" > %> > <%@ page import="com.redewireless.psiw.common.util.WordWrapper" %> > > > > mobiw : Plataforma de Serviços de Interatividade Wireless > > > > > > > > >type="text/css" rel="stylesheet" /> > > > > > > > > > > '; > > function adiciona(){ > document.forms[0].smsGroupId.value=""; > document.forms[0].name.value=""; > document.forms[0].description.value=""; > document.forms[0].mode.value="add"; > document.forms[0].submit(); > return true; > } > --> > >bottommargin="0" marginwidth="0" marginheight="0"> > > <% > //Global variables > Facade facade = Facade.getInstance(); > PsiwUser user = (PsiwUser) > request.getSession().getAttribute(Constants.USER_KEY); > List groups = facade.getSmsGroups(user); > %> > > > imagens/espaco.gif > > > > > imagens/topo_sec.gif > > > > <%@ include file="topo.jsp" %> > > > > > > > > action="ManageSmsGroup" enctype="multipart/form-data"> > > > styleId="description"/> > styleId="smsGroupId"/> > value="0"/> > > > > sec_msg_menu_operacoes.jsp > GERENCIAMENTO DE ENVIO DE MENSAGENS > > GERENCIAMENTO DE GRUPOS > > > > > > > > > imagens/seta_cinza.gif > Gerenciamento de grupos /> > > > > cellspacing="0" cellpadding="0"> > > value="success"> > background="imagens/linha_sucesso.gif" align="center" > valign="middle" height="32"> > > > Operação realizada com sucesso! > > > > value="error"> > background="imagens/linha_erro.gif" align="center" > valign="middle" height="32"> > > > Operação não pôde ser realizada. Tente novamente mais tarde. > > > > > > value="none"> > > > > <% > if(groups != null && groups.size() > > 0){ > %> > > cellspacing="2" cellpadding="4"> >
RE: struts-default.properties
OK - found it. For anyone else looking for it in the future, it is in the org.apache.struts2 package root not the root of the jar. Dan -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2008 11:51 AM To: Struts Users Mailing List Subject: RE: struts-default.properties --- "Barron, Daniel" <[EMAIL PROTECTED]> wrote: > There is no "default.properties" file in the v2.0.11.1 S2 core jar [...] Then you have a corrupt struts2-core-2.0.11.1.jar file. Dave - 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]
Hidden field null in IE
Folks, I have a JSP page in which i need to set a hidden field (mode) using javascript and send it to a form using struts. The code works on Firefox but in IE the field is not modifyed (null). Below is my code: <%@ page language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic" %> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml";> <%@ page import="java.util.List" %> <%@ page import="com.redewireless.psiw.common.business.Facade" %> <%@ page import="com.redewireless.psiw.common.model.PsiwUser" %> <%@ page import="com.redewireless.psiw.common.util.Constants" %> <%@ page import="com.redewireless.psiw.applications.smsmanager.model.SmsGroup" %> <%@ page import="com.redewireless.psiw.applications.smsmanager.model.SmsGroupMember" %> <%@ page import="com.redewireless.psiw.common.util.WordWrapper" %> mobiw : Plataforma de Serviços de Interatividade Wireless '; function adiciona(){ document.forms[0].smsGroupId.value=""; document.forms[0].name.value=""; document.forms[0].description.value=""; document.forms[0].mode.value="add"; document.forms[0].submit(); return true; } --> <% //Global variables Facade facade = Facade.getInstance(); PsiwUser user = (PsiwUser) request.getSession().getAttribute(Constants.USER_KEY); List groups = facade.getSmsGroups(user); %> imagens/espaco.gif imagens/topo_sec.gif <%@ include file="topo.jsp" %> sec_msg_menu_operacoes.jsp GERENCIAMENTO DE ENVIO DE MENSAGENS > GERENCIAMENTO DE GRUPOS imagens/seta_cinza.gif Gerenciamento de grupos Operação realizada com sucesso! Operação não pôde ser realizada. Tente novamente mais tarde. <% if(groups != null && groups.size() > 0){ %> Id Nome do grupo Descrição Editar Excluir <% String groupId;
Re: Regarding Service layer getting called twice
Struts invokes your actions, not your service layer, so the first step is to determine where the calls to the service layer are coming from. Either your action is doing that or your action is being called more than once during one 'logical request' -- which would probably mean the browser was issuing more than one request to the action while building the page, unless you're using s:action or something. Figure out what's happening at the action level first, then work backwards from there. L. Prajapati Manish Narandas wrote: Hi all, i am using spring object factory action itself,service layer and Dao layer. Here, service layer method is getting called twice and due to that dao layer method is also called twice. Can any body tell me what can be the reason of it? This not happening service layer of all action. Like i have another action class which shares the same service layer but for that action service layer is not getting called twice. Following are the all configuration files: *1. test1-applicationContext.xml* *(My application context file for that test1 action)* http://www.springframework.org/dtd/spring-beans.dtd";> .. * * * * ** . *2. test2-applicationcontext.xml* *(application context file which is imported in above test1 for sharing service layer)* http://www.springframework.org/dtd/spring-beans.dtd";> .. ** ** ** .. . *3. struts-test1.xml (struts configuration file for test1'action)* ** http://struts.apache.org/dtds/struts-2.0.dtd "> showListing showListing,nextAllItemList,viewStatetaxMap /jsp/auctionpreview/success.jsp /jsp/auctionpreview/Main.jsp?page=auctionPreview . /jsp/auctionpreview/success.jsp .. /jsp/listing/PaymentSuccess.jsp?page=listing /jsp/listing/PaymentFailure.jsp?page=listing /jsp/listing/error.jsp?page=listing *4.struts-test1Stack.xml (interceptor stack config file)* http://struts.apache.org/dtds/struts-2.0.dtd "> Summary: Here *itemListingService(Service Layer) 's method is called twice and because of it itemListingDao (Dao layer)'s* *method is also called twice any it gives error like Invalid attempt to associate collection with two open session.* ** ** *Can anybody tell me why in test1 service layer is getting called twice.* ** ** *Please share your ideas,* ** *Thanx in advance.* ** *From * *Manish* - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts - Spring - hibernate and lazy initialization
Sorry, more explanation is needed... I've got to launch a "batch process" it's not a batch but it's a long lasting process that could raise a timeout and tomcat will kill the worker thread... So I've launched a worker of my own to do the job and inform the user with a progress indicator or the like. Also I may want to launch my workers using Quartz scheduling features but... A new thread doesn't have an Hibernate Session attached to it. Now the circular reference. When I add proxies to my manager layer with an hibernateInterceptor wich needs a sessionFactory. Under the managers there are DAOs which depend on sessionFactory too and that's the cyclic reference. Now the trace. Notice that this is just a cut from it but the "cause" is just the same stack trace Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManager' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterManagerTarget' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManagerTarget' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterDao' while setting bean property 'filterDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterDao' defined in ServletContext resource [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'dataSource': FactoryBean which is currently in creation returned null from getObject Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManager' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterManagerTarget' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManagerTarget' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterDao' while setting bean property 'filterDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterDao' defined in ServletContext resource [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'dataSource': FactoryBean which is currently in creation returned null from getObject Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManager' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterManagerTarget' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManagerTarget' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterDao' while setting bean property 'filterDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterDao' defined in ServletContext resource [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'dataSource': FactoryBean which is currently in creation returned null from getObject Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterManager' defined in ServletContext resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean 'filterManagerTarget' while setting bean pr
Re: application folder name in webapps folder in tomcat.
Raghuveer wrote: I have HelloServlet ,HelloServletContextListener in 3 different applications in tomcat webapps\AppHello1 webapps\AppHello2 webapps\AppHello3 How to identify in my listner class what is the folder/context name in my server. public void contextInitialized(ServletContextEvent ce) { contextName = ce.getServletContext().getServletContextName(); } This code is working only if i have AppHello1 in web.xml. If there is no in web.xml then above code in listner class is returning null. Is there facility to know application folder name in webapps folder in tomcat. Call getRealPath("/") on the servlet context: http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletContext.html#getRealPath(java.lang.String) L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Security @ Struts2, using Acegy or Inspector
Frans Thamura wrote: hi there I want to filter any .action in my cimande project and i want to give several database security to the action i just think this will become ACL for Struts2 but... I am also using Spring, anyone can help me is this better create my own interceptor (how to develop interceptor that can access my POJO like action did) or using acegy security any opinion welcome If you anticipate having the complexity of a full ACL implementation, I'd just go ahead and use AceGI; why re-invent all that machinery? If you decide to roll your own, though, then the interceptor can access the action through the ActionInvocation object and, through the action, can access your POJO via whatever mechanism you want -- via ModelDriven's getModel() method, through an interceptor-specific interface you design, or whatever. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts - Spring - hibernate and lazy initialization
Yayo on 02/04/08 20:23, wrote: I'm developing a struts - spring based application. I've got actions-delegates-managers and daos and I use the open session in view filter from hibernate. In some cases I've got to return lazy results to the user so I've got to launch a new worker thread and taht new one doesn't have an hibernate session attached so I've added hibernateInterceptors to my managers. Hi Yayo, that paragraph doesn't sound right. You say 'lazy results' and so I understand you want your hibernate entities to lazy load - is that correct? If that is correct, I don't see the connection with what you say 'launches a new worker thread'. Why do you do that? If you need lazy loading, you make sure the Hibernate session is still running, which you have already because you use the OpenSessionInViewFilter. What is the reason for launching a new thread? The idiomatic spring/hibernate approach doesn't require that. You just pass your hibernate entities around and as long as the session is running, it will be fine. Regards Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts - Spring - hibernate and lazy initialization
Try to post a stack trace or something more meaningful, but first of all, as a general architectural guideline, try first to refactor your code to avoid circular dependencies. 2008/4/2, Yayo <[EMAIL PROTECTED]>: > Hi, > > I'm developing a struts - spring based application. > > I've got actions-delegates-managers and daos and I use the open session in > view filter from hibernate. > > In some cases I've got to return lazy results to the user so I've got to > launch a new worker thread and taht new one doesn't have an hibernate > session attached so I've added hibernateInterceptors to my managers. > > The new addition crashes the application because (as I've found on the net) > there's a circular reference as my DAOs need the sessionfactory and the > hibernate interceptor too. > > I've found that using lazy initializing of one of the services in the > ciruclar references should do the job but it's still crashing afterall, > maybe I don't know what is the one to be lazily initialized... > > any idea?? > > -- > "Sit tibi terra levis" > > http://yayocaturas.blogspot.com/ > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] checkboxes in each row of table - set values in action
lbastil wrote: Hello, I have the following problem: in action i have a collection of class User each class User have different attributes, one is: boolean permission in JSP I use struts 2 iterator tag to iterate the User Objects. For each User entry I create one row in table. for displaying/changing the boolean permission value I use S2 checkbox tag so far it works fine and show all data in collection of Users correct. But how can I set changed checkbox values (the permission attribute) back to action? If your checkbox is bound the the permission property of the user, submitting the form should update the property. If that's not happening, you need to give more details: what your JSP code looks like, and the relevant bits of your action and User code, at least. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.1 TabbedPanel scenario
Shoaib Gauhar wrote: Hello, Here is the scenrio. I have two action classes. ClassA and ClassB. There is no relationship among these classes. You might say that if there is no relationship then why i have to put them in one single jsp. Well its a client's requirement. That's an implementation detail, not a functional requirement. Why does the client care how you structure your actions? In a single jsp there are two tabs. Tab1ForClassA and Tab2ForClassB. Each tab has fields concerned to their classes as defined above. Tab1 -> ClassA and Tab2 -> ClassB. Can we do it? I have tried this but what happens is that when i submit the data on Tab1, Tab2's data becomes empty. A request is only processed by one action. If you need both actions to be able to process all the input from both tabs, you'll have to have them both aware of the full dataset. There are a number of ways you might achieve that, depending on what you're trying to achieve. So, any ideas will be highly appreciated. Furthermore, i am quite new to tabbed panel and would require clear tips and ideas. I haven't used that widget in Struts 2 so can't offer specific tips. However, if you start by defining the functional requirements (rather than the implementation details), it'll be easier to offer advice. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with tutorial
Lukasz Lenart wrote: Hi, org.hibernate.AnnotationException: java.lang.NoSuchMethodException: As for me, such fragment says that you maybe made some miss typo with method name, in class or in Spring xml file Either that, or you have a classpath issue. Check you have all required JARs deployed, and don't have any that shouldn't be there. Be sure the ones you have are the correct versions. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Optiontransferselect list issue
Have you double-checked that getUser().getGroups() is returning what it should be? I.e. getUser() is not returning null; getUser().getGroups() is really returning a collection? As a sanity check, what happens if you include the following in your JSP: user: user.groups: L. ryangr wrote: Are you just missing the getter for user? Struts2 has to call getUser().getGroups(). The action has getters and setters for both user and groups, and the user object has a getter/setter for its groups attribute. I never have these two attributes pointing to the same property. It may work, but it's the first place I'd look for type conversion problems. My list attribute always points to a List with key and value entries for the select and the name attribute always points to a String[] that will contain the selected key values. Thanks for the pointer on that, I was wondering what the difference between them was; however, I don't think that is quite the issue in this case (yet). Taking your advice on having a String[] for the name attribute, I can do an and that collection displays its data, but when I have the JSP throws the same exception as the snippet that is causing headaches. Apr 2, 2008 10:33:18 AM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception tag 'updownselect', field 'list': The requested list key 'user.groups' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location] It is baffling me at this point because they are the same data type, and getters/setters exist for all the related objects... *scratches head* -Ryan Jeromy Evans - Blue Sky Minds wrote: ryangr wrote: With that being said...I can populate the list "groups" just fine, but when I try to use "user.groups" to get the other list it throws an exception that says: "The requested list key 'user.groups' could not be resolved as a collection/array/map/enumeration/iterator type." What am I doing wrong? It's probably pretty obvious, but this hasn't exactly been a good week for concentration so far. ;) Are you just missing the getter for user? Struts2 has to call getUser().getGroups(). I have the following for code in my JSP: name="user.groups" list="user.groups" I never have these two attributes pointing to the same property. It may work, but it's the first place I'd look for type conversion problems. My list attribute always points to a List with key and value entries for the select and the name attribute always points to a String[] that will contain the selected key values. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts - Spring - hibernate and lazy initialization
Hi, I'm developing a struts - spring based application. I've got actions-delegates-managers and daos and I use the open session in view filter from hibernate. In some cases I've got to return lazy results to the user so I've got to launch a new worker thread and taht new one doesn't have an hibernate session attached so I've added hibernateInterceptors to my managers. The new addition crashes the application because (as I've found on the net) there's a circular reference as my DAOs need the sessionfactory and the hibernate interceptor too. I've found that using lazy initializing of one of the services in the ciruclar references should do the job but it's still crashing afterall, maybe I don't know what is the one to be lazily initialized... any idea?? -- "Sit tibi terra levis" http://yayocaturas.blogspot.com/
rrrrr...why my field returns null????
Can anyone advise why my bean is null. I have the following jsp page: when the user cllicks submit - the action 'insert' kicksin but the bean (Note) is null (yes, i have getter and setter) //action @Validation public class NoteAction extends BaseSupport implements Serializable { private String str; @SkipValidation public String insert() { System.out.println("the value is "+ str); } public String getStr() { return str; } public void setStr(String str) { this.str = str; } } -- View this message in context: http://www.nabble.com/r...why-my-field-returns-null-tp16449038p16449038.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: Using sets of objects with tags
> > Struts 2? > Sorry, yes I am using Struts 2. > > Er, what other forums would you have tried? > Varied coding forums that happened to have a struts/hibernate/whatever-else subsection > > Use map- (and/or) index-based field names. Trivial with S2, don't actually > remember for S1. > I may not understand what you are saying. I have a set of varying size that needs to generate modifiable text fields for each element in the set. This means that within my Action I simply load up a Set/Map and then in the .jsp use the iterator tag to pre-fill the text fields. The text fields are inside a form tag. If I use index based field names, other than directly parsing the stream, is there a way to retrieve the modifications made to the text fields in the Action to which I submit the form? If a visual example would help, the site I am being asked to develop can be found here: http://www-dev.arcademicskillbuilders.com Feel free to login as username: test, password: test - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts-default.properties
--- "Barron, Daniel" <[EMAIL PROTECTED]> wrote: > There is no "default.properties" file in the v2.0.11.1 S2 core jar [...] Then you have a corrupt struts2-core-2.0.11.1.jar file. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Strange behavior: Trying to implement saveToken() in display actions.
On Wed, Apr 2, 2008 at 2:37 PM, Dave Newton <[EMAIL PROTECTED]> wrote: > --- Doug Lochart <[EMAIL PROTECTED]> wrote: > > > --- Martin Gainty <[EMAIL PROTECTED]> wrote: > > > > Is there any reason (other than political) why you are using 1.3.8 > > > > [Singletons? Filters?] > > > > I guess I'm not sure what that has to do with an S1 token issue; could > > > you explain further? > > > > > Certalnly. Maybe I should have stated it more clearly but t S1 tokens > > are NOT the problem. I was trying to emphasize the pattern (for lack > > of a better term) that I was trying to follow. That pattern is: > > I actually replied to Martin, hence was asking him that question, as I was > unsure what his answer had to do with your original question. Sorry it was not clear to me. > Your question, in a nutshell, is that you're wondering why the second display > action (not the create action) is displaying the contents of the first > display? Or the initial form? > Dave Yes that is my question in a nutshell! thanks Doug > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- What profits a man if he gains the whole world yet loses his soul? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using sets of objects with tags
--- [EMAIL PROTECTED] wrote: > I am loading a simple set of objects representing users in an action; they > have names, passwords, etc., all loaded from a database. Struts 2? > Next, I use the iterator to create textfield tags instead of property > tags, with the goal of allowing the viewer to edit all of the fields. > > My problem is, how do I submit all of these fields? Understand that there > is a varying number of fields, and possibly quite a lot of them, so just > hardcoding matching setters/getters for N uniquely identified DOM tree > elements seems a poor solution. Use map- (and/or) index-based field names. Trivial with S2, don't actually remember for S1. > Sorry again if this is not the place to pose this question, but various > forums have proved to be unresponsive. Er, what other forums would you have tried? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Strange behavior: Trying to implement saveToken() in display actions.
--- Doug Lochart <[EMAIL PROTECTED]> wrote: > > --- Martin Gainty <[EMAIL PROTECTED]> wrote: > > > Is there any reason (other than political) why you are using 1.3.8 > > > [Singletons? Filters?] > > I guess I'm not sure what that has to do with an S1 token issue; could > > you explain further? > > Certalnly. Maybe I should have stated it more clearly but t S1 tokens > are NOT the problem. I was trying to emphasize the pattern (for lack > of a better term) that I was trying to follow. That pattern is: I actually replied to Martin, hence was asking him that question, as I was unsure what his answer had to do with your original question. Your question, in a nutshell, is that you're wondering why the second display action (not the create action) is displaying the contents of the first display? Or the initial form? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:button
2008/4/2, puneet duggal <[EMAIL PROTECTED]>: > frnds how to use Simple html:button to perform action in action class > without using submit button Use Javascript in the onclick attribute. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How is the dependency and dependency conversion list built on struts website?
Ignore my question... I found it... Maven 2 Report, thanks. MG -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2008 12:50 PM To: Struts Users Mailing List Subject: How is the dependency and dependency conversion list built on struts website? Hello all, I think I know the answer to this, but I am wondering how the dependency and dependency convergence lists are built on the Struts Website? http://struts.apache.org/2.x/struts2-core/dependencies.html http://struts.apache.org/2.x/struts2-core/dependency-convergence.html Is this a Maven 2 feature, or is it done with something like JDepend? I'd like to have the same information for my application using the Ant build system. Thanks in advance, MG - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Actionerrors & the Store Interceptor
We're having a problem configuring the system and, since this seems like a common problem, we're hoping someone has found a solution. We have a bunch of actions that can't be run twice, so we're using the redirect-action result type to make sure a refresh doesn't accidentally resubmit the request. We also need to give the user a pat on the back and let them know that things went well, so we're setting an ActionMessage and using the store interceptor to pass the message to the redirected page. At this point everything's working great. The problem comes in when an error occurs. At that point, we put register an ActionError and forward the user back to the page they were on to correct their error. The page displays properly, including the error message and everything looks fine, until... The next time you hit a page using the store interceptor in RETRIEVE mode, you get the ActionError display since the tag doesn't seem to clear the messages once they are displayed. Redirecting instead of forwarding back to the page wouldn't help since the store interceptor is already in STORE mode, it seems like the struts tags should remove the messages once displayed so that they wouldn't be picked up by the interceptor. Is there a way to handle this cleanly? Thanks. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts-default.properties
There is no "default.properties" file in the v2.0.11.1 S2 core jar and constants in struts.xml work but not for "struts.configuration" key it seems. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2008 10:44 AM To: Struts Users Mailing List Subject: Re: struts-default.properties --- "Barron, Daniel" <[EMAIL PROTECTED]> wrote: > It is not clear to me - is the struts-default.properties just a template > for struts.properties or is it actually being loaded? I do not see it > being loaded in anyway and only see values from struts.properties being > used. Can anyone provide some insight on this please? AFAIK those properties are (now, anyway) in "default.properties" in the S2 core jar and can be overridden in a struts.properties on the classpath. That said, it's probably better to use XML constant configuration. Dave - 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]
Using sets of objects with tags
Perhaps this is the wrong place to seek help, and perhaps there is no direct solution to my problem, but I have to try. I am loading a simple set of objects representing users in an action; they have names, passwords, etc., all loaded from a database. I am displaying the elements of this set in a .jsp using the iterator tag, creating a table of user objects with names, passwords, etc. Easy enough. Next, I use the iterator to create textfield tags instead of property tags, with the goal of allowing the viewer to edit all of the fields. My problem is, how do I submit all of these fields? Understand that there is a varying number of fields, and possibly quite a lot of them, so just hardcoding matching setters/getters for N uniquely identified DOM tree elements seems a poor solution. I know I can just read in the submission stream and parse from there but I was wondering if there is some elegant struts solution that I am missing. If necessary I will happily provide illustrative code and links to clarify. Sorry again if this is not the place to pose this question, but various forums have proved to be unresponsive. If this is the wrong place, please let me know and I will refrain from doing so in the future. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How is the dependency and dependency conversion list built on struts website?
Hello all, I think I know the answer to this, but I am wondering how the dependency and dependency convergence lists are built on the Struts Website? http://struts.apache.org/2.x/struts2-core/dependencies.html http://struts.apache.org/2.x/struts2-core/dependency-convergence.html Is this a Maven 2 feature, or is it done with something like JDepend? I'd like to have the same information for my application using the Ant build system. Thanks in advance, MG
Re: Strange behavior: Trying to implement saveToken() in display actions.
> --- Martin Gainty <[EMAIL PROTECTED]> wrote: > > Is there any reason (other than political) why you are using 1.3.8 instead > > of 2.0.11+ There are numerous reasons and one being that we are still supporting 1.x in other applications. All the books I have at my disposal deal with 1.x. Regardless I am not asking as to which struts I should use I am asking why I am seeing this behavior. Sorry I don't mean to sound blunt or annoyed but I don't want this thread to get off track. > I guess I'm not sure what that has to do with an S1 token issue; could you > explain further? > > Dave Certalnly. Maybe I should have stated it more clearly but t S1 tokens are NOT the problem. I was trying to emphasize the pattern (for lack of a better term) that I was trying to follow. That pattern is: for each JSP page 1 action that is called the displayAction that sets the token and forwards to the JSP 1 action the is the result of a form sumission from the JSP. This will have logic and test the token and then forward to another displayType action that will set the next token. I have a bug or misunderstanding most likely in my struts-config or how this is to be really handled. As the attached log indicates when the form submission action tries to forward to the next display action it seems to resolve that action from the mapping but then the display action that is actually executed is the initial display action that displayed the same JSP. Hope I made it more clear. thanks for your time Doug > > > > - Original Message - > > From: "Doug Lochart" <[EMAIL PROTECTED]> > > To: > > Sent: Wednesday, April 02, 2008 6:43 AM > > Subject: Re: Strange behavior: Trying to implement saveToken() in display > > actions. > > > > > > > I am just learning Struts. I think I may have forgotten some > > > information that you might need in order to provide any help. I am > > > using Struts 1.3.8, JDK 1.6, running on Tomcat 5.5. > > > > > > If my problem is SO SIMPLE and hence why I have heard silence then I > > > am sorry but this is my first app and I so far what I have done looks > > > like it should work. > > > > > > Does anyone have any ideas? > > > > > > regards, > > > > > > Doug Lochart > > > > > > On Tue, Apr 1, 2008 at 2:02 PM, Doug Lochart <[EMAIL PROTECTED]> wrote: > > > > I am trying to implement a pattern so that I can use struts tokens to > > > > help prevent double submission. I seem to be getting a strange > > > > sequence of events that I don't quite follow. Here is what I want to > > > > do at a high level > > > > > > > > displayCreateAccount -- forwards to --> CreateAccount.jsp (with form > > > > action defined as /createAccount) > > > > createAccount -- forwards to --> displayCreateAccountStep2 -- forwards > > > > to --> CreateAccountStep2.jsp > > > > > > > > The actions that start with 'display' merely set the struts token (e.g > > > > saveToken( request ); ) > > > > Then it forwards it along to a jsp. > > > > > > > > The actions that start with 'Create' check to see if the token is > > > > valid then it processes the form submission and then > > > > forwards it to another display action which will then set the next > > > > toke for the next display of a JSP. > > > > > > > > I have checked and rechecked all of my configs but I do not see a > > > > mistake. I have also rebuilt the entire war > > > > and cleaned out EVERYTHING in Tomcat but I get the same result. When > > > > I hit the first displayCreateAccount action > > > > it properly forwards control to the jsp page that is then presented. > > > > When the form on the jsp page is submitted > > > > the displayCreateAccountStep2 action is found (see log below) in the > > > > mapping YET the original displayCreateAccount is executed. I have > > > > turned on > > > > debug of org.apache.struts. Here is my struts-config.xml and a > > > > snippet of the logs showing what is happening. > > > > > > > > I am curious as to why this is happening. I really want to understand > > > > what I am doing wrong or why it is working this way. > > > > Please let me know if I need to supply any more supporting documents. > > > > > > > > thanks > > > > > > > > Doug > > > > > > > > snippet from struts-config.xml > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > type="capesafe.web.action.DisplayCreateAccountAction" > > > > name="accountSetupForm" > > > > scope="request" > > > > cancellable="true" > > > > validate="false"> > > > > > > > > > > > > > > > > > > > type="capesafe.web.action.CreateAccountAction" > > > > name="accountSetupForm" > > > > scope="request" > > > >
html:button
frnds how to use Simple html:button to perform action in action class without using submit button - Sent from Yahoo! Mail. A Smarter Inbox.
Re: struts-default.properties
--- "Barron, Daniel" <[EMAIL PROTECTED]> wrote: > It is not clear to me - is the struts-default.properties just a template > for struts.properties or is it actually being loaded? I do not see it > being loaded in anyway and only see values from struts.properties being > used. Can anyone provide some insight on this please? AFAIK those properties are (now, anyway) in "default.properties" in the S2 core jar and can be overridden in a struts.properties on the classpath. That said, it's probably better to use XML constant configuration. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts-default.properties
It is not clear to me - is the struts-default.properties just a template for struts.properties or is it actually being loaded? I do not see it being loaded in anyway and only see values from struts.properties being used. Can anyone provide some insight on this please? Thanks in advance. Dan Barron Sr. SW Enginneer SOE [EMAIL PROTECTED] c:619.804.4926
Re: [S2] Menu Tag Library struts-config.xml problem.
I don't know about S2/Struts-Menu integration, but I guarantee you that blindly following instructions for an S1 application has no chance of working in a typical S2 application. Dave --- sassien <[EMAIL PROTECTED]> wrote: > > Hello all, > > I am used to JSF, and, trying to learn how to handle struts 2, I noticed > that there is no integrated tag to create menus (like richFaces, for > example). > So I found this library: "Struts-menu", which had initially been written > for > Struts 1. > http://struts-menu.sourceforge.net/userguide.html > http://struts-menu.sourceforge.net/userguide.html > I guess you guys know it and I wonder how you made it work. I found a few > threads on this subjects but they were not really helpful for me: > > according to the documentation, we have to configure the struts-config.xml > file. Ok, but I don't have any struts-config.xml file... I thought it was > not useful in struts 2. > Anyway, created one and I wrote this to reference the plugin: > > > > > > > > > Then I created the menu-config.xml file, with this code: > > > > > type="net.sf.navigator.displayer.TabbedMenuDisplayer"/> > > > > > > > > > > > > in summary, I did exactly what was written on the "userGuide" page. But I > still get this error that says that the menu repository could not be > obtained... > Looking on forums, I found that it could be because of a library, so I > tried > to add every library included in the sample application which we can > download on the same website. Nothing helps... > > By the way, this sample application does work, if I deploy it, but I cannot > find the way to make the menus work on my own project. Anyway, it seems > that > this sample application is made with struts 1, so it does not really help > in > my case. > > I guess that I am not the only one that have or will have this problem, so > maybe someone who did it can give a summary of how to configure this > library > on struts 2? > > Actually, I wonder if the application considers the "struts-config.xml" > file, as it has not been referenced anywhere... I tried to add something in > the "web.xml" file to reference it, but then everything crashed, so now I > might give up... actually I would already have done it if I had found an > other menu-library ;-) > > I hope someone will be able to answer my question, and I hope my text is > clear enough... :-) > regards, > sassien > -- > View this message in context: > http://www.nabble.com/-S2--Menu-Tag-Library-struts-config.xml-problem.-tp16447334p16447334.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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Strange behavior: Trying to implement saveToken() in display actions.
--- Martin Gainty <[EMAIL PROTECTED]> wrote: > Is there any reason (other than political) why you are using 1.3.8 instead > of 2.0.11+ > if your concerned about implement singleton servlet context then implement > your own FilterDispatcher e.g. > > public class MyFilterDispatcher extends FilterDispatcher { > > public void setFilterConfig(FilterConfig filterConfig) { > > //so you can achieve this objective using ServletContextSingleton class > ServletContextSingleton singleton = > ServletContextSingleton.getInstance(); > singleton.setServletContext(filterConfig.getServletContext()); I guess I'm not sure what that has to do with an S1 token issue; could you explain further? Dave > - Original Message - > From: "Doug Lochart" <[EMAIL PROTECTED]> > To: > Sent: Wednesday, April 02, 2008 6:43 AM > Subject: Re: Strange behavior: Trying to implement saveToken() in display > actions. > > > > I am just learning Struts. I think I may have forgotten some > > information that you might need in order to provide any help. I am > > using Struts 1.3.8, JDK 1.6, running on Tomcat 5.5. > > > > If my problem is SO SIMPLE and hence why I have heard silence then I > > am sorry but this is my first app and I so far what I have done looks > > like it should work. > > > > Does anyone have any ideas? > > > > regards, > > > > Doug Lochart > > > > On Tue, Apr 1, 2008 at 2:02 PM, Doug Lochart <[EMAIL PROTECTED]> wrote: > > > I am trying to implement a pattern so that I can use struts tokens to > > > help prevent double submission. I seem to be getting a strange > > > sequence of events that I don't quite follow. Here is what I want to > > > do at a high level > > > > > > displayCreateAccount -- forwards to --> CreateAccount.jsp (with form > > > action defined as /createAccount) > > > createAccount -- forwards to --> displayCreateAccountStep2 -- forwards > > > to --> CreateAccountStep2.jsp > > > > > > The actions that start with 'display' merely set the struts token (e.g > > > saveToken( request ); ) > > > Then it forwards it along to a jsp. > > > > > > The actions that start with 'Create' check to see if the token is > > > valid then it processes the form submission and then > > > forwards it to another display action which will then set the next > > > toke for the next display of a JSP. > > > > > > I have checked and rechecked all of my configs but I do not see a > > > mistake. I have also rebuilt the entire war > > > and cleaned out EVERYTHING in Tomcat but I get the same result. When > > > I hit the first displayCreateAccount action > > > it properly forwards control to the jsp page that is then presented. > > > When the form on the jsp page is submitted > > > the displayCreateAccountStep2 action is found (see log below) in the > > > mapping YET the original displayCreateAccount is executed. I have > > > turned on > > > debug of org.apache.struts. Here is my struts-config.xml and a > > > snippet of the logs showing what is happening. > > > > > > I am curious as to why this is happening. I really want to understand > > > what I am doing wrong or why it is working this way. > > > Please let me know if I need to supply any more supporting documents. > > > > > > thanks > > > > > > Doug > > > > > > snippet from struts-config.xml > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > type="capesafe.web.action.DisplayCreateAccountAction" > > > name="accountSetupForm" > > > scope="request" > > > cancellable="true" > > > validate="false"> > > > > > > > > > > > > > > type="capesafe.web.action.CreateAccountAction" > > > name="accountSetupForm" > > > scope="request" > > > cancellable="true" > > > input="display.create.account.1"> > > > > > >path="/WEB-INF/common/FailedLogon.jsp"/> > > >path="/WEB-INF/common/CancelLogon.jsp"/> > > > > > > > > > > > > type="capesafe.web.action.DisplayCreateAccountActionStep2" > > > name="accountSetupForm" > > > scope="request" > > > cancellable="true" > > > validate="false"> > > >path="display.create.account.2"/> > > > > > > > > > > > type="capesafe.web.action.CreateAccountActionStep2" > > > name="accountSetupFormStep2" > > > scope="request" > > > cancellable="true" > > > input="display.create.account.2"> > > > > > >path="/WEB-INF/common/FailedLogon.jsp"/> > > >path="/WEB-INF/common/CancelLogon.jsp"/> > > > > > > > > > > > > - > > > snippet from log > > > -- > > >
RE: Use Myeclipse
--- Jose Cardoso <[EMAIL PROTECTED]> wrote: > MyEclipse would solve your problem. Just for completeness, MyEclipse is, AFAIK, S2-unaware and would do nothing in particular to aid in S2 development. I'm sure this will change at some point, though. > -Original Message- > From: Sam Wun [mailto:[EMAIL PROTECTED] > Sent: 02 April 2008 14:17 > To: Struts Users Mailing List > Subject: Re: Eclipse with struts > > - Original Message > From: Dave Newton <[EMAIL PROTECTED]> > To: Struts Users Mailing List > Sent: Wednesday, April 2, 2008 11:46:06 PM > Subject: Re: Eclipse with struts > > --- Sam Wun <[EMAIL PROTECTED]> wrote: > > When I tried to follow the tutorial as shown in the following link: > > http://www.laliluna.de/first-steps-using-struts-tutorial.html > > > > my newly created project in Eclipse don't have Struts libraries in the > > > list. What should I do to import Struts in to Eclipse? > > >> Start by downloading Struts and importing the libraries you need into > > >> your project, probably into WEB-INF/lib. > Do you meant unzip the struts-xxx.zip file into the WEB-INF/lib/ folder? > or use File->Import in Eclipse or Weblogic? > > Thanks > Sam > > >> http://struts.apache.org/download.cgi#struts20111 > > Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Eclipse with struts
--- Sam Wun <[EMAIL PROTECTED]> wrote: > Do you meant unzip the struts-xxx.zip file into the WEB-INF/lib/ folder? > or use File->Import in Eclipse or Weblogic? You should File->Import only the specific S2/etc. libraries you need into WEB_INF/lib folder. In particular do *not* import plugin libraries you're not using, as they'll have library dependencies of their own. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
application folder name in webapps folder in tomcat through struts plugin
I have done this this requirement in org.apache.struts.action.PlugIn. Here also I am getting public void init(ActionServlet actionServlet, ModuleConfig config) throws ServletException { Properties _ini_config = new Properties(); try { String strContext=actionServlet.getServletContext().getServletContextName(); System.out.println("strContext="+strContext); } catch (Exception ex) { System.out.println("Error !"+ex); } } I have HelloServlet ,HelloServletContextListener in 3 different applications in tomcat webapps\AppHello1 webapps\AppHello2 webapps\AppHello3 How to identify in my listner class what is the folder/context name in my server. public void contextInitialized(ServletContextEvent ce) { contextName = ce.getServletContext().getServletContextName(); } This code is working only if i have AppHello1 in web.xml. If there is no in web.xml then above code in listner class is returning null. Is there facility to know application folder name in webapps folder in tomcat.
Regarding Service layer getting called twice
Hi all, i am using spring object factory action itself,service layer and Dao layer. Here, service layer method is getting called twice and due to that dao layer method is also called twice. Can any body tell me what can be the reason of it? This not happening service layer of all action. Like i have another action class which shares the same service layer but for that action service layer is not getting called twice. Following are the all configuration files: *1. test1-applicationContext.xml* *(My application context file for that test1 action)* http://www.springframework.org/dtd/spring-beans.dtd";> .. * * * * ** . *2. test2-applicationcontext.xml* *(application context file which is imported in above test1 for sharing service layer)* http://www.springframework.org/dtd/spring-beans.dtd";> . ** ** ** . . *3. struts-test1.xml (struts configuration file for test1'action)* ** http://struts.apache.org/dtds/struts-2.0.dtd "> showListing showListing,nextAllItemList,viewStatetaxMap /jsp/auctionpreview/success.jsp /jsp/auctionpreview/Main.jsp?page=auctionPreview /jsp/auctionpreview/success.jsp . /jsp/listing/PaymentSuccess.jsp?page=listing /jsp/listing/PaymentFailure.jsp?page=listing /jsp/listing/error.jsp?page=listing *4.struts-test1Stack.xml (interceptor stack config file)* http://struts.apache.org/dtds/struts-2.0.dtd "> Summary: Here *itemListingService(Service Layer) 's method is called twice and because of it itemListingDao (Dao layer)'s* *method is also called twice any it gives error like Invalid attempt to associate collection with two open session.* ** ** *Can anybody tell me why in test1 service layer is getting called twice.* ** ** *Please share your ideas,* ** *Thanx in advance.* ** *From * *Manish*
[S2] Menu Tag Library struts-config.xml problem.
Hello all, I am used to JSF, and, trying to learn how to handle struts 2, I noticed that there is no integrated tag to create menus (like richFaces, for example). So I found this library: "Struts-menu", which had initially been written for Struts 1. http://struts-menu.sourceforge.net/userguide.html http://struts-menu.sourceforge.net/userguide.html I guess you guys know it and I wonder how you made it work. I found a few threads on this subjects but they were not really helpful for me: according to the documentation, we have to configure the struts-config.xml file. Ok, but I don't have any struts-config.xml file... I thought it was not useful in struts 2. Anyway, created one and I wrote this to reference the plugin: Then I created the menu-config.xml file, with this code: in summary, I did exactly what was written on the "userGuide" page. But I still get this error that says that the menu repository could not be obtained... Looking on forums, I found that it could be because of a library, so I tried to add every library included in the sample application which we can download on the same website. Nothing helps... By the way, this sample application does work, if I deploy it, but I cannot find the way to make the menus work on my own project. Anyway, it seems that this sample application is made with struts 1, so it does not really help in my case. I guess that I am not the only one that have or will have this problem, so maybe someone who did it can give a summary of how to configure this library on struts 2? Actually, I wonder if the application considers the "struts-config.xml" file, as it has not been referenced anywhere... I tried to add something in the "web.xml" file to reference it, but then everything crashed, so now I might give up... actually I would already have done it if I had found an other menu-library ;-) I hope someone will be able to answer my question, and I hope my text is clear enough... :-) regards, sassien -- View this message in context: http://www.nabble.com/-S2--Menu-Tag-Library-struts-config.xml-problem.-tp16447334p16447334.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]
application folder name in webapps folder in tomcat.
I have HelloServlet ,HelloServletContextListener in 3 different applications in tomcat webapps\AppHello1 webapps\AppHello2 webapps\AppHello3 How to identify in my listner class what is the folder/context name in my server. public void contextInitialized(ServletContextEvent ce) { contextName = ce.getServletContext().getServletContextName(); } This code is working only if i have AppHello1 in web.xml. If there is no in web.xml then above code in listner class is returning null. Is there facility to know application folder name in webapps folder in tomcat.
Re: Optiontransferselect list issue
> Are you just missing the getter for user? Struts2 has to call > getUser().getGroups(). The action has getters and setters for both user and groups, and the user object has a getter/setter for its groups attribute. > I never have these two attributes pointing to the same property. It may > work, but it's the first place I'd look for type conversion problems. > My list attribute always points to a List with key and value entries for > the select and the name attribute always points to a String[] that will > contain the selected key values. Thanks for the pointer on that, I was wondering what the difference between them was; however, I don't think that is quite the issue in this case (yet). Taking your advice on having a String[] for the name attribute, I can do an and that collection displays its data, but when I have the JSP throws the same exception as the snippet that is causing headaches. Apr 2, 2008 10:33:18 AM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception tag 'updownselect', field 'list': The requested list key 'user.groups' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location] It is baffling me at this point because they are the same data type, and getters/setters exist for all the related objects... *scratches head* -Ryan Jeromy Evans - Blue Sky Minds wrote: > > ryangr wrote: > >> With that being said...I can populate the list "groups" just fine, but >> when >> I try to use "user.groups" to get the other list it throws an exception >> that >> says: "The requested list key 'user.groups' could not be resolved as a >> collection/array/map/enumeration/iterator type." What am I doing wrong? >> It's >> probably pretty obvious, but this hasn't exactly been a good week for >> concentration so far. ;) >> > > Are you just missing the getter for user? Struts2 has to call > getUser().getGroups(). > > >> I have the following for code in my JSP: >> >> > name="user.groups" >> list="user.groups" > > I never have these two attributes pointing to the same property. It may > work, but it's the first place I'd look for type conversion problems. > My list attribute always points to a List with key and value entries for > the select and the name attribute always points to a String[] that will > contain the selected key values. > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Optiontransferselect-list-issue-tp16424054p16447314.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: Use Myeclipse
MyEclipse would solve your problem. -Original Message- From: Sam Wun [mailto:[EMAIL PROTECTED] Sent: 02 April 2008 14:17 To: Struts Users Mailing List Subject: Re: Eclipse with struts - Original Message From: Dave Newton <[EMAIL PROTECTED]> To: Struts Users Mailing List Sent: Wednesday, April 2, 2008 11:46:06 PM Subject: Re: Eclipse with struts --- Sam Wun <[EMAIL PROTECTED]> wrote: > When I tried to follow the tutorial as shown in the following link: > http://www.laliluna.de/first-steps-using-struts-tutorial.html > > my newly created project in Eclipse don't have Struts libraries in the > list. What should I do to import Struts in to Eclipse? >> Start by downloading Struts and importing the libraries you need into >> your project, probably into WEB-INF/lib. Do you meant unzip the struts-xxx.zip file into the WEB-INF/lib/ folder? or use File->Import in Eclipse or Weblogic? Thanks Sam >> http://struts.apache.org/download.cgi#struts20111 Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com * Working Together for a Better Tower Hamlets Web site : http://www.towerhamlets.gov.uk London Borough of Tower Hamlets E-Mail Disclaimer. This communication and any attachments are intended for the addressee only and may be confidential. It may contain privileged and confidential information and if you are not the intended recipient, you must not copy, distribute or take any action in reliance on it. If you have received this E-Mail in error please notify us as soon as possible and delete this E-Mail and any attachments. This message has been checked for viruses, however we cannot guarantee that this message or any attachment is virus free or has not been intercepted or amended. The information contained in this E-Mail may be subject to public disclosure under the Freedom of Information Act 2000. Unless the information is legally exempt from disclosure, the Confidentiality of this E-Mail and your reply cannot be guaranteed. If your request relates to a Freedom of Information enquiry, please resend this to [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Eclipse with struts
- Original Message From: Dave Newton <[EMAIL PROTECTED]> To: Struts Users Mailing List Sent: Wednesday, April 2, 2008 11:46:06 PM Subject: Re: Eclipse with struts --- Sam Wun <[EMAIL PROTECTED]> wrote: > When I tried to follow the tutorial as shown in the following link: > http://www.laliluna.de/first-steps-using-struts-tutorial.html > > my newly created project in Eclipse don't have Struts libraries in the > list. What should I do to import Struts in to Eclipse? >> Start by downloading Struts and importing the libraries you need into your >> project, probably into WEB-INF/lib. Do you meant unzip the struts-xxx.zip file into the WEB-INF/lib/ folder? or use File->Import in Eclipse or Weblogic? Thanks Sam >> http://struts.apache.org/download.cgi#struts20111 Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com
Re: Strange behavior: Trying to implement saveToken() in display actions.
Doug- Is there any reason (other than political) why you are using 1.3.8 instead of 2.0.11+ if your concerned about implement singleton servlet context then implement your own FilterDispatcher e.g. public class MyFilterDispatcher extends FilterDispatcher { public void setFilterConfig(FilterConfig filterConfig) { //so you can achieve this objective using ServletContextSingleton class ServletContextSingleton singleton = ServletContextSingleton.getInstance(); singleton.setServletContext(filterConfig.getServletContext()); ? Martin - Original Message - From: "Doug Lochart" <[EMAIL PROTECTED]> To: Sent: Wednesday, April 02, 2008 6:43 AM Subject: Re: Strange behavior: Trying to implement saveToken() in display actions. > I am just learning Struts. I think I may have forgotten some > information that you might need in order to provide any help. I am > using Struts 1.3.8, JDK 1.6, running on Tomcat 5.5. > > If my problem is SO SIMPLE and hence why I have heard silence then I > am sorry but this is my first app and I so far what I have done looks > like it should work. > > Does anyone have any ideas? > > regards, > > Doug Lochart > > On Tue, Apr 1, 2008 at 2:02 PM, Doug Lochart <[EMAIL PROTECTED]> wrote: > > I am trying to implement a pattern so that I can use struts tokens to > > help prevent double submission. I seem to be getting a strange > > sequence of events that I don't quite follow. Here is what I want to > > do at a high level > > > > displayCreateAccount -- forwards to --> CreateAccount.jsp (with form > > action defined as /createAccount) > > createAccount -- forwards to --> displayCreateAccountStep2 -- forwards > > to --> CreateAccountStep2.jsp > > > > The actions that start with 'display' merely set the struts token (e.g > > saveToken( request ); ) > > Then it forwards it along to a jsp. > > > > The actions that start with 'Create' check to see if the token is > > valid then it processes the form submission and then > > forwards it to another display action which will then set the next > > toke for the next display of a JSP. > > > > I have checked and rechecked all of my configs but I do not see a > > mistake. I have also rebuilt the entire war > > and cleaned out EVERYTHING in Tomcat but I get the same result. When > > I hit the first displayCreateAccount action > > it properly forwards control to the jsp page that is then presented. > > When the form on the jsp page is submitted > > the displayCreateAccountStep2 action is found (see log below) in the > > mapping YET the original displayCreateAccount is executed. I have > > turned on > > debug of org.apache.struts. Here is my struts-config.xml and a > > snippet of the logs showing what is happening. > > > > I am curious as to why this is happening. I really want to understand > > what I am doing wrong or why it is working this way. > > Please let me know if I need to supply any more supporting documents. > > > > thanks > > > > Doug > > > > snippet from struts-config.xml > > > > > > > > > > > > > > > > > > > > > > > > > type="capesafe.web.action.DisplayCreateAccountAction" > > name="accountSetupForm" > > scope="request" > > cancellable="true" > > validate="false"> > > > > > > > > > type="capesafe.web.action.CreateAccountAction" > > name="accountSetupForm" > > scope="request" > > cancellable="true" > > input="display.create.account.1"> > > > > > > > > > > > > > type="capesafe.web.action.DisplayCreateAccountActionStep2" > > name="accountSetupForm" > > scope="request" > > cancellable="true" > > validate="false"> > > > > > > > > > type="capesafe.web.action.CreateAccountActionStep2" > > name="accountSetupFormStep2" > > scope="request" > > cancellable="true" > > input="display.create.account.2"> > > > > > > > > > > > > > > - > > snippet from log > > -- > > > > 42274 2008-04-01 13:38:12,979 DEBUG ModuleUtils - Get module name for > > path /displayCreateAccount.do > > 42274 2008-04-01 13:38:12,979 DEBUG ModuleUtils - Module name found: default > > 42274 2008-04-01 13:38:12,979 INFO ComposableRequestProcessor - > > Initializing composable request processor for module prefix '' > > 42274 2008-04-01 13:38:12,979 DEBUG ComposableRequestProcessor - > > setActionContextClassName: no className specified > > 42296 2008-04-01 13:38:13,001 DEBUG ComposableRequestProcessor - > > Using processing chain for this request > > 42296 2008-04
Re: Eclipse with struts
--- Sam Wun <[EMAIL PROTECTED]> wrote: > When I tried to follow the tutorial as shown in the following link: > http://www.laliluna.de/first-steps-using-struts-tutorial.html > > my newly created project in Eclipse don't have Struts libraries in the > list. What should I do to import Struts in to Eclipse? Start by downloading Struts and importing the libraries you need into your project, probably into WEB-INF/lib. http://struts.apache.org/download.cgi#struts20111 Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Security @ Struts2, using Acegy or Inspector
hi there I want to filter any .action in my cimande project and i want to give several database security to the action i just think this will become ACL for Struts2 but... I am also using Spring, anyone can help me is this better create my own interceptor (how to develop interceptor that can access my POJO like action did) or using acegy security any opinion welcome
[S2] checkboxes in each row of table - set values in action
Hello, I have the following problem: in action i have a collection of class User each class User have different attributes, one is: boolean permission in JSP I use struts 2 iterator tag to iterate the User Objects. For each User entry I create one row in table. for displaying/changing the boolean permission value I use S2 checkbox tag so far it works fine and show all data in collection of Users correct. But how can I set changed checkbox values (the permission attribute) back to action? Any help appreciated, thank you. basti -- View this message in context: http://www.nabble.com/-S2--checkboxes-in-each-row-of-table---set-values-in-action-tp16446895p16446895.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]
Eclipse with struts
Hi, I am new to Eclipse and Struts. When I tried to follow the tutorial as shown in the following link: http://www.laliluna.de/first-steps-using-struts-tutorial.html my newly created project in Eclipse don't have Struts libraries in the list. What should I do to import Struts in to Eclipse? Thanks S You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com
Re: Strange behavior: Trying to implement saveToken() in display actions.
I am just learning Struts. I think I may have forgotten some information that you might need in order to provide any help. I am using Struts 1.3.8, JDK 1.6, running on Tomcat 5.5. If my problem is SO SIMPLE and hence why I have heard silence then I am sorry but this is my first app and I so far what I have done looks like it should work. Does anyone have any ideas? regards, Doug Lochart On Tue, Apr 1, 2008 at 2:02 PM, Doug Lochart <[EMAIL PROTECTED]> wrote: > I am trying to implement a pattern so that I can use struts tokens to > help prevent double submission. I seem to be getting a strange > sequence of events that I don't quite follow. Here is what I want to > do at a high level > > displayCreateAccount -- forwards to --> CreateAccount.jsp (with form > action defined as /createAccount) > createAccount -- forwards to --> displayCreateAccountStep2 -- forwards > to --> CreateAccountStep2.jsp > > The actions that start with 'display' merely set the struts token (e.g > saveToken( request ); ) > Then it forwards it along to a jsp. > > The actions that start with 'Create' check to see if the token is > valid then it processes the form submission and then > forwards it to another display action which will then set the next > toke for the next display of a JSP. > > I have checked and rechecked all of my configs but I do not see a > mistake. I have also rebuilt the entire war > and cleaned out EVERYTHING in Tomcat but I get the same result. When > I hit the first displayCreateAccount action > it properly forwards control to the jsp page that is then presented. > When the form on the jsp page is submitted > the displayCreateAccountStep2 action is found (see log below) in the > mapping YET the original displayCreateAccount is executed. I have > turned on > debug of org.apache.struts. Here is my struts-config.xml and a > snippet of the logs showing what is happening. > > I am curious as to why this is happening. I really want to understand > what I am doing wrong or why it is working this way. > Please let me know if I need to supply any more supporting documents. > > thanks > > Doug > > snippet from struts-config.xml > > > > > > > > > > > > type="capesafe.web.action.DisplayCreateAccountAction" > name="accountSetupForm" > scope="request" > cancellable="true" > validate="false"> > > > > type="capesafe.web.action.CreateAccountAction" > name="accountSetupForm" > scope="request" > cancellable="true" > input="display.create.account.1"> > > > > > > type="capesafe.web.action.DisplayCreateAccountActionStep2" > name="accountSetupForm" > scope="request" > cancellable="true" > validate="false"> > > > > type="capesafe.web.action.CreateAccountActionStep2" > name="accountSetupFormStep2" > scope="request" > cancellable="true" > input="display.create.account.2"> > > > > > > > - > snippet from log > -- > > 42274 2008-04-01 13:38:12,979 DEBUG ModuleUtils - Get module name for > path /displayCreateAccount.do > 42274 2008-04-01 13:38:12,979 DEBUG ModuleUtils - Module name found: default > 42274 2008-04-01 13:38:12,979 INFO ComposableRequestProcessor - > Initializing composable request processor for module prefix '' > 42274 2008-04-01 13:38:12,979 DEBUG ComposableRequestProcessor - > setActionContextClassName: no className specified > 42296 2008-04-01 13:38:13,001 DEBUG ComposableRequestProcessor - > Using processing chain for this request > 42296 2008-04-01 13:38:13,001 DEBUG ActionCommandBase - Executing > org.apache.struts.chain.commands.ExceptionCatcher > 42296 2008-04-01 13:38:13,001 DEBUG ActionCommandBase - Executing > org.apache.struts.chain.commands.servlet.SelectLocale > 42296 2008-04-01 13:38:13,001 DEBUG AbstractSelectLocale - retrieve > config... > 42298 2008-04-01 13:38:13,003 DEBUG AbstractSelectLocale - set > context locale to en_US > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing > org.apache.struts.chain.commands.servlet.SetOriginalURI > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing > org.apache.struts.chain.commands.servlet.RequestNoCache > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing > org.apache.struts.chain.commands.servlet.SetContentType > 42299 2008-04-01 13:38:13,004 DEBUG ActionCommandBase - Executing > org.apache.struts.chain.commands.RemoveCachedMessages > 42300 2008-04-01 13:38:13,005 DEBUG ActionCo
Struts 2.1 TabbedPanel scenario
Hello, Here is the scenrio. I have two action classes. ClassA and ClassB. There is no relationship among these classes. You might say that if there is no relationship then why i have to put them in one single jsp. Well its a client's requirement. In a single jsp there are two tabs. Tab1ForClassA and Tab2ForClassB. Each tab has fields concerned to their classes as defined above. Tab1 -> ClassA and Tab2 -> ClassB. Can we do it? I have tried this but what happens is that when i submit the data on Tab1, Tab2's data becomes empty. So, any ideas will be highly appreciated. Furthermore, i am quite new to tabbed panel and would require clear tips and ideas. Thanks in advance, Shoaib Ahmad Gauhar -- View this message in context: http://www.nabble.com/Struts-2.1-TabbedPanel-scenario-tp16446729p16446729.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.xml
Can I have a second struts.xml in my test directory, and if so, how do I configure it? I'm testing some stuff using HttpUnit which launches the whole webapp in my tests. Having a test-only struts.xml will keep the test mappings out of the real webapp, allow me to drop stuff I don't need for the tests, and make the tests faster. Thanks Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with tutorial
Hi, > org.hibernate.AnnotationException: java.lang.NoSuchMethodException: As for me, such fragment says that you maybe made some miss typo with method name, in class or in Spring xml file Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with tutorial
Hello, I have been following your tutorial Struts 2 + Spring 2 + JPA + AJAX http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html. However, I have spent nearly 10 hours without figuring out why I keep getting this error after I followed all the steps in "Doing it yourself" in eclipse. What happend is I right clicked on quickstart project in eclipse and then --> run on server (tomcat) then this is what I see in browser: HTTP Status 404 - /quickstart/ Then I changed "run on server" to run jboss 4.2 then got this: 05:02:46,296 INFO [DefaultListableBeanFactory] Destroying singletons in [EMAIL PROTECTED]: defining beans [org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#0,personService,entityManagerFactory,dataSource,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.config.internalTransactionAdvisor,personAction]; root of factory hierarchy 05:02:46,328 ERROR [ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personService': Injection of persistence methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.ReflectionManager) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:323) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:966) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:462) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:170) I am bit lost feel like almost there but this last step screws me. Can anyone shed some light on this? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]