select box dynamic loads depends on another select box
Hi Guys, I have 2 select boxes. If user changes one select box, then data in second one should be changed and reload from database. So when user changes first select box, asynchronous action should be called and should get the data from data base and upload that data to select box. Sorry for my english. Thanks RS -- View this message in context: http://old.nabble.com/select-box-dynamic-loads-depends-on-another-select-box-tp27238090p27238090.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Migration from Struts1 to Struts2.1.6 - Plugin in Application Starup
Hi Raghu, i think You can do it with ServletContextListener, register it in web.xml like this: web-app ... listener listener-class com.package.MyListener /listener-class /listener /web-app and overwrite public void contextInitialized(ServletContextEvent context) method in MyListener that implements ServletContextListener. Best greetings, Paweł Wielgus. 2010/1/18 Raghuveer raghuve...@infotechsw.com: I need to migrate an application from struts1 to struts2.1.6. I had a plug-in configurations existing in Strut1 application related to SAP connection pool creation(CCreateSAPConnectionPlugin.java as shown below implementing org.apache.struts.action.PlugIn).This will create a SAP connection pool with connections. How this can be implemented through struts2.1.6. Is there a facility to implement custom plugin and to make it called dusting application startup. !-- == Declare Log Plugin =-- plug-in className=com.utc.test.loadonstatup..util.LogPlugin set-property property=devlLogConfigFile value=/log4j.properties/ /plug-in !-- == Declare SAP Plugin =-- plug-in className=com.utc.test.loadonstatup..util.CCreateSAPConnectionPlugin set-property property=devlSapConfigFile value=/config/config.properties/ /plug-in Regards, Raghu - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Hiding URL in struts1.2
Maybe you could use post method of Form to do this
Re: select box dynamic loads depends on another select box
Maybe you could use ajax technology to do that . There're some ajax frameworks , such as jQuery , which could help you !
How to convert request parameters into Collection type - Set
Hi, I need help in mapping JSP text fields to a setter in action class which have parameter as SetString I know Struts 2 supports automatically converting sets of request parameters into properties of various Collection type Lists This can be done by having a setter in the action class as - setMiddleNames(ArrayListString middleNames) JSP code should contain text fields as follows:- s:textfield name=middleNames[0] label=middleNames/ s:textfield name=middleNames[1] label=middleNames/ s:textfield name=middleNames[2] label=middleNames/ Question :- How to map JSP text Fields or Hidden fields to setters in Action class which have parameter as SetString For example, how should I define text fields in JSP so that they can be mapped to the following setter in Action Class:- setMiddleNames(SetString) Thanks, Nitin Mittal Deloitte Consulting India Private Limited cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | Fax:+91 22 66445999 nimit...@deloitte.com • Please consider the environment before printing. This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]
RE: Problem with s:property / tag
Hi Friends, Convert it into HTML. How to convert ? Thank you, Srikanth V srikan...@kensium.com Main: 877 KENSIUM (536.7486) India Main: +91 9949495511 India Fax: +91 4023704282 Kensium 200 S Wacker Dr, Suite 3100 Chicago, IL 60606 Confidentiality Note: - The information contained in this e-mail is strictly confidential and for the intended use of the addressee only. Any disclosure, use or copying of the information by anyone other than the intended recipient is prohibited. If you have received this message in error, please notify the sender immediately by return e-mail and securely discard this message. -Original Message- From: VSGoud [mailto:srikanthgou...@yahoo.co.in] Sent: Monday, January 18, 2010 7:16 PM To: user@struts.apache.org Subject: Re: Problem with s:property / tag Hi, Using pre tag it is working. thanks. Srikanth Nils-Helge Garli wrote: Putting it inside pre tag might also work. Nils-H On Mon, Jan 18, 2010 at 2:12 PM, Dave Newton newton.d...@yahoo.com wrote: VSGoud wrote: Facing problem with s:property / tag. when i fetch the data from one of the columns in a given table, I am able to view the certain parts of the fetched data in new lines in s:textarea / tag. But, when i tried to view the same fetched data through s:property / tag, the text isn't appearing in new lines. On viewing the fetched data in sql file the text is appended with \r\n\r\n in it. So i guess these ( \r\n\r\n) are not playing any role with s:property / tag where as it is working normally or as desired with s:textarea / tag Convert it into HTML. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://old.nabble.com/Problem-with-%3Cs%3Aproperty--%3E-tag-tp27209967p27210 696.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How to convert request parameters into Collection type - Set
simply loose the [n] just have all fields with name middleNames On Wed, Jan 20, 2010 at 8:34 PM, Mittal, Nitin (US - Mumbai) nimit...@deloitte.com wrote: Hi, I need help in mapping JSP text fields to a setter in action class which have parameter as SetString I know Struts 2 supports automatically converting sets of request parameters into properties of various Collection type Lists This can be done by having a setter in the action class as - setMiddleNames(ArrayListString middleNames) JSP code should contain text fields as follows:- s:textfield name=middleNames[0] label=middleNames/ s:textfield name=middleNames[1] label=middleNames/ s:textfield name=middleNames[2] label=middleNames/ Question :- How to map JSP text Fields or Hidden fields to setters in Action class which have parameter as SetString For example, how should I define text fields in JSP so that they can be mapped to the following setter in Action Class:- setMiddleNames(SetString) Thanks, Nitin Mittal Deloitte Consulting India Private Limited cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | Fax:+91 22 66445999 nimit...@deloitte.com • Please consider the environment before printing. This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]
Re: select box dynamic loads depends on another select box
Maybe this helps you. http://code.google.com/p/struts2-jquery/wiki/SelectTag#A_simple_Doubleselect_with_Topics Best Regards Johannes Geppert nani2ratna wrote: Hi Guys, I have 2 select boxes. If user changes one select box, then data in second one should be changed and reload from database. So when user changes first select box, asynchronous action should be called and should get the data from data base and upload that data to select box. Sorry for my english. Thanks RS - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep -- View this message in context: http://old.nabble.com/select-box-dynamic-loads-depends-on-another-select-box-tp27238090p27241877.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
How to convert request parameters into Collection type - Set
Hi, I need help in mapping JSP text fields to a setter in action class which have parameter as SetString I know Struts 2 supports automatically converting sets of request parameters into properties of various Collection type Lists This can be done by having a setter in the action class as - setMiddleNames(ArrayListString middleNames) JSP code should contain text fields as follows:- s:textfield name=middleNames[0] label=middleNames/ s:textfield name=middleNames[1] label=middleNames/ s:textfield name=middleNames[2] label=middleNames/ Question :- How to map JSP text Fields or Hidden fields to setters in Action class which have parameter as SetString For example, how should I define text fields in JSP so that they can be mapped to the following setter in Action Class:- setMiddleNames(SetString) Thanks, Nitin Mittal Deloitte Consulting India Private Limited cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | Fax:+91 22 66445999 nimit...@deloitte.com • Please consider the environment before printing. This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]
[Struts 2] OGNL debug console not working
Hi, I am trying to run the debug console that is available in a popup when you append the URL with ?debug=console It is described here : http://struts.apache.org/2.0.14/docs/debugging.html Here is the URL i used : http://localhost:8085/myWebApp/doLogin.action?debug.console It complains that it cannot create a session after the response was sent. As a consequence, i believe, the console is read only, I cannot type anything. What did i do wrong or what am i missing ? Thanks for helping. Here is the stack trace i get : Struts Problem Report Struts has detected an unhandled exception: # Messages: Impossible de cr�er une sessionapr�s que la r�ponse ait �t� envoy�e File: org/apache/catalina/connector/Request.java Line number: 2 338 Stacktraces java.lang.IllegalStateException: Impossible de creer une session apres que la reponse ait ete envoyee org.apache.catalina.connector.Request.doGetSession(Request.java:2338) org.apache.catalina.connector.Request.getSession(Request.java:2094) org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833) javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216) org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:179) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:272) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Unknown Source) You are seeing this page
Re: validation in struts2
the form tag is wrong? try: s:form action=doLogin namespace=/tricky 2010/1/19 Shasha sarada.i...@yahoo.com: Hi All, I am not able to get the validation errors from Login-validation.xml when i am using Modeldriven . Login-validation.xml 1. !DOCTYPE validators PUBLIC 2. -//OpenSymphony Group//XWork Validator 1.0.2//EN 3. http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd; 4. 5. validators 6. field name=username 7. field-validator type=requiredstring 8. message key=requiredstring/ 9. /field-validator 10. /field 11. field name=password 12. field-validator type=requiredstring 13. message key=requiredstring/ 14. /field-validator 15. /field 16. /validators LoginAction.java 1. public class LoginAction extends ActionSupport implements ModelDriven,SessionAware{ 2. 3. private User user = new User(); 4. private Map session; 5. private UserDAO userDAO = new UserDAOImpl(); 6. 7. public String execute() throws Exception { 8. 9. boolean success=userDAO.verifyUser(user); 10. if (success) 11. return SUCCESS; 12. else 13. return ERROR; 14. } 15. 16. public Object getModel() { 17. return user; 18. } 19. 20. public void setSession(Map session) { 21. this.session=session; 22. } 23. 24. public Map getSession() { 25. return session; 26. } 27. 28. } login.jsp 1. %@ taglib prefix=s uri=/struts-tags % 2. html 3. head 4. titleStruts 2 Login Application!/title 5. 6. link href=s:url value=/css/main.css/ rel=stylesheet type=text/css/ 7. 8. /head 9. body 10. s:form action=doLogin.action method=POST 11. tr 12. td colspan=2Login/td 13. /tr 14. tr 15. td colspan=2 16. s:actionerror / 17. s:fielderror / 18. /td 19. /tr 20. 21. s:textfield name=username label=Login name/ 22. s:password name=password label=Password/ 23. s:submit value=Login align=center/ 24. 25. /s:form 26. 27. /body 28. 29. /html http://old.nabble.com/file/p27236040/error.jpg -- View this message in context: http://old.nabble.com/validation-in-struts2-tp27236040p27236040.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
getText() from login.properties but not packages.properties
Good morning, I created login.properties that contains username.required=Username cannot be empty. If I rename this file to packages.properties, the system always return the text message, but if the name is not that, the message never returned. May I know if I want struts2 read login.properties: (1) where should the login.properties saved? (2) Do I need any setup in strut.xml or web.xml to getText(username.required) from login.properties? Thanks a lot! -- Lu Ying - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: select box dynamic loads depends on another select box
nani2ratna wrote: I have 2 select boxes. If user changes one select box, then data in second one should be changed and reload from database. I believe http://struts.apache.org/2.1.8.1/docs/doubleselect.html sends it all in the original page rather than using subsequent asynchronous requests... -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: validation in struts2
Also, the file should be LoginAction-validation.xml . Use the config-browser to see that you have the validators in place. Chris -Original Message- From: Gabriel Belingueres belingue...@gmail.com To: Struts Users Mailing List user@struts.apache.org Sent: Wed, Jan 20, 2010 10:12 am Subject: Re: validation in struts2 the form tag is wrong? try: s:form action=doLogin namespace=/tricky 2010/1/19 Shasha sarada.i...@yahoo.com: Hi All, I am not able to get the validation errors from Login-validation.xml when i am using Modeldriven . Login-validation.xml 1. !DOCTYPE validators PUBLIC 2. -//OpenSymphony Group//XWork Validator 1.0.2//EN 3. http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd; 4. 5. validators 6. field name=username 7. field-validator type=requiredstring 8. message key=requiredstring/ 9. /field-validator 10. /field 11. field name=password 12. field-validator type=requiredstring 13. message key=requiredstring/ 14. /field-validator 15. /field 16. /validators LoginAction.java 1. public class LoginAction extends ActionSupport implements ModelDriven,SessionAware{ 2. 3. private User user = new User(); 4. private Map session; 5. private UserDAO userDAO = new UserDAOImpl(); 6. 7. public String execute() throws Exception { 8. 9. boolean success=userDAO.verifyUser(user); 10. if (success) 11. return SUCCESS; 12. else 13. return ERROR; 14. } 15. 16. public Object getModel() { 17. return user; 18. } 19. 20. public void setSession(Map session) { 21. this.session=session; 22. } 23. 24. public Map getSession() { 25. return session; 26. } 27. 28. } login.jsp 1. %@ taglib prefix=s uri=/struts-tags % 2. html 3. head 4. titleStruts 2 Login Application!/title 5. 6. link href=s:url value=/css/main.css/ rel=stylesheet type=text/css/ 7. 8. /head 9. body 10. s:form action=doLogin.action method=POST 11. tr 12. td colspan=2Login/td 13. /tr 14. tr 15.td colspan=2 16. s:actionerror / 17. s:fielderror / 18./td 19. /tr 20. 21. s:textfield name=username label=Login name/ 22. s:password name=password label=Password/ 23. s:submit value=Login align=center/ 24. 25. /s:form 26. 27. /body 28. 29. /html http://old.nabble.com/file/p27236040/error.jpg -- View this message in context: http://old.nabble.com/validation-in-struts2-tp27236040p27236040.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Session help
I've read the entire thread, and I'm still a bit confused. Are you just trying to copy 'barbados' (or whatever is in the path) from the URL into a session variable? That sounds pretty easy to do. I would probably use a Filter, but there would really only be one extra step if you do it in an interceptor. //Inside the class body public static final String ISLAND_NAME_KEY = island_name_key; //Inside the filter or interceptor method: HttpServletRequest request = ServletActionContext.getRequest(); //Not needed if you do this in a filter HttpSession session = request.getSession(); String islandName = (String) session.getAttribute(ISLAND_NAME_KEY); if (islandName == null) { String servletPath = request.getServletPath(); //Find 'barbados', 'antigua', etc. in the servletPath using a string tokenizer, regex, etc. islandName = findIslandName(servletPath); //getting the island name from the servlet path is left as an exercise for the reader session.setAttribute(ISLAND_NAME_KEY, islandName); } Hope this helps, -Brian On Wed, Jan 20, 2010 at 1:40 AM, emil thushanga thusha...@gmail.com wrote: Hi Thanks for the solutions. i prefer to do it in interceptors way. if any resources available for me to grab the thing please let me know. any way thanks a lot. Emil On Wed, Jan 20, 2010 at 1:25 PM, Dale Newfield d...@newfield.org wrote: emil thushanga wrote: if namespace is 'Barbados' session ='Barbados' if namespace is 'Antigua' session ='Antigua' One simple way to do this would be to write an interceptor that takes the namespace from the action mapping and sets the appropriate value in session scope. -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Emil Thushanga
Re: Hiding URL in struts1.2
I would look into using URLRewrite [1]. It would be easy to go from showing this in the browser: http://localhost:8180/webproject/showHome to the application processing this: http://localhost:8180/webproject/loginv.do?dispmethd=showHome [1] - http://tuckey.org/urlrewrite/ On Wed, Jan 20, 2010 at 5:23 AM, chen thomas thomasche...@gmail.com wrote: Maybe you could use post method of Form to do this
Re: Session help
emil thushanga wrote: Thanks for the solutions. i prefer to do it in interceptors way. if any resources available for me to grab the thing please let me know. any way thanks a lot. A good place to start: http://struts.apache.org/2.1.8.1/docs/interceptors.html and http://struts.apache.org/2.1.8.1/docs/writing-interceptors.html Examples that should help: This one accesses the action mapping: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ActionMappingParametersInteceptor.java This one accesses the session: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How to convert request parameters into Collection type - Set
That might work for Set's where order isn't important, but how would you populate a Liist? I've never had good luck there. (*Chris*) On Wed, Jan 20, 2010 at 5:18 AM, Steven Yang kenshin...@gmail.com wrote: simply loose the [n] just have all fields with name middleNames On Wed, Jan 20, 2010 at 8:34 PM, Mittal, Nitin (US - Mumbai) nimit...@deloitte.com wrote: Hi, I need help in mapping JSP text fields to a setter in action class which have parameter as SetString I know Struts 2 supports automatically converting sets of request parameters into properties of various Collection type Lists This can be done by having a setter in the action class as - setMiddleNames(ArrayListString middleNames) JSP code should contain text fields as follows:- s:textfield name=middleNames[0] label=middleNames/ s:textfield name=middleNames[1] label=middleNames/ s:textfield name=middleNames[2] label=middleNames/ Question :- How to map JSP text Fields or Hidden fields to setters in Action class which have parameter as SetString For example, how should I define text fields in JSP so that they can be mapped to the following setter in Action Class:- setMiddleNames(SetString) Thanks, Nitin Mittal Deloitte Consulting India Private Limited cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | Fax:+91 22 66445999 nimit...@deloitte.com • Please consider the environment before printing. This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]
Re: getText() from login.properties but not packages.properties
Please read documentation, everything is explained there. http://struts.apache.org/2.1.8.1/docs/localization.html http://struts.apache.org/2.1.8.1/docs/strutsproperties.html Regards -- Lukasz Kapituła Javarsovia 2010 http://javarsovia.pl - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Resrouce bundles intermittently not getting loaded when in clustered environment
I am not sure whether it is directly a Struts problem but I'm hoping someone will be able to suggest a way around. I have the following in my struts.properties file: struts.custom.i18n.resources=MyResource MyResource.properties resides in WEB-INF/classes of my application. In my JSP I simply do the following: s:text name=my.text.label1/ Everything seems to work but sometimes we literally see 'my.text.label1' in the browser instead of seeing the value. Once this happens...it stays for the whole session. we close the browser...open new window (session) and then most of the time it goes away. so it is really intermittent. We are in a clustered environment where multiple Struts2 applications are deployed on Glassfish server and all the WAR applications share the struts2-core.jar. We have noticed that this error goes away when following properties are placed in struts.properties: struts.devMode = true struts.i18n.reload= true the above properties will reload the resource bundles on each request. We do not want to do this in production. So I finding out what are some other alternative ways of access properties file in struts2? Will placing them in ActionClasses make a difference? Thanks! -bhaarat
RE: How to convert request parameters into Collection type - Set
Ok, so I want to understand how that would work if Set contains elements of a complex type,like Address as follows: setAddresses(SetAddress adresses) Inthis case, Jsp should define text fields as follows: addresses.city addresses.state adresses.city addresses.state How would struts arrange the fields above into a set of Address objects, associating right combination of city and state for each Address Nitin Mittal, Deloitte Consulting India Pvt. Ltd Tel: + 91 9819213942(mobile) nimit...@deloitte.com - Original Message - From: Steven Yang kenshin...@gmail.com Sent: 20 January 2010 6:49 PM To: Struts Users Mailing List user@struts.apache.org Subject: Re: How to convert request parameters into Collection type - Set simply loose the [n] just have all fields with name middleNames On Wed, Jan 20, 2010 at 8:34 PM, Mittal, Nitin (US - Mumbai) nimit...@deloitte.com wrote: Hi, I need help in mapping JSP text fields to a setter in action class which have parameter as SetString I know Struts 2 supports automatically converting sets of request parameters into properties of various Collection type Lists This can be done by having a setter in the action class as - setMiddleNames(ArrayListString middleNames) JSP code should contain text fields as follows:- s:textfield name=middleNames[0] label=middleNames/ s:textfield name=middleNames[1] label=middleNames/ s:textfield name=middleNames[2] label=middleNames/ Question :- How to map JSP text Fields or Hidden fields to setters in Action class which have parameter as SetString For example, how should I define text fields in JSP so that they can be mapped to the following setter in Action Class:- setMiddleNames(SetString) Thanks, Nitin Mittal Deloitte Consulting India Private Limited cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | Fax:+91 22 66445999 nimit...@deloitte.com • Please consider the environment before printing. This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1] - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: getText() from login.properties but not packages.properties
Lukasz Lenart wrote: Please read documentation, everything is explained there. http://struts.apache.org/2.1.8.1/docs/localization.html http://struts.apache.org/2.1.8.1/docs/strutsproperties.html This did not answer my question :( Using package.properties works fine for me. The problem is how to read value from login.properties file? How does struts2 recognize login.properties? Thanks -- Lu Ying - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: getText() from login.properties but not packages.properties
login.properties has to be mentioned in you struts.properties file as struts.custom.i18n.resources=login Above means that login.properties resides in WEB-INF/classes On Wed, Jan 20, 2010 at 1:47 PM, Emi Lu em...@encs.concordia.ca wrote: Lukasz Lenart wrote: Please read documentation, everything is explained there. http://struts.apache.org/2.1.8.1/docs/localization.html http://struts.apache.org/2.1.8.1/docs/strutsproperties.html This did not answer my question :( Using package.properties works fine for me. The problem is how to read value from login.properties file? How does struts2 recognize login.properties? Thanks -- Lu Ying - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Interceptor to load properties file
I am using this approach to load properties http://struts.apache.org/2.0.14/docs/how-do-i-set-a-global-resource-bundle.html I want to load the properties on each request (without turning the devmode = true). How should I go about this? Should I turn ActionGlobalMessagesListener into an interceptor?
[Struts 2] ?debug=console (devMode) not working
Hi, I am trying to run the debug console that is available in a popup when you append the URL with ?debug=console It is described here : http://struts.apache.org/2.0.14/docs/debugging.html Here is the URL i used : http://localhost:8085/myWebApp/doLogin.action?debug.console It complains that it cannot create a session after the response was sent. What did i do wrong or what am i missing ? Thanks for helping. Here is the stack trace i get : Struts Problem Report Struts has detected an unhandled exception: # Messages: Impossible de cr�er une sessionapr�s que la r�ponse ait �t� envoy�e File: org/apache/catalina/connector/Request.java Line number:2 338 Stacktraces java.lang.IllegalStateException: Impossible de creer une session apres que la reponse ait ete envoyee org.apache.catalina.connector.Request.doGetSession(Request.java:2338) org.apache.catalina.connector.Request.getSession(Request.java:2094) org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833) javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216) org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:179) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:272) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Unknown Source) You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra
RE: How to convert request parameters into Collection type - Set
Try as below. s:iterator value=addresses status=row s:textfield name=addresses[%{#row.index}].city name=%{city} / s:textfield name=addresses[%{#row.index}].state name=%{state} / /s:iterator Regards, Raghuveer Vellanki -Original Message- From: Mittal, Nitin (US - Mumbai) [mailto:nimit...@deloitte.com] Sent: Wednesday, January 20, 2010 10:54 PM To: Struts Users Mailing List Subject: RE: How to convert request parameters into Collection type - Set Ok, so I want to understand how that would work if Set contains elements of a complex type,like Address as follows: setAddresses(SetAddress adresses) Inthis case, Jsp should define text fields as follows: addresses.city addresses.state adresses.city addresses.state How would struts arrange the fields above into a set of Address objects, associating right combination of city and state for each Address Nitin Mittal, Deloitte Consulting India Pvt. Ltd Tel: + 91 9819213942(mobile) nimit...@deloitte.com - Original Message - From: Steven Yang kenshin...@gmail.com Sent: 20 January 2010 6:49 PM To: Struts Users Mailing List user@struts.apache.org Subject: Re: How to convert request parameters into Collection type - Set simply loose the [n] just have all fields with name middleNames On Wed, Jan 20, 2010 at 8:34 PM, Mittal, Nitin (US - Mumbai) nimit...@deloitte.com wrote: Hi, I need help in mapping JSP text fields to a setter in action class which have parameter as SetString I know Struts 2 supports automatically converting sets of request parameters into properties of various Collection type Lists This can be done by having a setter in the action class as - setMiddleNames(ArrayListString middleNames) JSP code should contain text fields as follows:- s:textfield name=middleNames[0] label=middleNames/ s:textfield name=middleNames[1] label=middleNames/ s:textfield name=middleNames[2] label=middleNames/ Question :- How to map JSP text Fields or Hidden fields to setters in Action class which have parameter as SetString For example, how should I define text fields in JSP so that they can be mapped to the following setter in Action Class:- setMiddleNames(SetString) Thanks, Nitin Mittal Deloitte Consulting India Private Limited cell:+91 9819213942 | office:+91 22 66445762 | VOIP:+1 615-718-8170 | Fax:+91 22 66445999 nimit...@deloitte.com . Please consider the environment before printing. This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1] - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: [Struts 2] OGNL debug console not working
That would work only when you enable it in configuration Either in struts.properties or struts.xml Example: in struts.properties set devmode to true.. struts.devMode=true -Original Message- From: Celinio Fernandes [mailto:cel...@yahoo.com] Sent: Wednesday, January 20, 2010 7:41 PM To: Struts Users Mailing List Subject: [Struts 2] OGNL debug console not working Hi, I am trying to run the debug console that is available in a popup when you append the URL with ?debug=console It is described here : http://struts.apache.org/2.0.14/docs/debugging.html Here is the URL i used : http://localhost:8085/myWebApp/doLogin.action?debug.console It complains that it cannot create a session after the response was sent. As a consequence, i believe, the console is read only, I cannot type anything. What did i do wrong or what am i missing ? Thanks for helping. Here is the stack trace i get : Struts Problem Report Struts has detected an unhandled exception: # Messages: Impossible de cr�er une sessionapr�s que la r�ponse ait �t� envoy�e File: org/apache/catalina/connector/Request.java Line number: 2 338 Stacktraces java.lang.IllegalStateException: Impossible de creer une session apres que la reponse ait ete envoyee org.apache.catalina.connector.Request.doGetSession(Request.java:2338) org.apache.catalina.connector.Request.getSession(Request.java:2094) org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:83 3) javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr apper.java:216) org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:179) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(Debu ggingInterceptor.java:272) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingIn terceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareIn terceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method FilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nIntercepto r.java:165) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletCon figInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasIntercep tor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(Ex ceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOper ations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilt er(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:206) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja va:96) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:235) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssoci ationValve.java:183) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java: 95) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(Secu rityContextEstablishmentValve.java:126) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(Secur ityContextEstablishmentValve.java:70) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127 ) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102 ) org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnecti onValve.java:158) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :109)
RE: validation in struts2
Your XML file needs to be renamed as,LoginAction-validation.xml -Original Message- From: Gabriel Belingueres [mailto:belingue...@gmail.com] Sent: Wednesday, January 20, 2010 8:43 PM To: Struts Users Mailing List Subject: Re: validation in struts2 the form tag is wrong? try: s:form action=doLogin namespace=/tricky 2010/1/19 Shasha sarada.i...@yahoo.com: Hi All, I am not able to get the validation errors from Login-validation.xml when i am using Modeldriven . Login-validation.xml 1. !DOCTYPE validators PUBLIC 2. -//OpenSymphony Group//XWork Validator 1.0.2//EN 3. http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd; 4. 5. validators 6. field name=username 7. field-validator type=requiredstring 8. message key=requiredstring/ 9. /field-validator 10. /field 11. field name=password 12. field-validator type=requiredstring 13. message key=requiredstring/ 14. /field-validator 15. /field 16. /validators LoginAction.java 1. public class LoginAction extends ActionSupport implements ModelDriven,SessionAware{ 2. 3. private User user = new User(); 4. private Map session; 5. private UserDAO userDAO = new UserDAOImpl(); 6. 7. public String execute() throws Exception { 8. 9. boolean success=userDAO.verifyUser(user); 10. if (success) 11. return SUCCESS; 12. else 13. return ERROR; 14. } 15. 16. public Object getModel() { 17. return user; 18. } 19. 20. public void setSession(Map session) { 21. this.session=session; 22. } 23. 24. public Map getSession() { 25. return session; 26. } 27. 28. } login.jsp 1. %@ taglib prefix=s uri=/struts-tags % 2. html 3. head 4. titleStruts 2 Login Application!/title 5. 6. link href=s:url value=/css/main.css/ rel=stylesheet type=text/css/ 7. 8. /head 9. body 10. s:form action=doLogin.action method=POST 11. tr 12. td colspan=2Login/td 13. /tr 14. tr 15. td colspan=2 16. s:actionerror / 17. s:fielderror / 18. /td 19. /tr 20. 21. s:textfield name=username label=Login name/ 22. s:password name=password label=Password/ 23. s:submit value=Login align=center/ 24. 25. /s:form 26. 27. /body 28. 29. /html http://old.nabble.com/file/p27236040/error.jpg -- View this message in context: http://old.nabble.com/validation-in-struts2-tp27236040p27236040.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Hiding URL in struts1.2
Could you elaborate your requirement? URL will be changed when you use action name= loginv class=com.test.actions.LoginAction !-- Home -- result name=app_home_action type=redirectAction showHome /result /action action name= showHome class=com.utc.pw.spanas.actions.CHome /action -Original Message- From: Brian Thompson [mailto:elephant...@gmail.com] Sent: Wednesday, January 20, 2010 9:13 PM To: Struts Users Mailing List Subject: Re: Hiding URL in struts1.2 I would look into using URLRewrite [1]. It would be easy to go from showing this in the browser: http://localhost:8180/webproject/showHome to the application processing this: http://localhost:8180/webproject/loginv.do?dispmethd=showHome [1] - http://tuckey.org/urlrewrite/ On Wed, Jan 20, 2010 at 5:23 AM, chen thomas thomasche...@gmail.com wrote: Maybe you could use post method of Form to do this - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Session help
Dear all, This thread was really helpful to me. i could accomplish it using interceptors as you guys mentioned. Thanks for the solution and the links. Lots of thanks Emil On Wed, Jan 20, 2010 at 9:47 PM, Dale Newfield d...@newfield.org wrote: emil thushanga wrote: Thanks for the solutions. i prefer to do it in interceptors way. if any resources available for me to grab the thing please let me know. any way thanks a lot. A good place to start: http://struts.apache.org/2.1.8.1/docs/interceptors.html and http://struts.apache.org/2.1.8.1/docs/writing-interceptors.html Examples that should help: This one accesses the action mapping: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ActionMappingParametersInteceptor.java This one accesses the session: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Emil Thushanga
Re: Hiding URL in struts1.2
HI, Thanks to all for your valuable sugestions Actually i want to hide all parameters form the Url actual Url's are like this : http://localhost:8280/mspui/custumerAuthrtn.do?dispmethd=custumerAuthorizeaccountNumber=12345 but I should get http://localhost:8280/mspui/ by hiding parameters in the url. this is already developed project and this is a enhancement. using post means i have to change much of code.is there any simple alternative way of acheiving this. Thanks in Advance Zaheer Mohammad On Thu, Jan 21, 2010 at 9:47 AM, Raghuveer raghuve...@infotechsw.comwrote: Could you elaborate your requirement? URL will be changed when you use action name= loginv class=com.test.actions.LoginAction !-- Home -- result name=app_home_action type=redirectAction showHome /result /action action name= showHome class=com.utc.pw.spanas.actions.CHome /action -Original Message- From: Brian Thompson [mailto:elephant...@gmail.com] Sent: Wednesday, January 20, 2010 9:13 PM To: Struts Users Mailing List Subject: Re: Hiding URL in struts1.2 I would look into using URLRewrite [1]. It would be easy to go from showing this in the browser: http://localhost:8180/webproject/showHome to the application processing this: http://localhost:8180/webproject/loginv.do?dispmethd=showHome [1] - http://tuckey.org/urlrewrite/ On Wed, Jan 20, 2010 at 5:23 AM, chen thomas thomasche...@gmail.com wrote: Maybe you could use post method of Form to do this - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: [Struts 2] OGNL debug console not working
I have done that of course, else i would not see the console in the popup. The problem is elsewhere. Does anyone have an idea ? Thanks. --- On Wed, 1/20/10, Raghuveer raghuve...@infotechsw.com wrote: From: Raghuveer raghuve...@infotechsw.com Subject: RE: [Struts 2] OGNL debug console not working To: 'Celinio Fernandes' cel...@yahoo.com, 'Struts Users Mailing List' user@struts.apache.org Date: Wednesday, January 20, 2010, 8:07 PM That would work only when you enable it in configuration Either in struts.properties or struts.xml Example: in struts.properties set devmode to true.. struts.devMode=true -Original Message- From: Celinio Fernandes [mailto:cel...@yahoo.com] Sent: Wednesday, January 20, 2010 7:41 PM To: Struts Users Mailing List Subject: [Struts 2] OGNL debug console not working Hi, I am trying to run the debug console that is available in a popup when you append the URL with ?debug=console It is described here : http://struts.apache.org/2.0.14/docs/debugging.html Here is the URL i used : http://localhost:8085/myWebApp/doLogin.action?debug.console It complains that it cannot create a session after the response was sent. As a consequence, i believe, the console is read only, I cannot type anything. What did i do wrong or what am i missing ? Thanks for helping. Here is the stack trace i get : Struts Problem Report Struts has detected an unhandled exception: # Messages: Impossible de cr�er une sessionapr�s que la r�ponse ait �t� envoy�e File: org/apache/catalina/connector/Request.java Line number: 2 338 Stacktraces java.lang.IllegalStateException: Impossible de creer une session apres que la reponse ait ete envoyee org.apache.catalina.connector.Request.doGetSession(Request.java:2338) org.apache.catalina.connector.Request.getSession(Request.java:2094) org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:83 3) javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr apper.java:216) org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:179) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(Debu ggingInterceptor.java:272) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingIn terceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareIn terceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method FilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nIntercepto r.java:165) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletCon figInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasIntercep tor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(Ex ceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:237) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOper ations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilt er(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:206) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja va:96) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:235) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssoci ationValve.java:183) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java: 95) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(Secu rityContextEstablishmentValve.java:126)
Re: [Struts 2] ?debug=console (devMode) not working
2010/1/20 Fernandes Celinio cfernan...@sopraconsulting.com: Hi, I am trying to run the debug console that is available in a popup when you append the URL with ?debug=console It is described here : http://struts.apache.org/2.0.14/docs/debugging.html Here is the URL i used : http://localhost:8085/myWebApp/doLogin.action?debug.console It complains that it cannot create a session after the response was sent. What did i do wrong or what am i missing ? Try first time open that url directly without any params, then try to use ?debug=console param - session should be already created by first request. Regards -- Lukasz http://www.lenart.org.pl/ Kapituła Javarsovia 2010 http://javarsovia.pl - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org