RE: Parameters not being set on Action in Struts 2
Looks like it is that issue indeed :( From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Fri 12/1/2006 4:34 PM To: Struts Users Mailing List Subject: Re: Parameters not being set on Action in Struts 2 On 12/1/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > I'm open to any suggestions on how to get to the bottom of this issue. Maybe it's this * http://forums.opensymphony.com/thread.jspa?messageID=94747?? The sample was testing GET but not POST. -Ted. DISCLAIMER This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. **
Re: Parameters not being set on Action in Struts 2
On 12/1/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: I'm open to any suggestions on how to get to the bottom of this issue. Maybe it's this * http://forums.opensymphony.com/thread.jspa?messageID=94747𗈛 The sample was testing GET but not POST. -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Parameters not being set on Action in Struts 2
Thanks Ted. This is getting interesting. I was really surprised that it worked for you, I couldn't even wait til the weekend is over. On my extremely slow laptop at home, I went and downloaded Tomcat 5.5.20 and Struts 2.0.1, and tried it. Surprisingly, it DOES work! I've been trying this from the very first day inside JDeveloper. Just to eliminate the probability that it might be the embedded OC4J that has the problem, I installed the application on a standalone OC4J and I found that it exhibits the same behavior as the OC4J embedded inside JDeveloper. So, I guess that means one of two things: 1- This is a bug with OC4J (more likely) 2- The code uses some non-standard feature that is not supported by OC4J (very unlikely) Since Oracle AS 10g is our target platform, this could be a show stopper for us. It would simply mean that if this issue can not be resolved then we can not move to WW/Struts 2. I'm open to any suggestions on how to get to the bottom of this issue. From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Thu 11/30/2006 6:54 PM To: Struts Users Mailing List Subject: Re: Parameters not being set on Action in Struts 2 I dropped in the JARS from the the 2.0.1 showcase, and it seemd to work just fine. You might want to try deploying it on another workstation there. -Ted. On 11/29/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > > Thanks Ted. > > I sent the WAR file and zip file containing the source of the action to > your email address directly. > > I have a couple of other questions that I'll post on another thread and > I hope you'll help me with them, so that I can conclude my evaluation. > DISCLAIMER This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. **
Re: Parameters not being set on Action in Struts 2
I dropped in the JARS from the the 2.0.1 showcase, and it seemd to work just fine. You might want to try deploying it on another workstation there. -Ted. On 11/29/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: Thanks Ted. I sent the WAR file and zip file containing the source of the action to your email address directly. I have a couple of other questions that I'll post on another thread and I hope you'll help me with them, so that I can conclude my evaluation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Parameters not being set on Action in Struts 2
Thanks Ted. I sent the WAR file and zip file containing the source of the action to your email address directly. I have a couple of other questions that I'll post on another thread and I hope you'll help me with them, so that I can conclude my evaluation. -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 4:58 PM To: Struts Users Mailing List Subject: Re: Parameters not being set on Action in Struts 2 I inspected it myself in a debugger the other day, and the property was in the map. If you like, send me a WAR of the test application, so we can work out what's wrong. (The list doesn't accept attachments.) -Ted. On 11/28/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > It exhibits the same behavior even after converting the "param" > field/parameter to a String. > > Is there a way to provide a JUnit test for that? > > -Original Message- > From: Ted Husted [mailto:[EMAIL PROTECTED] > Sent: Monday, November 27, 2006 6:52 PM > To: Struts Users Mailing List > Subject: Re: Parameters not being set on Action in Struts 2 > > Try it again using a String property, to be sure it is not a problem > with the type conversion. > > On 11/27/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > > To clear my doubts, I re-built this application using WW 2.2.4. I > > expected that it will work perfectly and that would prove it's some > sort > > of a bug. To my surprise, it exhibited the exact same behavior! > > > > Now, since it's quite remote that such a drastic bug exists in WW > 2.2.4, > > I'm starting to think that maybe the behavior I expect is not the > > correct one. > > > > Now, could someone please clarify whether the following is true? > > 1- When parameters are available in the "query string", those > parameters > > are made available to the action through " > > ActionContext.getContext().getParameters()". Is this true? > > 2- If a property on the action has the same name as one of those > > parameters then the framework will attempt to set the property with > the > > parameter's name. > > > > This is not what is currently happening. Since WW 2.2.4 is supposed to > > be production quality then I'm guessing that there must be something > > wrong with the configuration. It can not be that some configuration > I've > > provided is wrong, simply because I have not provided any. It could > be, > > though, that some configuration is missing. > > > > The changes I've made to the application to get it to work with WW > 2.2.4 > > is minimal, so I won't go ahead and copy all the files here. > DISCLAIMER This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters not being set on Action in Struts 2
I inspected it myself in a debugger the other day, and the property was in the map. If you like, send me a WAR of the test application, so we can work out what's wrong. (The list doesn't accept attachments.) -Ted. On 11/28/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: It exhibits the same behavior even after converting the "param" field/parameter to a String. Is there a way to provide a JUnit test for that? -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 6:52 PM To: Struts Users Mailing List Subject: Re: Parameters not being set on Action in Struts 2 Try it again using a String property, to be sure it is not a problem with the type conversion. On 11/27/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > To clear my doubts, I re-built this application using WW 2.2.4. I > expected that it will work perfectly and that would prove it's some sort > of a bug. To my surprise, it exhibited the exact same behavior! > > Now, since it's quite remote that such a drastic bug exists in WW 2.2.4, > I'm starting to think that maybe the behavior I expect is not the > correct one. > > Now, could someone please clarify whether the following is true? > 1- When parameters are available in the "query string", those parameters > are made available to the action through " > ActionContext.getContext().getParameters()". Is this true? > 2- If a property on the action has the same name as one of those > parameters then the framework will attempt to set the property with the > parameter's name. > > This is not what is currently happening. Since WW 2.2.4 is supposed to > be production quality then I'm guessing that there must be something > wrong with the configuration. It can not be that some configuration I've > provided is wrong, simply because I have not provided any. It could be, > though, that some configuration is missing. > > The changes I've made to the application to get it to work with WW 2.2.4 > is minimal, so I won't go ahead and copy all the files here. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Parameters not being set on Action in Struts 2
It exhibits the same behavior even after converting the "param" field/parameter to a String. Is there a way to provide a JUnit test for that? -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 6:52 PM To: Struts Users Mailing List Subject: Re: Parameters not being set on Action in Struts 2 Try it again using a String property, to be sure it is not a problem with the type conversion. On 11/27/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > To clear my doubts, I re-built this application using WW 2.2.4. I > expected that it will work perfectly and that would prove it's some sort > of a bug. To my surprise, it exhibited the exact same behavior! > > Now, since it's quite remote that such a drastic bug exists in WW 2.2.4, > I'm starting to think that maybe the behavior I expect is not the > correct one. > > Now, could someone please clarify whether the following is true? > 1- When parameters are available in the "query string", those parameters > are made available to the action through " > ActionContext.getContext().getParameters()". Is this true? > 2- If a property on the action has the same name as one of those > parameters then the framework will attempt to set the property with the > parameter's name. > > This is not what is currently happening. Since WW 2.2.4 is supposed to > be production quality then I'm guessing that there must be something > wrong with the configuration. It can not be that some configuration I've > provided is wrong, simply because I have not provided any. It could be, > though, that some configuration is missing. > > The changes I've made to the application to get it to work with WW 2.2.4 > is minimal, so I won't go ahead and copy all the files here. DISCLAIMER This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters not being set on Action in Struts 2
Try it again using a String property, to be sure it is not a problem with the type conversion. On 11/27/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: To clear my doubts, I re-built this application using WW 2.2.4. I expected that it will work perfectly and that would prove it's some sort of a bug. To my surprise, it exhibited the exact same behavior! Now, since it's quite remote that such a drastic bug exists in WW 2.2.4, I'm starting to think that maybe the behavior I expect is not the correct one. Now, could someone please clarify whether the following is true? 1- When parameters are available in the "query string", those parameters are made available to the action through " ActionContext.getContext().getParameters()". Is this true? 2- If a property on the action has the same name as one of those parameters then the framework will attempt to set the property with the parameter's name. This is not what is currently happening. Since WW 2.2.4 is supposed to be production quality then I'm guessing that there must be something wrong with the configuration. It can not be that some configuration I've provided is wrong, simply because I have not provided any. It could be, though, that some configuration is missing. The changes I've made to the application to get it to work with WW 2.2.4 is minimal, so I won't go ahead and copy all the files here. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Parameters not being set on Action in Struts 2
To clear my doubts, I re-built this application using WW 2.2.4. I expected that it will work perfectly and that would prove it's some sort of a bug. To my surprise, it exhibited the exact same behavior! Now, since it's quite remote that such a drastic bug exists in WW 2.2.4, I'm starting to think that maybe the behavior I expect is not the correct one. Now, could someone please clarify whether the following is true? 1- When parameters are available in the "query string", those parameters are made available to the action through " ActionContext.getContext().getParameters()". Is this true? 2- If a property on the action has the same name as one of those parameters then the framework will attempt to set the property with the parameter's name. This is not what is currently happening. Since WW 2.2.4 is supposed to be production quality then I'm guessing that there must be something wrong with the configuration. It can not be that some configuration I've provided is wrong, simply because I have not provided any. It could be, though, that some configuration is missing. The changes I've made to the application to get it to work with WW 2.2.4 is minimal, so I won't go ahead and copy all the files here. -Original Message- From: Tarek Nabil Sent: Monday, November 27, 2006 5:29 PM To: Struts Users Mailing List Subject: RE: Parameters not being set on Action in Struts 2 Thanks Peter and Ted. I'm afraid I didn't understand your advice regarding the IDE with integrated debugging. Would that require me to use the source of Struts 2 rather than the JAR files as part of my application? To keep things simple, I started an application from scratch. Kept things to the bare minimum and I can still confirm that the problem exists. web.xml === http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> Struts Blank struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* org.springframework.web.context.ContextLoaderListener Struts.xml == http://struts.apache.org/dtds/struts-2.0.dtd";> /Sample.jsp SampleAction.java = package sample; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; public class SampleAction extends ActionSupport { private Integer param; public String execute() { System.out.println("ActionContext.getContext().getParameters() = " + ActionContext.getContext().getParameters()); return SUCCESS; } public void setParam(Integer param) { this.param = param; } public Integer getParam() { return param; } } Sample.jsp == <%@ page contentType="text/html;charset=UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> Sample param = applicationContext.xml == http://www.springframework.org/dtd/spring-beans.dtd";> struts.properties = Configured the context path to be "sample". Ran the application and put this URL in the address bar http://cpu2800:8988/sample/sample.action?param=1 That produced the following in the console (as I did away with logging, just plain System.out.println) 06/11/27 17:23:33 ActionContext.getContext().getParameters() = {} And my browser showed the following param = I can assure you that those are the only files in my project. Thanks again for your help. -----Original Message----- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Sunday, November 26, 2006 6:07 PM To: Struts Users Mailing List Subject: Re: Parameters not being set on Action in Struts 2 On 11/26/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > I was pretty sure that the correct method was being executed, because I > had some logging statements inside. One of those statements is the one > that attempts to log the parameter Map and it's still giving the same > result; an empty Map. We'd need to see all the code exactly as it's written. For example, logger.debug(getContext().getParameters()); won't work, unless the Action has added a getContext method of its own. To simplify the test, try instead logger.debug(ActionContext.getContext().getParameters()); I added tried calling ActionContext.getContext in one of my own Actions and set a breakpoint in IDEA, to be sure it works correctly. One thing to not about type property is that it is an integer, so be sure your test is passing an integer as a parameter. That should affect the map, but it would affect what's set
RE: Parameters not being set on Action in Struts 2
Thanks Peter and Ted. I'm afraid I didn't understand your advice regarding the IDE with integrated debugging. Would that require me to use the source of Struts 2 rather than the JAR files as part of my application? To keep things simple, I started an application from scratch. Kept things to the bare minimum and I can still confirm that the problem exists. web.xml === http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> Struts Blank struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* org.springframework.web.context.ContextLoaderListener Struts.xml == http://struts.apache.org/dtds/struts-2.0.dtd";> /Sample.jsp SampleAction.java = package sample; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; public class SampleAction extends ActionSupport { private Integer param; public String execute() { System.out.println("ActionContext.getContext().getParameters() = " + ActionContext.getContext().getParameters()); return SUCCESS; } public void setParam(Integer param) { this.param = param; } public Integer getParam() { return param; } } Sample.jsp == <%@ page contentType="text/html;charset=UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> Sample param = applicationContext.xml == http://www.springframework.org/dtd/spring-beans.dtd";> struts.properties = Configured the context path to be "sample". Ran the application and put this URL in the address bar http://cpu2800:8988/sample/sample.action?param=1 That produced the following in the console (as I did away with logging, just plain System.out.println) 06/11/27 17:23:33 ActionContext.getContext().getParameters() = {} And my browser showed the following param = I can assure you that those are the only files in my project. Thanks again for your help. -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Sunday, November 26, 2006 6:07 PM To: Struts Users Mailing List Subject: Re: Parameters not being set on Action in Struts 2 On 11/26/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > I was pretty sure that the correct method was being executed, because I > had some logging statements inside. One of those statements is the one > that attempts to log the parameter Map and it's still giving the same > result; an empty Map. We'd need to see all the code exactly as it's written. For example, logger.debug(getContext().getParameters()); won't work, unless the Action has added a getContext method of its own. To simplify the test, try instead logger.debug(ActionContext.getContext().getParameters()); I added tried calling ActionContext.getContext in one of my own Actions and set a breakpoint in IDEA, to be sure it works correctly. One thing to not about type property is that it is an integer, so be sure your test is passing an integer as a parameter. That should affect the map, but it would affect what's set to the property. If time is going to be an issue, I'd strongly recommend trying an IDE with integrating debugging, since a quick step through can save a lot of temporary logging statements. The W2/S2 framework is also very testable, and nothing saves more development time than a solid set of unit tests from the get-go. If your application does need to do alot of logging, a very good place to do that is from an Intercetpor, so that the logging can be applied uniformly. HTH, Ted. DISCLAIMER This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. **
Re: Parameters not being set on Action in Struts 2
On 11/26/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: I was pretty sure that the correct method was being executed, because I had some logging statements inside. One of those statements is the one that attempts to log the parameter Map and it's still giving the same result; an empty Map. We'd need to see all the code exactly as it's written. For example, logger.debug(getContext().getParameters()); won't work, unless the Action has added a getContext method of its own. To simplify the test, try instead logger.debug(ActionContext.getContext().getParameters()); I added tried calling ActionContext.getContext in one of my own Actions and set a breakpoint in IDEA, to be sure it works correctly. One thing to not about type property is that it is an integer, so be sure your test is passing an integer as a parameter. That should affect the map, but it would affect what's set to the property. If time is going to be an issue, I'd strongly recommend trying an IDE with integrating debugging, since a quick step through can save a lot of temporary logging statements. The W2/S2 framework is also very testable, and nothing saves more development time than a solid set of unit tests from the get-go. If your application does need to do alot of logging, a very good place to do that is from an Intercetpor, so that the logging can be applied uniformly. HTH, Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters not being set on Action in Struts 2
On 11/26/06, Wesslan <[EMAIL PROTECTED]> wrote: See the following thread: http://www.nabble.com/-S2--Duty-now-for-the-future--%28was-Re%3A-Question-ab out-struts2%29-tf2559552.html#a7132875 Struts2 also depends on a beta(snapshot) release of XWork2. And this, * http://struts.apache.org/roadmap.html#now -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Parameters not being set on Action in Struts 2
See the following thread: http://www.nabble.com/-S2--Duty-now-for-the-future--%28was-Re%3A-Question-ab out-struts2%29-tf2559552.html#a7132875 Struts2 also depends on a beta(snapshot) release of XWork2. Hth, Peter -Original Message- From: Tarek Nabil [mailto:[EMAIL PROTECTED] Sent: den 26 november 2006 06:41 To: Struts Users Mailing List Subject: RE: Parameters not being set on Action in Struts 2 Thanks Ted. I renamed my method to "execute" and changed the URL to remove the "!setup" part. I also changed the struts.xml file accordingly, so now it's like that (note that I removed the input result, just in case it's causing any problems). /jsp/billCreation/PageName.jsp I was pretty sure that the correct method was being executed, because I had some logging statements inside. One of those statements is the one that attempts to log the parameter Map and it's still giving the same result; an empty Map. I know you guys are doing a great effort trying to get this framework out, but if I have a project starting in one month and delivering four months later, would you recommend Struts 2 for that? Please note that means that most development will be done using a pre-release version, so do you think this version is stable enough to be used by a team of 30 to 40 people where delays could cause a great damage? And, although I know this question is very difficult to answer for OS projects, do you think this framework will be ready for prime time in 5 months? The application is a heavy transactional one and is required to scale for thousands of transactions per day. Your advice is greatly appreciated. -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Saturday, November 25, 2006 5:25 PM To: Struts Users Mailing List Subject: Re: Parameters not being set on Action in Struts 2 First, simplify the problem. Right now, the code seems to be calling an alternative method, setup. What happens if you try the same thing with the default execute method? If your application is based on the blank application, it may turned the "!" syntax off, since it can conflict with using wildcards. To use the Check the struts.properties file for the line "struts.enable.DynamicMethodInvocation", and set it to true. We're working on some new code for Struts 2 that will extend the "!" syntax so that it can happily coexist with wildcards. -Ted. On 11/23/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > Hi, > > I'm experimenting with Struts 2, and I'm facing a problem with request > parameters being populated on the Action. I checked out the source to > make sure that the behavior I expect is the correct one, and judging by > the source, it is, but it's not happening. > > > I have an action that has a method > > public void setType(Integer type) { > // some code > } > > I declared the action in Struts.xml as follows > > name="dod1" > method="setup" > class="somePackageName.someClassName"> > /jsp/someFolder/someJSP.jsp > dod1!setup > > > In the setup method, I put the following line > > logger.debug(getContext().getParameters()); > > In the URL, I call the following > > http://server/application/namespace/dod1!setup.action?type=1 > > The result is that the parameters map is logged as {} and in my method > when I attempt to access the type field, I find it to be null! > > Could someone please point me to what could be wrong? > > Thanks, > Tarek Nabil DISCLAIMER** ** This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Parameters not being set on Action in Struts 2
Thanks Ted. I renamed my method to "execute" and changed the URL to remove the "!setup" part. I also changed the struts.xml file accordingly, so now it's like that (note that I removed the input result, just in case it's causing any problems). /jsp/billCreation/PageName.jsp I was pretty sure that the correct method was being executed, because I had some logging statements inside. One of those statements is the one that attempts to log the parameter Map and it's still giving the same result; an empty Map. I know you guys are doing a great effort trying to get this framework out, but if I have a project starting in one month and delivering four months later, would you recommend Struts 2 for that? Please note that means that most development will be done using a pre-release version, so do you think this version is stable enough to be used by a team of 30 to 40 people where delays could cause a great damage? And, although I know this question is very difficult to answer for OS projects, do you think this framework will be ready for prime time in 5 months? The application is a heavy transactional one and is required to scale for thousands of transactions per day. Your advice is greatly appreciated. -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Saturday, November 25, 2006 5:25 PM To: Struts Users Mailing List Subject: Re: Parameters not being set on Action in Struts 2 First, simplify the problem. Right now, the code seems to be calling an alternative method, setup. What happens if you try the same thing with the default execute method? If your application is based on the blank application, it may turned the "!" syntax off, since it can conflict with using wildcards. To use the Check the struts.properties file for the line "struts.enable.DynamicMethodInvocation", and set it to true. We're working on some new code for Struts 2 that will extend the "!" syntax so that it can happily coexist with wildcards. -Ted. On 11/23/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: > Hi, > > I'm experimenting with Struts 2, and I'm facing a problem with request > parameters being populated on the Action. I checked out the source to > make sure that the behavior I expect is the correct one, and judging by > the source, it is, but it's not happening. > > > I have an action that has a method > > public void setType(Integer type) { > // some code > } > > I declared the action in Struts.xml as follows > > name="dod1" > method="setup" > class="somePackageName.someClassName"> > /jsp/someFolder/someJSP.jsp > dod1!setup > > > In the setup method, I put the following line > > logger.debug(getContext().getParameters()); > > In the URL, I call the following > > http://server/application/namespace/dod1!setup.action?type=1 > > The result is that the parameters map is logged as {} and in my method > when I attempt to access the type field, I find it to be null! > > Could someone please point me to what could be wrong? > > Thanks, > Tarek Nabil DISCLAIMER This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters not being set on Action in Struts 2
First, simplify the problem. Right now, the code seems to be calling an alternative method, setup. What happens if you try the same thing with the default execute method? If your application is based on the blank application, it may turned the "!" syntax off, since it can conflict with using wildcards. To use the Check the struts.properties file for the line "struts.enable.DynamicMethodInvocation", and set it to true. We're working on some new code for Struts 2 that will extend the "!" syntax so that it can happily coexist with wildcards. -Ted. On 11/23/06, Tarek Nabil <[EMAIL PROTECTED]> wrote: Hi, I'm experimenting with Struts 2, and I'm facing a problem with request parameters being populated on the Action. I checked out the source to make sure that the behavior I expect is the correct one, and judging by the source, it is, but it's not happening. I have an action that has a method public void setType(Integer type) { // some code } I declared the action in Struts.xml as follows /jsp/someFolder/someJSP.jsp dod1!setup In the setup method, I put the following line logger.debug(getContext().getParameters()); In the URL, I call the following http://server/application/namespace/dod1!setup.action?type=1 The result is that the parameters map is logged as {} and in my method when I attempt to access the type field, I find it to be null! Could someone please point me to what could be wrong? Thanks, Tarek Nabil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Parameters not being set on Action in Struts 2
Hi, I'm experimenting with Struts 2, and I'm facing a problem with request parameters being populated on the Action. I checked out the source to make sure that the behavior I expect is the correct one, and judging by the source, it is, but it's not happening. I have an action that has a method public void setType(Integer type) { // some code } I declared the action in Struts.xml as follows /jsp/someFolder/someJSP.jsp dod1!setup In the setup method, I put the following line logger.debug(getContext().getParameters()); In the URL, I call the following http://server/application/namespace/dod1!setup.action?type=1 The result is that the parameters map is logged as {} and in my method when I attempt to access the type field, I find it to be null! Could someone please point me to what could be wrong? Thanks, Tarek Nabil DISCLAIMER This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]