Re: advice on building front-end rapidly
http://netbeans.org On Nov 8, 2009, at 4:32 PM, Farshad Rabbani wrote: Hi Dave, Why?! At the very least why wouldn't you use something that can edit and understand JSP, custom tags, etc.? So, what would your recommend as something to edit and understand JSP, custom tags etc.? That's what themes and templates are for. Do you have any specific resources you can guide me to with regards to themes and templates? Thanks, Farshad _ Windows 7: Unclutter your desktop. http://go.microsoft.com/?linkid=9690331ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009 smime.p7s Description: S/MIME cryptographic signature
Re: action class is a part of controller or model; and what about formBean
Broadly speaking, the Controller is the filter, the Model is the action, and the result leads to the View. On Oct 12, 2009, at 5:58 AM, Arindam Rajbanshi wrote: i am doing struts 1.2 . Please tell me action is a part of controller or model. and formbean is a part of controller or model. even in the apache document http://struts.apache.org/1.x/userGuide/index.html tehy mentionde bormbean in Building Model Components and Building Controller Components in two places and action in Building Controller Components please clear my doubt. -- terry.gard...@sun.com Blog: http://ff1959.wordpress.com http://www.directory-server.org Mobile: 404 925 6385 smime.p7s Description: S/MIME cryptographic signature
Re: Proccessing parameters inside Struts action
s:form method=post action=MyAction /s:form In the commons classes at http://kenai.com/projects/commons, there is a class ServletUtils with the following code to extract parameters and place them into a Collection from a servlet request (which can be obtained via ServletActionContext.getRequest()): public static CollectionString getParameters(ServletRequest servletRequest) { CollectionString results = new ArrayListString(); Enumeration e = servletRequest.getParameterNames(); while(e.hasMoreElements()) { String parameterName = (String)e.nextElement(); results.add(parameterName); } return results; } On Oct 12, 2009, at 12:19 PM, Michael Varlik wrote: Hi, I'm using a Struts2 action to devliver JSON data. This action is calleb by an Ajax HTTP request. Now, I need to send some parameter along with the request. The sending of the parameters works fine but I don't know how to access them from within the struts action. So my question is: what is the proper way to pass POST parameters to a struts action and how do I retrieve them from within the action? Many thanks in advance. Cheers, Michael -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- terry.gard...@sun.com Blog: http://ff1959.wordpress.com http://www.directory-server.org Mobile: 404 925 6385 smime.p7s Description: S/MIME cryptographic signature
Re: SQL Optimization Tools and Procedures
If you have the code in a workable configuration, you can test it easily with a SQL query job using SLAMD (http://slamd2.dev.java.net). This generate load that may point to indexing problems and other performance-related problems. On Jun 19, 2009, at 11:16 AM, Edward Song wrote: Here's a Friday discussion. As an application developer, I can write SQL pretty well, but I wouldn't say that I'm an expert. My last project I did run into some design and architecture issues that needed a little bit of reworking and refactoring. To help avoid this, I want to get better and have more confidence moving forward in a project that my schema design has been optimized, or at least perform some excercise to let me know that I gave it a good effort. Any insights on how as application developers, we can perform some exercise with some tool at the early design phases that will help us give us confidence that our initial schema, indexes and queries are optimized? -- terry.gard...@sun.com Blog: http://blogs.sun.com/terrygardner Blog: http://ff1959.wordpress.com Twitter: http://twitter.com/tgardner SLAMD: http://slamd2.dev.java.net Skype: Terry_J_Gardner Potentia vobiscum smime.p7s Description: S/MIME cryptographic signature
SLAMD conversion to Struts
SLAMD (http://slamd2.dev.java.net) is being converted to use MVC via Struts. I've posted a blog entry describing the functionality with emphasis on Struts and interceptors at http://blogs.sun.com/terrygardner/entry/slamd_internals_functional . -- terry.gard...@sun.com Blog: http://blogs.sun.com/terrygardner Blog: http://ff1959.wordpress.com Twitter: http://twitter.com/tgardner SLAMD: http://slamd2.dev.java.net DSLA: http://kenai.com/projects/dsla Skype: Terry_J_Gardner smime.p7s Description: S/MIME cryptographic signature
Re: Struts 2 dispatcher does not see namespace and action in URL
I vaguely remember something about WebSphere and Apache commons logging ... will try to dig it up. On May 26, 2009, at 9:22 AM, Mitchell, Steven wrote: I have a Struts 2 application that runs fine under Tomcat 5.5 that will not run on a fully patched version of WebSphere 6.1. The application index.jsp page redirects to a mapped namespace and action, yet the Struts 2 dispatcher does not see the namespace or action. It issues the message There is no Action mapped for namespace / and action name . Note that the namespace and action name are missing. I have also tried manually typing a full URL containing a namespace and action, yet I get the same error message missing the namespace and action name. This has never happened on Tomcat 5.5 where the application functions normally. Has anybody run into this issue deploying an application on WebSphere? It happens with Struts 2.1.2, 2.1.3 snapshot, and 2.1.6. I'm out of ideas. [5/21/09 16:52:06:743 CDT] 002c XmlConfigurat I com.opensymphony.xwork2.util.logging.commons.CommonsLogger info Parsing configuration file [struts.xml] [5/21/09 16:52:07:101 CDT] 002c StrutsSpringO I com.opensymphony.xwork2.util.logging.commons.CommonsLogger info Initializing Struts-Spring integration... [5/21/09 16:52:07:113 CDT] 002c SpringObjectF I com.opensymphony.xwork2.util.logging.commons.CommonsLogger info Setting autowire strategy to name [5/21/09 16:52:07:111 CDT] 002c StrutsSpringO I com.opensymphony.xwork2.util.logging.commons.CommonsLogger info ... initialized Struts-Spring integration successfully [5/21/09 16:52:08:817 CDT] 002c DispatcherW com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn Could not find action or result There is no Action mapped for namespace / and action name . - [unknown location] at com .opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.ja va:177) at org .apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java :61) at org .apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(Strut sActionProxyFactory.java:39) at com .opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(Defa ultActionProxyFactory.java:47) at org .apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:4 57) at org .apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher .java:395) at com .ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInst anceWrapper.java:190) at com .ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterCh ain.java:130) at com .ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterC hain.java:87) at com .ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilter Manager.java:832) at com .ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppF ilterManager.java:742) at com .ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppF ilterManager.java:695) at com .ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAp pFilterManager.java:101) at com .ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilter s(DefaultExtensionProcessor.java:818) at com .ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleReques t(DefaultExtensionProcessor.java:557) at com .ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequ est(DefaultExtensionProcessor.java:113) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java: 267) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java: 815 ) at com .ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1 461) at com .ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:1 18) at com .ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscriminatio n(HttpInboundLink.java:458) at com .ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformatio n(HttpInboundLink.java:387) at com .ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLi nk.java:267) at com .ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscr iminators(NewConnectionInitialReadCallback.java:214) at com .ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(Ne wConnectionInitialReadCallback.java:113) at com .ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(Ai oReadCompletionListener.java:165) at com .ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture. java:217) at com .ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFu ture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
Re: How do I get a request parameter
One way is via the ServletActionContext, for example, ServletActionContext.getRequest().getParameter(String); On May 13, 2009, at 3:16 PM, Jim Collings wrote: It isn't in the value stack but I need to snag it. Can't find any examples of how to do this. Clue anyone? Jim C. smime.p7s Description: S/MIME cryptographic signature
Re: [S2] how to use multiple resource files in struts2
Set multiple resource per line in your struts.xml file, separated by commas, for example: constant name=struts.custom.i18n.resources value=globalMessages,Resources1,Resources2 / On May 6, 2009, at 4:53 AM, Sonu S wrote: Hi, I am trying to use two or more resource files in struts2, like this struts.custom.i18n.resources=Resources1 struts.custom.i18n.resources=Resources2 but it is not working (in JSP pages only values from Resource2 are being displayed and for keys are being displayed from resource1) please tell me how to use multiple resource files in struts2 Thanks smime.p7s Description: S/MIME cryptographic signature
Re: Date/time formatting
java.text.SimpleDateFormat formats a java.util.Date according to a locale and a patter specified by the client. On May 6, 2009, at 1:10 PM, Jon Pearson wrote: If I wanted to output a date/time value in the user's locale, is there a simple way to do that? I see there is a date tag which would be helpful for getting the date format correct without manually specifying it, but what about a similar time tag? Am I going to need to manually specify the standard date format as M/D/y h/mm/ss a for US English, and just require any translation to specify its own? Thanks, ~Jonathan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org smime.p7s Description: S/MIME cryptographic signature
Re: Exception Handling in Struts 2.0.11
Can you be a little more clear about your ask? Using the examples in the given URL, are you asking about: 1. How to code exception.jsp? 2. How to code SQLExceptionAction.java? 3. What is on the ValueStack in these examples and an Exception occurs? 4. something else? On Apr 27, 2009, at 4:34 AM, NR031 wrote: Hi, I am using Struts 2.0.11 and NetBeans 6.1. Is there any way to handle exception in Struts 2? I saw the tutorial given http://struts.apache.org/2.0.11/docs/exception-configuration.html http://struts.apache.org/2.0.11/docs/exception-configuration.html , but it doesn't contain a sample example that demonstrate the Exception Handling. I am new to Struts so please explain with an example. Thanks in advance, -- View this message in context: http://www.nabble.com/Exception-Handling-in-Struts-2.0.11-tp23252025p23252025.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 == Terry Gardner terry.gard...@sun.com Skype: Terry_J_Gardner Vulcans never bluff. -- Spock - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2 localization
Here is an example from a JSP: %-- use access control --% div class=use_access_control_entry checkbox h2s:text name=access_control.access_control.use_access_control.label//h2 span class=description s:text name=access_control.access_control.use_access_control.description/ /span s:checkbox name=useAccessControl value=%{configuration.getBoolean('use_access_control')} required=false labelposition=left label=% {getText('access_control.access_control.use_access_control.label')}/ /div In this example, stext name=.../ and getText('...') access resource bundles. For this example to work correctly, there must be a way to resolve the s:text and getText() values. In my case, there is a set of resource bundles specifically associated the action, in this case the Action that is the model for this view is named AccessControlAction, so the resource bundles are named AccessControlAction_[XX].properties, and live alongside the AccessControlAction.class file. Further, the bundle for English is named AccessControlAction_en.properties, Spanish AccessControlAction_es.properties, and so forth or each language. On Apr 24, 2009, at 9:37 AM, Dave Newton wrote: Johnson nickel wrote: I want to know about struts 2 localization. I have seen the struts 2 documentation i'm not getting clear idea. Can anybody provide the basic steps for implementing this localization concept. Provide a package.properties file for package-level messages. Provide (actionName).properties file for action-specific messages, where (actionName) is either the name of an action, and action superclass, and interface, or interface superclass. You can also define app-wide message resource files using the constant mentioned in the documentation. Use getText() variants or the I18N tags to retrieve the messages in the JSP files. That's about it; if you can provide some feedback as to what was confusing we'll update the docs. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org == Terry Gardner terry.gard...@sun.com Skype: Terry_J_Gardner Vulcans never bluff. -- Spock - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts.properties question
The resource bundles can also be in files named after the Action, for example, SlamdStartServerResultAction_en.properties, which contains keys and values (English) for the Action SlamdStartServerResultAction.java On Apr 17, 2009, at 10:36 AM, Bhaarat Sharma wrote: I know we can a property file in struts like this struts.custom.i18n.resources=nameofFile But is there a way to use multiple properties files? (nameofFile) we have a lot of labels for our application and if we put everything into one property file then it seems to get so overwhelmingly huge that its hard to find anything in it. Is there a way to over come this problem? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts.properties question
On Apr 17, 2009, at 10:49 AM, Bhaarat Sharma wrote: so I can create this new property file in the same folder where my struts.properties file resides or does it have to be in the package where action is. Good point. I forgot to mention that there is a search hierarchy. I usually put the properties files in the same directory as the action, but they can also be up the chain. So, if my Action class is com.slamd.struts2.actions.SlamdStartServerResultAction.java, then I put the SlamdStartServerResultAction_en.properties file in srcRootcom/slamd/struts2/actions. so if my action name is XXX.java the property file will be XXX_en.properties and the properties file will be picked automatically or does it require any changes in struts.properties? does it have to be registered there? Picked automagically by getText(). Remember to change the _en part to the two letter code for the language. I only speak English - and that badly - so mine are all _en for the moment. Thanks!! On Fri, Apr 17, 2009 at 10:44 AM, Terry Gardner terry.gard...@sun.comwrote: The resource bundles can also be in files named after the Action, for example, SlamdStartServerResultAction_en.properties, which contains keys and values (English) for the Action SlamdStartServerResultAction.java On Apr 17, 2009, at 10:36 AM, Bhaarat Sharma wrote: I know we can a property file in struts like this struts.custom.i18n.resources=nameofFile But is there a way to use multiple properties files? (nameofFile) we have a lot of labels for our application and if we put everything into one property file then it seems to get so overwhelmingly huge that its hard to find anything in it. Is there a way to over come this problem? - 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: Comparing a request parameter to a string literal
try s:if test='%{#parameters.status == invalid}' On Apr 17, 2009, at 1:58 PM, Russell Neufeld wrote: Hi all, I'm still coming up the learning curve on Struts2, and I've come across something I can't explain. Hopefully you guys out there can help me understand this. I have a request parameter status set to invalid which I'd like to access from within a JSP. If I use the following line: s:property value=#parameters.status/ I see invalid written to the HTML, which is what I expect. However, if I try to use that in an expression, like this: s:if test='#parameters.status == invalid' this always evaluates to false. Similarly, this: s:property value=#parameters.status == 'invalid'/ prints out false to the HTML output. However, if I do the following: s:set var=foobar/s:set s:property value=#foo == 'bar'/ that prints out true to the HTML output. Yet this: s:set var=status value=#parameters.status/ s:property value=#status == 'invalid'/ prints out false to the HTML output. Can someone help me understand this behaviour please? Any ideas on how to compare a request parameter to a string literal? Thanks, Russ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Display action errors above the field
use addFieldError(fieldName,message); like: addFieldError(email,surname + : invalid email address); The infrastructure marries this with the field named email. On Apr 17, 2009, at 2:31 PM, Stefano Tranquillini wrote: On Fri, Apr 17, 2009 at 20:29, Security Management list-subscripti...@secmgmt.com wrote: field errors i don't know what is field-errors. -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Display action errors above the field
getText() is in ActionSupport. On Apr 17, 2009, at 2:39 PM, Stefano Tranquillini wrote: a k. tomorrow i'll try. i've used only addFieldError(errors); other things,i'll try to use getText in order to keep the text from the proprieties but the getText method doesn't found. i've to use some library? thanks. On Fri, Apr 17, 2009 at 20:37, Terry Gardner terry.gard...@sun.com wrote: use addFieldError(fieldName,message); like: addFieldError(email,surname + : invalid email address); The infrastructure marries this with the field named email. On Apr 17, 2009, at 2:31 PM, Stefano Tranquillini wrote: On Fri, Apr 17, 2009 at 20:29, Security Management list-subscripti...@secmgmt.com wrote: field errors i don't know what is field-errors. -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2 select tag with multiple enabled
fmrTenant.getTerminationReason should return a String, not an array? On a different subject, consider using generics: public ListString getRejectionReasons() { return this.rejectionReasons; } private ListString rejectionReasons; On Apr 16, 2009, at 9:45 AM, Bhaarat Sharma wrote: I am using a select tag like this s:select multiple=true headerKey=-1 list=rejectionReasons value=%{fmrTenant.terminationReason} required=true/ list = rejectionReasons invokes the following method: public List getRejectionReasons() { return rejectionReasons; } I am using value=%{fmrTenant.terminationReason} because I want to preselec some of the values returned. this invokes the following method public String[] getTerminationReason() { return terminationReason; } I am getting the following error Expected number, date, or string. parameters.nameValue evaluated instead to freemarker.ext.beans.ArrayModel on line 60, column 101 in template/simple/select.ftl. The problematic instruction: -- == if tag.contains(parameters.nameValue, itemKey) == true || (parameters.nameValue?exists parameters.nameValue?string == itemKey) [on line 60, column 9 in template/simple/select.ftl] in user-directive s.iterator [on line 40, column 1 in template/simple/select.ftl] -- I looked for this error online and seems like this is a bug in struts2: https://issues.apache.org/struts/browse/WW-1747 I just wanted to make sure whether there is a work around as to how I am trying to do this? Thanks! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: hi,guys! I wonder the validation framework is ok in the Struts 2.1.6 .
yes. On Apr 13, 2009, at 1:15 AM, 白鹏 wrote: Has anyone use the validation framework of struts 2.1.6?? ?? == terry.gard...@sun.com Blog: http://blogs.sun.com/terrygardner Blog: http://dtfar.blogspot.com Twitter: http://twitter.com/tgardner SLAMD: http://slamd2.dev.java.net Skype: Terry_J_Gardner The best things in life are not things. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: create personal interceptor
I see. Please be more specific about what you mean when you write that it does not work. The interceptor you have coded does not inject the mese into any action, but it does convert internally from month names to numbers. Perhaps you could create an interface called MeseAware: public interface MeseAware { public void setMeseAsNumberString(String meseAsNumberString); } and implement it in your action that needs mese as a number. Then inject it from your interceptor: ... Action action = (Action)actionInvocation().getAction(); if(action instanceof MeseAware) { ((MeseAware)action).setMeseAsNumberString(getMese()); } Other things: - Since you do not need the init() and destroy() methods, you might consider extending AbstractInterceptor instead of implementing Interceptor. - Java classes names should begin with upper-case letters, like public class ConvMese. - Java ifs should have braces, even if they are only one-liners On Apr 8, 2009, at 5:52 AM, PEGASUS84 wrote: ok but i must use personal interceptor for my project Terry Gardner-2 wrote: I think you can use date formatters in java.text to accomplish this with no coding. On Apr 7, 2009, at 6:36 PM, PEGASUS84 wrote: I want create an interceptors wich converts the list of select tag mese in another string:1,2... i make this: package bean; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.Interceptor; import com.opensymphony.xwork2.Action; public class convMese implements Interceptor{ String mese; public void setMese(String m){mese=m;} public String getMese(){return mese;} public void destroy() { } public void init() { } public String intercept( ActionInvocation actionInvocation) throws Exception{ if (getMese().equals(Gennaio)) setMese(1); else if(getMese().equals(Febbraio)) setMese(2); else if(getMese().equals(Marzo)) setMese(3); else if(getMese().equals(Aprile)) setMese(4); else if(getMese().equals(Maggio)) setMese(5); else if(getMese().equals(Giugno)) setMese(6); else if(getMese().equals(Luglio)) setMese(7); else if(getMese().equals(Settembre)) setMese(9); else if(getMese().equals(Ottobre)) setMese(10); else if(getMese().equals(Novembre)) setMese(11); else if(getMese().equals(Dicembre)) setMese(12); else setMese(0); return actionInvocation.invoke(); } but it doesn't work can someone help me? -- View this message in context: http://www.nabble.com/create-personal-interceptor-tp22939722p22939722.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 == terry.gard...@sun.com Mobile: +1 404 925 6385 Blog: http://blogs.sun.com/terrygardner Blog: http://dtfar.blogspot.com Twitter: http://twitter.com/tgardner SLAMD: http://slamd2.dev.java.net It is better to know some of the questions than all of the answers. - Thurber - 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://www.nabble.com/create-personal-interceptor-tp22939722p22947039.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 == Terry Gardner terry.gard...@sun.com Vulcans never bluff. -- Spock - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Change single .properties file to one .properties file for every JSP
Agreed. I am well-known for answering questions that were not asked. :) On Apr 8, 2009, at 7:25 AM, Muthu Velappan wrote: I believe the question is more about whether any tool available to split his current bulk properties into a small package/action specific properties. I think there is no tool to do that, It has to be manually split into different properties file based on either package or action class as specified by Terry.. ~Muthu Terry Gardner-2 wrote: .properties file can be looked up based on the current Action, or a hierarchy is used to search for a key. If the Action is named EnterEmployeeAction, then the .properties files are all preceded by EnterEmployeeAction, viz, EnterEmployeeAction_en.properties, and so forth. There is also a package.properties file for an entire package, and global properties that can be configured in struts.xml: constant name=struts.custom.i18n.resources value=globalMessages / The above can also be a list: constant name=struts.custom.i18n.resources value=globalMessages,moreGlobalMessages / On Apr 8, 2009, at 6:54 AM, walki2 wrote: Hi, I am new to Struts. I have a website that uses Struts (.properties files) to show the website's content in either english, french or german. SomeFileName.properties SomeFileName_en.properties SomeFileName_fr.properties SomeFileName_de.properties Unfortunately all the text is stored in one big properties file!! Is there an easy way to make a .properties file for every jsp? Or do I have to make it manually using copy and paste for about 80 JSP's? Greetings, walki2 -- View this message in context: http://www.nabble.com/Change-single-.properties-file-to-one-.properties-file-for-every-JSP-tp22947889p22947889.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 == terry.gard...@sun.com Blog: http://blogs.sun.com/terrygardner Blog: http://dtfar.blogspot.com Twitter: http://twitter.com/tgardner SLAMD: http://slamd2.dev.java.net ”The knights are dust, and their good swords rust” - 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://www.nabble.com/Change-single-.properties-file-to-one-.properties-file-for-every-JSP-tp22947889p22948309.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 == terry.gard...@sun.com Blog: http://blogs.sun.com/terrygardner Blog: http://dtfar.blogspot.com Twitter: http://twitter.com/tgardner SLAMD: http://slamd2.dev.java.net It is not every question that deserves an answer. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Change single .properties file to one .properties file for every JSP
.properties file can be looked up based on the current Action, or a hierarchy is used to search for a key. If the Action is named EnterEmployeeAction, then the .properties files are all preceded by EnterEmployeeAction, viz, EnterEmployeeAction_en.properties, and so forth. There is also a package.properties file for an entire package, and global properties that can be configured in struts.xml: constant name=struts.custom.i18n.resources value=globalMessages / The above can also be a list: constant name=struts.custom.i18n.resources value=globalMessages,moreGlobalMessages / On Apr 8, 2009, at 6:54 AM, walki2 wrote: Hi, I am new to Struts. I have a website that uses Struts (.properties files) to show the website's content in either english, french or german. SomeFileName.properties SomeFileName_en.properties SomeFileName_fr.properties SomeFileName_de.properties Unfortunately all the text is stored in one big properties file!! Is there an easy way to make a .properties file for every jsp? Or do I have to make it manually using copy and paste for about 80 JSP's? Greetings, walki2 -- View this message in context: http://www.nabble.com/Change-single-.properties-file-to-one-.properties-file-for-every-JSP-tp22947889p22947889.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 == terry.gard...@sun.com Blog: http://blogs.sun.com/terrygardner Blog: http://dtfar.blogspot.com Twitter: http://twitter.com/tgardner SLAMD: http://slamd2.dev.java.net ”The knights are dust, and their good swords rust” - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: OGNL Debug?
OGNL should catch the underlying log levels, try setting that to debug or DEBUG or whatever. On Apr 7, 2009, at 9:03 AM, Security Management wrote: Is there a way to turn on debugging for OGNL for struts 2? I have a form field that is not getting set on my action's object, and one that works fine. If I change the form from POST to GET I can see the correct name and value in the URL. Is there a way to make the OGNL stuff spit out the traversal of the stack, and see which methods is examining and all that? Thanks. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org == terry.gard...@sun.com Mobile: +1 404 925 6385 Blog: http://blogs.sun.com/terrygardner Blog: http://dtfar.blogspot.com Twitter: http://twitter.com/tgardner SLAMD: http://slamd2.dev.java.net The best things in life are not things. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: create personal interceptor
I think you can use date formatters in java.text to accomplish this with no coding. On Apr 7, 2009, at 6:36 PM, PEGASUS84 wrote: I want create an interceptors wich converts the list of select tag mese in another string:1,2... i make this: package bean; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.Interceptor; import com.opensymphony.xwork2.Action; public class convMese implements Interceptor{ String mese; public void setMese(String m){mese=m;} public String getMese(){return mese;} public void destroy() { } public void init() { } public String intercept( ActionInvocation actionInvocation) throws Exception{ if (getMese().equals(Gennaio)) setMese(1); else if(getMese().equals(Febbraio)) setMese(2); else if(getMese().equals(Marzo)) setMese(3); else if(getMese().equals(Aprile)) setMese(4); else if(getMese().equals(Maggio)) setMese(5); else if(getMese().equals(Giugno)) setMese(6); else if(getMese().equals(Luglio)) setMese(7); else if(getMese().equals(Settembre)) setMese(9); else if(getMese().equals(Ottobre)) setMese(10); else if(getMese().equals(Novembre)) setMese(11); else if(getMese().equals(Dicembre)) setMese(12); else setMese(0); return actionInvocation.invoke(); } but it doesn't work can someone help me? -- View this message in context: http://www.nabble.com/create-personal-interceptor-tp22939722p22939722.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 == terry.gard...@sun.com Mobile: +1 404 925 6385 Blog: http://blogs.sun.com/terrygardner Blog: http://dtfar.blogspot.com Twitter: http://twitter.com/tgardner SLAMD: http://slamd2.dev.java.net It is better to know some of the questions than all of the answers. - Thurber - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Help] How to pass the parameter of an Interceptor to the Action??
One idea I have: 1. Create an interface called RedirectAware 2. Have the actions which need the redirectURL implement RedirectAware 3. Inject the redirectURL into Actions that are RedirectAware from the interceptor On Apr 6, 2009, at 4:17 AM, 白鹏 wrote: hey,guys, the code follows, public class LoginInterceptor extends AbstractInterceptor { private String* redirectUrl*; public String getRedirectUrl() { return redirectUrl; } public void setRedirectUrl(String redirectUrl) { this.redirectUrl = redirectUrl; } @Override public String intercept(ActionInvocation arg0) throws Exception { System.out.println(Come into the LoginInterceptor#intercept()); ActionContext ctx = arg0.getInvocationContext(); User user = (User) ctx.getSession().get(user); if(user!= null){ return arg0.invoke(); } ctx.put(tip, 请先登录系统:)); Map params = ActionContext.getContext().getParameters(); *redirectUrl* = *buildSendReq.action* ?productID=11productTitle=Games+Explorer; System.out.println(RedirectUrl=+redirectUrl); System.out.println(Intercept() ok!); * return Action.LOGIN; // Login.action , I want to pass the redirectUrl to the Login.action. How to do ???* } } == Terry Gardner terry.gard...@sun.com Vulcans never bluff. -- Spock - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Configuration reloading problem
From org.apache.struts2.dispatcher.Dispatcher. On Apr 3, 2009, at 12:39 AM, vishalj wrote: How to i get access to ConfigurationManager in action class -- View this message in context: http://www.nabble.com/Configuration-reloading-problem-tp22861783p22861783.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 == terry.gard...@sun.com Mobile: +1 404 925 6385 Blog: http://blogs.sun.com/terrygardner Blog: http://dtfar.blogspot.com SLAMD: http://slamd2.dev.java.net Twitter: http://twitter.com/tgardner Insanity: doing the same thing over and over again and expecting different results. - A. Einstein - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org