Internalization problem: two internalizations for the same key
Hi everyone, I have the following lines in my jsp file: Of these two, using text tag gives me the internalization that has been selected as internationalization for the application. Using getText for select label gives me internalization in Finnish, no matter what is the selected internationalization. All internationalizations are in their own global ApplicationResources files. getText method is the standard method from ActionSupport. Any idea what is the cause of this, and what might be the solution?
How to build Struts 2.0.11.1?
Hello, I wan't to build Struts 2.0.11.1 - to get more into the code and maybe try to patch something. I have installed Maven under: C:\Program Files\Java\apache-maven-2.0.9 Java Version used: java version "1.5.0_09" Checktout Struts from: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_11_1 into my project folder: C:\Projekte\struts2\src\struts_2_0_11_1 and in that folder I entered mvn and the build fails with the message: Results : Failed tests: testTransform4WithDocumentInclude(org.apache.struts2.views.xslt.XSLTResultTest ) testStaticTree(org.apache.struts2.views.jsp.ui.TreeTest) Tests run: 686, Failures: 2, Errors: 0, Skipped: 0 [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] There are test failures. [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 3 minutes 12 seconds [INFO] Finished at: Wed May 07 10:30:25 CEST 2008 [INFO] Final Memory: 13M/39M [INFO] Has anyone expiriences what to do to build Struts 2 from the source? Thanks in advance! Hans-Georg -- 249 Spiele für nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro. Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:multibox read but not write
Hi All, I am in very strange situation, and stuck! please help, I have found one thread that much more or less but does not help.. http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 I have already use some example and it works.. Now the situation is lsightly different: I have a form: Start Code ... FunctionProForm extends ActionForm { private List functionProList = new ArrayList(); ... public List getSelectedPros(FunctionDto fun){ List result = new ArrayList(); for(FunProMap fp : functionProList){ if(fp.getFunction().getName().equals(fun.getName())){ for(int i = 0; i < fp.getSelectedPros().length; i++){ result.add(fp.getSelectedPros()[i]); } return result; } } return result; } } --the serializable object FunProMap -- public class FunProMap implements Serializable{ private static final long serialVersionUID = 1L; private FunctionDto function = new FunctionDto(); private List pros = new ArrayList(); private String[] selectedPros = {}; ... } --- in JSP: - - in the SaveAction -- ... SaveAction extends Action { protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ FunctionProForm myForm = (FunctionProForm) form; ... List functions = myService.listFunctions(); for(FunctionDto fun : functions){ fun.setPros(myForm.getSelectedPros(fun)); myService.updateFunction(fun); } return mapping.findForward("success"); } } End Code The check boxes are populated correctly from the database, i.e. for each FUnction, the corresponding checkbos is checked according to the list of available Pros (function.pros). The problem is that if I edit these boxes, check and uncheck, and click the Submit button, the changed is not saved to the database. I have run the debug and find that the method myForm.getSelectedPros(fun) returns the old values but not the new checked-unchecked boxes' values :-( !! I have used with a simple form according to: http://www.jguru.com/faq/view.jsp?EID=925277 http://www.jguru.com/faq/view.jsp?EID=925277 MyForm extends ActionForm { List myList; String[] selectedValues; // } and and this works fine.. Please help... ruga -- View this message in context: http://www.nabble.com/html%3Amultibox-read-but-not-write-tp17100080p17100080.html Sent from the Struts - User mailing list archive at Nabble.com.
Re: How to build Struts 2.0.11.1?
This link could help: http://struts.apache.org/2.x/docs/building-with-maven.html musachy On Wed, May 7, 2008 at 4:39 AM, Hans-Georg Kruse <[EMAIL PROTECTED]> wrote: > Hello, > > I wan't to build Struts 2.0.11.1 - to get more into the code and maybe try > to patch something. > > I have installed Maven under: > C:\Program Files\Java\apache-maven-2.0.9 > > Java Version used: java version "1.5.0_09" > > Checktout Struts from: > https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_11_1 > > into my project folder: > C:\Projekte\struts2\src\struts_2_0_11_1 > > and in that folder I entered mvn > and the build fails with the message: > > Results : > > Failed tests: > > testTransform4WithDocumentInclude(org.apache.struts2.views.xslt.XSLTResultTest > ) > testStaticTree(org.apache.struts2.views.jsp.ui.TreeTest) > > Tests run: 686, Failures: 2, Errors: 0, Skipped: 0 > > [INFO] > > [ERROR] BUILD FAILURE > [INFO] > > [INFO] There are test failures. > [INFO] > > [INFO] For more information, run Maven with the -e switch > [INFO] > > [INFO] Total time: 3 minutes 12 seconds > [INFO] Finished at: Wed May 07 10:30:25 CEST 2008 > [INFO] Final Memory: 13M/39M > [INFO] > > > Has anyone expiriences what to do to build Struts 2 from the source? > > Thanks in advance! > > Hans-Georg > > -- > 249 Spiele für nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro. > Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2.1.2 action url fails (possible bug)
I have deployed the two blank war files for struts 2.0.11 and struts 2.1.2. While struts 2.0.11 works perfectly fine, I have the following problem with struts 2.1.2. Whenever I type a url as follows: https://localhost:9445/struts2.1.2/example/HelloWorld.action I get "page not found" error. However, the following for struts 2.0.11 works: https://localhost:9445/struts2.0.11/example/HelloWorld.action but if I do the following: https://localhost:9445/struts2.1.2/index.html the url is redirected to https://localhost:9445/struts2.1.2/example/HelloWorld.action and I can see the page but if I open a new browser and copy and paste the url, it fails [page not found]. Anyone has any idea why this is happening. I would like to mention that I have security [form based] enabled for both application. As I said, the blank war file for struts 2.0.11 works fine and I have this issue with 2.1.2. I am running both apps in Websphere 6.1 with EJB3 feature pack. regards, __ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/
Steve Bott is out of the office.
I will be out of the office starting 05/07/2008 and will not return until 05/13/2008. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to build Struts 2.0.11.1?
Thanks for the link - I already found it but it doesn't help me. Is there anyone else who is able to build struts from the source? Can anyone tell what he did to set up the "development" environment? Musachy Barroso wrote: > > This link could help: > > http://struts.apache.org/2.x/docs/building-with-maven.html > > musachy > > On Wed, May 7, 2008 at 4:39 AM, Hans-Georg Kruse > <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I wan't to build Struts 2.0.11.1 - to get more into the code and maybe >> try to patch something. >> >> I have installed Maven under: >> C:\Program Files\Java\apache-maven-2.0.9 >> >> Java Version used: java version "1.5.0_09" >> >> Checktout Struts from: >> https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_0_11_1 >> >> into my project folder: >> C:\Projekte\struts2\src\struts_2_0_11_1 >> >> and in that folder I entered mvn >> and the build fails with the message: >> >> Results : >> >> Failed tests: >> >> testTransform4WithDocumentInclude(org.apache.struts2.views.xslt.XSLTResultTest >> ) >> testStaticTree(org.apache.struts2.views.jsp.ui.TreeTest) >> >> Tests run: 686, Failures: 2, Errors: 0, Skipped: 0 >> >> [INFO] >> >> [ERROR] BUILD FAILURE >> [INFO] >> >> [INFO] There are test failures. >> [INFO] >> >> [INFO] For more information, run Maven with the -e switch >> [INFO] >> >> [INFO] Total time: 3 minutes 12 seconds >> [INFO] Finished at: Wed May 07 10:30:25 CEST 2008 >> [INFO] Final Memory: 13M/39M >> [INFO] >> >> >> Has anyone expiriences what to do to build Struts 2 from the source? >> >> Thanks in advance! >> >> Hans-Georg >> >> -- >> 249 Spiele für nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro. >> Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-build-Struts-2.0.11.1--tp17100141p17106168.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to build Struts 2.0.11.1?
Hans-Georg wrote: Thanks for the link - I already found it but it doesn't help me. Is there anyone else who is able to build struts from the source? Can anyone tell what he did to set up the "development" environment? After correctly installing a recent copy of maven2, make sure you have an internet connection (dependencies will be downloaded for you automatically), change to the root of the source and type: mvn install That's pretty much it. I discovered the plugins directory didn't build when the main source built. To build this I did this: cd plugins mvn install [INFO] There are test failures. [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 3 minutes 12 seconds [INFO] Finished at: Wed May 07 10:30:25 CEST 2008 [INFO] Final Memory: 13M/39M [INFO] Test failures are by default treated as build failures by maven. To work around this (say, because you're fixing the broken tests, or you are working on something else), run this: mvn install -Dmaven.test.skip=true Regards, Graham -- smime.p7s Description: S/MIME Cryptographic Signature
Capturing the TransferObjectSelect object
Hi, Can anyone successfully implemented "optiontransferselet" tag. Suppose I want to capture the RightSideDropDown box in action class. How can I capture that in action class.Is it will be a collection field or array or something else... Thanks
Re: How to build Struts 2.0.11.1?
Also make sure that you download and build xwork (needs to be on the same folder as struts). Following the steps (in the link), and adding -Dmaven.test.skip=true to maven commands should be enough. musachy On Wed, May 7, 2008 at 10:48 AM, Graham Leggett <[EMAIL PROTECTED]> wrote: > Hans-Georg wrote: > > > > Thanks for the link - I already found it but it doesn't help me. > > > > Is there anyone else who is able to build struts from the source? > > Can anyone tell what he did to set up the "development" environment? > > > > After correctly installing a recent copy of maven2, make sure you have an > internet connection (dependencies will be downloaded for you automatically), > change to the root of the source and type: > > mvn install > > That's pretty much it. > > I discovered the plugins directory didn't build when the main source built. > To build this I did this: > > cd plugins > mvn install > > > > > > > > > > > > > > > > > [INFO] There are test failures. > > > > [INFO] > > > > > > > > > [INFO] For more information, run Maven with the -e switch > > > > [INFO] > > > > > > > > > [INFO] Total time: 3 minutes 12 seconds > > > > [INFO] Finished at: Wed May 07 10:30:25 CEST 2008 > > > > [INFO] Final Memory: 13M/39M > > > > [INFO] > > > > > > > > > > > > > > > > Test failures are by default treated as build failures by maven. To work > around this (say, because you're fixing the broken tests, or you are working > on something else), run this: > > mvn install -Dmaven.test.skip=true > > Regards, > Graham > -- > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem
I have a JPA query like that Query query = em.createQuery("*SELECT c.name, c.id FROM Group c ORDER BY c.name*"); List resultList = query.getResultList(); In Action class I have *resultList *and *GroupId *declared with getter and setters private List resultList ; private long GroupId; In JSP I have written like that : ** But nothing is displaying in my drop down box when I put listkey and listvalue. I will be great full if somebody tell me how to make it work. Thanks Arpan
Re: problem
On Wed, May 7, 2008 at 6:10 PM, Arpan Debroy <[EMAIL PROTECTED]> wrote: > > But nothing is displaying in my drop down box when I put listkey and > listvalue. > > If it's working without using listKey and listValue, then make sure you have defined getters and setters for "id" and "name" attributes of *Result* (I'm assuming it as the name of list is resultList) object.
Action servlet becomes null in UNIX environment
Hi, I have a problem with my application where actionServlet becomes null in UNIX environment and works fine in windows XP system. While saving data on test environment (UNIX) I am getting action servlet as null in My Action class. The jsp is built dynamically in as below *JSP code:* if (newGuide) { sb.append("\n"); sb.append("\n"); sb.append(""); sb.append(" - Save Assessment"); sb.append(" - Delete Assessment"); sb.append(" - Save & Schedule"); sb.append(" - Save & Refer"); sb.append(""); sb.append(" "); sb.append("\n"); sb.append("\n"); } * Action Class // Action class used for security * public void setServlet(ActionServlet actionServlet) { super.setServlet(actionServlet); // Here I get actionServlet as null ServletContext servletContext = actionServlet.getServletContext(); WebApplicationContext wac = WebApplicationContextUtils .getRequiredWebApplicationContext(servletContext); setIcrProcessor((CareRequestProcessor)wac.getBean("myCareRequestProcesso r")); } Because of this I get null pointer exception in class Main Action Class used for saving the data. *Action class code :* public ActionForward saveHAGuide(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String method = "saveHAGuide"; Exception ex = null; ActionForward forward = null; AppUser appUser = getAppUser(request); appUser.methodStart(this, "saveHAGuide"); HttpSession session = request.getSession(false); String action = request.getParameter("actionSelection"); // Here I get action as null Action becomes null and it throws null pointer exception. As UNIX is case sensitive I checked the request parameter which is actionSelection in this class and I do not see any problem with it. I don't know why action servlet becomes null at this point. Please suggest if you have any idea about this. Note: This happens only in test environment (UNIX). Works fine in my local system (Windows XP) . Thanks and regards,
RE: Action servlet becomes null in UNIX environment
A couple of things strike me as really odd about this. First: why are you creating HTML using strings in Java code? The whole point of JSPs was to avoid doing exactly that. You should either make use of .jsp files and the logic tags in Struts [1] or just use regular servlets if you really want to manually compose HTML. Second, why is your test environment different from your production environment? That sort of defeats the purpose of testing, since you can no longer rely on the fact that something you tested works. That said, chances are pretty good that you're getting null from that line because the HTTP request represented by the request object didn't have a parameter called "actionSelection". I suggest you stick in a breakpoint and have a look at the contents of the object. Hope that helps. ~DVA [1] http://struts.apache.org/1.3.8/struts-taglib/index.html Looks as though you're using Struts 1, but you didn't specify a version, so here's the last release's tag documents. If this is a new app, may I humbly suggest you use Struts2 instead? No sense in starting a project using a deprecated framework. -Original Message- From: Raghuveer Rawat [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 1:18 PM To: Struts Users Mailing List Subject: Action servlet becomes null in UNIX environment Hi, I have a problem with my application where actionServlet becomes null in UNIX environment and works fine in windows XP system. While saving data on test environment (UNIX) I am getting action servlet as null in My Action class. The jsp is built dynamically in as below *JSP code:* if (newGuide) { sb.append("\n"); sb.append("\n"); sb.append(""); sb.append(" - Save Assessment"); sb.append(" - Delete Assessment"); sb.append(" - Save & Schedule"); sb.append(" - Save & Refer"); sb.append(""); sb.append(" "); sb.append("\n"); sb.append("\n"); } * Action Class // Action class used for security * public void setServlet(ActionServlet actionServlet) { super.setServlet(actionServlet); // Here I get actionServlet as null ServletContext servletContext = actionServlet.getServletContext(); WebApplicationContext wac = WebApplicationContextUtils .getRequiredWebApplicationContext(servletContext); setIcrProcessor((CareRequestProcessor)wac.getBean("myCareRequestProcesso r")); } Because of this I get null pointer exception in class Main Action Class used for saving the data. *Action class code :* public ActionForward saveHAGuide(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String method = "saveHAGuide"; Exception ex = null; ActionForward forward = null; AppUser appUser = getAppUser(request); appUser.methodStart(this, "saveHAGuide"); HttpSession session = request.getSession(false); String action = request.getParameter("actionSelection"); // Here I get action as null Action becomes null and it throws null pointer exception. As UNIX is case sensitive I checked the request parameter which is actionSelection in this class and I do not see any problem with it. I don't know why action servlet becomes null at this point. Please suggest if you have any idea about this. Note: This happens only in test environment (UNIX). Works fine in my local system (Windows XP) . Thanks and regards, -- This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as "KBC FP"). This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, prices at which KBC FP would enter into a transaction, or prices at which similar transactions may be carried on KBC FP's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
UnknownAction
I am not very familiar with struts2, but I need to implement an Unknown Action. I could not find any examples on the internet. I think that for handleUnknownAction, I just wanted to go to the with failure, for now and then we might change the behavior. This happens when a user types in a bogus url, and we wanted to handle the logging differently. But I was not sure how to configure the ActionConfig, Is there an action that comes with Struts2, that I can give which corresponds to the GlobalResults? And for the handleUnknownResult I was just going to return a NullResult. We do not return different results based on user params, so there are a constant number of possibilities for the result, so this would only happen if We had a bug? or is there something I am missing? Thanks Kal
Re: Action servlet becomes null in UNIX environment
Thanks for the prompt reply. Its a late 90's huge application in which now i cannot start using Strus 2 as iam the only developer working on this. We are using html in java code because the JSP changes at run time according to the user inputs . Yeah , i agree that coz of diff environment we face lot of problems but i cannot do anything as its not my decision. We run Apache as a front end for Tomcat. Apache serves up the html pages and uses mod_jk mounts to forward the java application requests to Tomcat. I'll try to find out what else i can do as i am unable to see anything in apache logs as well. On Wed, May 7, 2008 at 1:48 PM, Allen, Daniel <[EMAIL PROTECTED]> wrote: > A couple of things strike me as really odd about this. > > First: why are you creating HTML using strings in Java code? The whole > point of JSPs was to avoid doing exactly that. You should either make > use of .jsp files and the logic tags in Struts [1] or just use regular > servlets if you really want to manually compose HTML. > > Second, why is your test environment different from your production > environment? That sort of defeats the purpose of testing, since you can > no longer rely on the fact that something you tested works. > > > That said, chances are pretty good that you're getting null from that > line because the HTTP request represented by the request object didn't > have a parameter called "actionSelection". I suggest you stick in a > breakpoint and have a look at the contents of the object. > > Hope that helps. > ~DVA > > [1] http://struts.apache.org/1.3.8/struts-taglib/index.html Looks as > though you're using Struts 1, but you didn't specify a version, so > here's the last release's tag documents. If this is a new app, may I > humbly suggest you use Struts2 instead? No sense in starting a project > using a deprecated framework. > > > -Original Message- > From: Raghuveer Rawat [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 07, 2008 1:18 PM > To: Struts Users Mailing List > Subject: Action servlet becomes null in UNIX environment > > Hi, > I have a problem with my application where actionServlet becomes null in > UNIX environment and works fine in windows XP system. While saving data > on > test environment (UNIX) I am getting action servlet as null in My Action > class. The jsp is built dynamically in as below > > *JSP code:* > > if (newGuide) { > > sb.append("\n"); > > sb.append("\n"); > > sb.append(""); > > sb.append(" - Save Assessment"); > > sb.append(" - Delete Assessment"); > > sb.append(" - Save & Schedule"); > > sb.append(" - Save & Refer"); > > sb.append(""); > > sb.append(" > value=\"Complete\" class=Button >"); > > sb.append("\n"); > > sb.append("\n"); > > } > > * Action Class // Action class used for security * > > public void setServlet(ActionServlet actionServlet) { > > super.setServlet(actionServlet); // Here I get actionServlet as null > > ServletContext servletContext = actionServlet.getServletContext(); > > WebApplicationContext wac = WebApplicationContextUtils > > .getRequiredWebApplicationContext(servletContext); > > setIcrProcessor((CareRequestProcessor)wac.getBean("myCareRequestProcesso > > r")); > > } > > Because of this I get null pointer exception in class Main Action Class > used > for saving the data. > > *Action class code :* > > public ActionForward saveHAGuide(ActionMapping mapping, ActionForm form, > HttpServletRequest request, > > HttpServletResponse response) throws Exception { > > String method = "saveHAGuide"; > > Exception ex = null; > > ActionForward forward = null; > > AppUser appUser = getAppUser(request); > > appUser.methodStart(this, "saveHAGuide"); > > HttpSession session = request.getSession(false); > > String action = request.getParameter("actionSelection"); // Here I get > action as null > > Action becomes null and it throws null pointer exception. > > As UNIX is case sensitive I checked the request parameter which is > actionSelection in this class and I do not see any problem with it. I > don't > know why action servlet becomes null at this point. Please suggest if > you > have any idea about this. > > Note: This happens only in test environment (UNIX). Works fine in my > local > system (Windows XP) . > > Thanks and regards, > > -- > This message may contain confidential, proprietary, or legally privileged > information. No confidentiality or privilege is waived by any transmission > to an unintended recipient. If you are not an intended recipient, please > notify the sender and delete this message immediately. Any views expressed > in this message are those of the sender, not those of any entity within the > KBC Financial Products group of companies (together referred to as "KBC > FP"). > > This message does not create any obligation, contractual or otherwise, on > the part of KBC FP. It is not an offer (or solicitation of an offer) of, or > a recommendation to buy or sell, any financial product. Any prices or other > values included in this message are indi
Re: UnknownAction
Oops Sorry I meant UnknownHandler On Wed, May 7, 2008 at 11:16 AM, kal stevens <[EMAIL PROTECTED]> wrote: > I am not very familiar with struts2, but I need to implement an Unknown > Action. > > I could not find any examples on the internet. > > I think that for handleUnknownAction, I just wanted to go to the > with failure, for now and then we might change the behavior. > > This happens when a user types in a bogus url, and we wanted to handle the > logging differently. > But I was not sure how to configure the ActionConfig, > Is there an action that comes with Struts2, that I can give which > corresponds to the GlobalResults? > > > And for the handleUnknownResult I was just going to return a NullResult. > We do not return different results based on user params, so there are a > constant number of possibilities for the result, so this would only happen > if We had a bug? or is there something I am missing? > > Thanks > > Kal > > >
RE: Action servlet becomes null in UNIX environment
> are using html in java code because the JSP changes at run time according to > the user inputs. But that's exactly what the Logic tags are for: a JSP that produces different output according to inputs. For example: If, in your Java code, you have: if (reqType == A) sb.append ("User made request A"); You can instead have in a JSP file (I'm using struts 2 tags because it's what I know, but there are s1 equivalents): User made request A Both of those should do the same thing. I suppose it's beside the point if you're stuck with the current design, though. Anyway, did you check out the request object's contents? If the parameter is indeed missing from the request, then the next step is to find out what should Be putting it into the request (probably the previous page, I'd guess) and make sure that is putting it in. If it seems like the incoming URLs are correct, including that parameter, then it looks like you have an Apache or Tomcat problem, and you should probably ask them about it. ~DVA -Original Message- From: Raghuveer Rawat [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 2:45 PM To: Struts Users Mailing List Subject: Re: Action servlet becomes null in UNIX environment Thanks for the prompt reply. Its a late 90's huge application in which now i cannot start using Strus 2 as iam the only developer working on this. We are using html in java code because the JSP changes at run time according to the user inputs . Yeah , i agree that coz of diff environment we face lot of problems but i cannot do anything as its not my decision. We run Apache as a front end for Tomcat. Apache serves up the html pages and uses mod_jk mounts to forward the java application requests to Tomcat. I'll try to find out what else i can do as i am unable to see anything in apache logs as well. On Wed, May 7, 2008 at 1:48 PM, Allen, Daniel <[EMAIL PROTECTED]> wrote: > A couple of things strike me as really odd about this. > > First: why are you creating HTML using strings in Java code? The whole > point of JSPs was to avoid doing exactly that. You should either make > use of .jsp files and the logic tags in Struts [1] or just use regular > servlets if you really want to manually compose HTML. > > Second, why is your test environment different from your production > environment? That sort of defeats the purpose of testing, since you can > no longer rely on the fact that something you tested works. > > > That said, chances are pretty good that you're getting null from that > line because the HTTP request represented by the request object didn't > have a parameter called "actionSelection". I suggest you stick in a > breakpoint and have a look at the contents of the object. > > Hope that helps. > ~DVA > > [1] http://struts.apache.org/1.3.8/struts-taglib/index.html Looks as > though you're using Struts 1, but you didn't specify a version, so > here's the last release's tag documents. If this is a new app, may I > humbly suggest you use Struts2 instead? No sense in starting a project > using a deprecated framework. > > > -Original Message- > From: Raghuveer Rawat [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 07, 2008 1:18 PM > To: Struts Users Mailing List > Subject: Action servlet becomes null in UNIX environment > > Hi, > I have a problem with my application where actionServlet becomes null in > UNIX environment and works fine in windows XP system. While saving data > on > test environment (UNIX) I am getting action servlet as null in My Action > class. The jsp is built dynamically in as below > > *JSP code:* > > if (newGuide) { > > sb.append("\n"); > > sb.append("\n"); > > sb.append(""); > > sb.append(" - Save Assessment"); > > sb.append(" - Delete Assessment"); > > sb.append(" - Save & Schedule"); > > sb.append(" - Save & Refer"); > > sb.append(""); > > sb.append(" > value=\"Complete\" class=Button >"); > > sb.append("\n"); > > sb.append("\n"); > > } > > * Action Class // Action class used for security * > > public void setServlet(ActionServlet actionServlet) { > > super.setServlet(actionServlet); // Here I get actionServlet as null > > ServletContext servletContext = actionServlet.getServletContext(); > > WebApplicationContext wac = WebApplicationContextUtils > > .getRequiredWebApplicationContext(servletContext); > > setIcrProcessor((CareRequestProcessor)wac.getBean("myCareRequestProcesso > > r")); > > } > > Because of this I get null pointer exception in class Main Action Class > used > for saving the data. > > *Action class code :* > > public ActionForward saveHAGuide(ActionMapping mapping, ActionForm form, > HttpServletRequest request, > > HttpServletResponse response) throws Exception { > > String method = "saveHAGuide"; > > Exception ex = null; > > ActionForward forward = null; > > AppUser appUser = getAppUser(request); > > appUser.methodStart(this, "saveHAGuide"); > > HttpSession session = request.getSession(false); > > String action = request.getParameter("actionSelect
Struts 2 file upload size validation
Hi, we are trying to use file upload in Struts 2 and run into the following problem. We have a form with multiple fields among which one is a file input field. The user must complete the form and then select a file to upload. If the file size is larger than what we specify in the struts.properties the FileUploadInterceptor validates and adds the error. Up to here everything is fine however upon having the error passed to the action we want to return to the same form, display the error and have the rest of fields populated with the values the user has inputed (except the file field). The problem is that when we get in the action (validate method) none of the request parameters (form values) are populated. Everything is empty. The question is why is this happening and how can we have the form values populated in the action so that we can display the page correctly ? Thanks -- View this message in context: http://www.nabble.com/Struts-2-file-upload-size-validation-tp17112411p17112411.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat/struts ---> flash/.swf >> hang problem
Hi, Any expert can tell me why for the following? i have an flash file (.swf), it is running fine under regular apache server. But, it hang forever after i put it under tomcat/struts home directory. tks in advance john - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Re: Struts 2 file upload size validation
Struts 1.2.9 org.apache.struts.chain.servlet.validateActionForm where the validate method is declared as protected ActionErrors validate(Context context, ActionConfig actionConfig, ActionForm actionForm) //reference the actionForm for access to the form attributes 2.0.11 FileUploadIntereptor.java ActionContext ac = invocation.getInvocationContext(); HttpServletRequest request = (HttpServletRequest) ac.get(ServletActionContext.HTTP_REQUEST); HashMap map = request.getParameterMap(); //for further information take a look at http://www.docjar.com/docs/api/javax/servlet/ServletRequest.html#getParameterMap HTH M - Original Message - From: "Rubbinio" <[EMAIL PROTECTED]> To: Sent: Wednesday, May 07, 2008 3:24 PM Subject: Struts 2 file upload size validation Hi, we are trying to use file upload in Struts 2 and run into the following problem. We have a form with multiple fields among which one is a file input field. The user must complete the form and then select a file to upload. If the file size is larger than what we specify in the struts.properties the FileUploadInterceptor validates and adds the error. Up to here everything is fine however upon having the error passed to the action we want to return to the same form, display the error and have the rest of fields populated with the values the user has inputed (except the file field). The problem is that when we get in the action (validate method) none of the request parameters (form values) are populated. Everything is empty. The question is why is this happening and how can we have the form values populated in the action so that we can display the page correctly ? Thanks -- View this message in context: http://www.nabble.com/Struts-2-file-upload-size-validation-tp17112411p17112411.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:multibox read but not write
None of the JSP code made it out of your mail client into the message I'm afraid. Try re-posting with your mail program set for plain text instead of multipart/mime. L. houser wrote: Hi All, I am in very strange situation, and stuck! please help, I have found one thread that much more or less but does not help.. http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 I have already use some example and it works.. Now the situation is lsightly different: I have a form: Start Code FunctionProForm extends ActionForm { private List functionProList = new ArrayList(); ... public List getSelectedPros(FunctionDto fun){ List result = new ArrayList(); for(FunProMap fp : functionProList){ if(fp.getFunction().getName().equals(fun.getName())){ for(int i = 0; i < fp.getSelectedPros().length; i++){ result.add(fp.getSelectedPros()[i]); } return result; } } return result; } } --the serializable object FunProMap -- public class FunProMap implements Serializable{ private static final long serialVersionUID = 1L; private FunctionDto function = new FunctionDto(); private List pros = new ArrayList(); private String[] selectedPros = {}; } --- in JSP: - - in the SaveAction -- SaveAction extends Action { protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ FunctionProForm myForm = (FunctionProForm) form; ... List functions = myService.listFunctions(); for(FunctionDto fun : functions){ fun.setPros(myForm.getSelectedPros(fun)); myService.updateFunction(fun); } return mapping.findForward("success"); } } End Code The check boxes are populated correctly from the database, i.e. for each FUnction, the corresponding checkbos is checked according to the list of available Pros (function.pros). The problem is that if I edit these boxes, check and uncheck, and click the Submit button, the changed is not saved to the database. I have run the debug and find that the method myForm.getSelectedPros(fun) returns the old values but not the new checked-unchecked boxes' values :-( !! I have used with a simple form according to: http://www.jguru.com/faq/view.jsp?EID=925277 http://www.jguru.com/faq/view.jsp?EID=925277 MyForm extends ActionForm { List myList; String[] selectedValues; // } and and this works fine.. Please help... ruga - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.1.2 action url fails (possible bug)
Struts Two wrote: I have deployed the two blank war files for struts 2.0.11 and struts 2.1.2. While struts 2.0.11 works perfectly fine, I have the following problem with struts 2.1.2. Whenever I type a url as follows: https://localhost:9445/struts2.1.2/example/HelloWorld.action I get "page not found" error. However, the following for struts 2.0.11 works: https://localhost:9445/struts2.0.11/example/HelloWorld.action but if I do the following: https://localhost:9445/struts2.1.2/index.html the url is redirected to https://localhost:9445/struts2.1.2/example/HelloWorld.action and I can see the page but if I open a new browser and copy and paste the url, it fails [page not found]. Anyone has any idea why this is happening. I would like to mention that I have security [form based] enabled for both application. As I said, the blank war file for struts 2.0.11 works fine and I have this issue with 2.1.2. I am running both apps in Websphere 6.1 with EJB3 feature pack. regards, That seems strange, particularly as you say the redirect from index.html is working. Can you reproduce this on a different servlet container (e.g. Tomcat or Jetty)? What do you see in the logs for the 2.1.2 version when you request HelloWorld.action vs. index.html? What if you up the log level to DEBUG? L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Capturing the TransferObjectSelect object
Arpan Debroy wrote: Hi, Can anyone successfully implemented "optiontransferselet" tag. Suppose I want to capture the RightSideDropDown box in action class. How can I capture that in action class.Is it will be a collection field or array or something else... It should be an array or collection just as for a regular select with multiple=true. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 file upload size validation
Rubbinio wrote: Hi, we are trying to use file upload in Struts 2 and run into the following problem. We have a form with multiple fields among which one is a file input field. The user must complete the form and then select a file to upload. If the file size is larger than what we specify in the struts.properties the FileUploadInterceptor validates and adds the error. Up to here everything is fine however upon having the error passed to the action we want to return to the same form, display the error and have the rest of fields populated with the values the user has inputed (except the file field). The problem is that when we get in the action (validate method) none of the request parameters (form values) are populated. Everything is empty. The question is why is this happening and how can we have the form values populated in the action so that we can display the page correctly ? What interceptor stack are you using? Does everything work as expected if the file size does not exceed the size you specify? L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 file upload size validation
The OP wrote: >> we are trying to use file upload in Struts 2... Martin wrote: Struts 1.2.9 Doh! org.apache.struts.chain.servlet.validateActionForm where the validate method is declared as protected ActionErrors validate(Context context, ActionConfig actionConfig, ActionForm actionForm) //reference the actionForm for access to the form attributes 2.0.11 FileUploadIntereptor.java ActionContext ac = invocation.getInvocationContext(); HttpServletRequest request = (HttpServletRequest) ac.get(ServletActionContext.HTTP_REQUEST); HashMap map = request.getParameterMap(); //for further information take a look at http://www.docjar.com/docs/api/javax/servlet/ServletRequest.html#getParameterMap HTH M - Original Message - From: "Rubbinio" <[EMAIL PROTECTED]> To: Sent: Wednesday, May 07, 2008 3:24 PM Subject: Struts 2 file upload size validation Hi, we are trying to use file upload in Struts 2 and run into the following problem. We have a form with multiple fields among which one is a file input field. The user must complete the form and then select a file to upload. If the file size is larger than what we specify in the struts.properties the FileUploadInterceptor validates and adds the error. Up to here everything is fine however upon having the error passed to the action we want to return to the same form, display the error and have the rest of fields populated with the values the user has inputed (except the file field). The problem is that when we get in the action (validate method) none of the request parameters (form values) are populated. Everything is empty. The question is why is this happening and how can we have the form values populated in the action so that we can display the page correctly ? Thanks -- View this message in context: http://www.nabble.com/Struts-2-file-upload-size-validation-tp17112411p17112411.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat/struts ---> flash/.swf >> hang problem
john lee wrote: Any expert can tell me why for the following? i have an flash file (.swf), it is running fine under regular apache server. But, it hang forever after i put it under tomcat/struts home directory. What do you mean by 'hang forever'? Do you mean the browser locks up? The HTTP response is never sent? -- in which case does any response data get sent? How is your Struts application configured? Is the .swf file being served by Struts or directly by Tomcat? If you're not sure how to answer those questions, I would suggest using Firebug or some other tool that lets you monitor the HTTP conversation to get a clearer picture of what's happening. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
log request and response time from filter
Guys: I have one question about log request and response time from filter. We use jsp, filter, struts 1.2. We have one PerfermaceFilter class which implements filter. We calculate the time between FilterChain.doFilter and log that with request URL. Because sometimes when user do one click from browser, the backend action may have more than one forword or redirector. So log will show mutiple line log for each action. Now we need to log one click by user from browser into one log format like that: User Request started: actionOne time: XXX ms actionTwo time: XXX ms . Total: XXX ms User Request finished. My question is each time the filter hitted, how do I now the request from browser by user action or from server forward or redirector. If we can not tell from filter level, we also can put the performace log code into requestprocessor of struts. But how to tell. Thanks. -- View this message in context: http://www.nabble.com/log-request-and-response-time-from-filter-tp17117650p17117650.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can you set parameters in using in the tag body?
Hi, I was trying to use the and invoke it with *some *parameters using . i.e., * * However, the parameters don't seem to be getting through to the HttpServletRequest object when interrogated inside the Action. I know I can use the instead, but I preferred the . I'm implementing ServletRequestAware interface, by the way. Thanks. -- Eduardo Dela Rosa
share example
hi there i just success make a struts2/hibernate/spring programming using a standard Java Project (source java and class). this is the tutorial http://www.blueoxygen.org/wiki/index.php/Cimande:Getting_Started several my outstanding is 1. make all the result action to annoation 2. make all the validation to annonation i am glad if someone have a working example of these, so i can upgrade my cimande to that. anyway cimande is hosted in www.sf.net/projects/cimande NB: feedback for the new model of cimande programming, Frans
Re: Internalization problem: two internalizations for the same key
Which version of Struts 2 are you using? 2.0.11.1 works fine for me in the same situation. Are you using the i18n interceptor? Also, how did you name your resource files? On Wed, May 7, 2008 at 11:30 AM, Jukka Välimaa <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I have the following lines in my jsp file: > label="%{getText('workingTeam.team')}" name="teamId" listKey="id" > listValue="name" >list="workingTeams" /> > > > > Of these two, using text tag gives me the internalization that has been > selected as internationalization for the application. Using getText for > select label gives me internalization in Finnish, no matter what is the > selected internationalization. All internationalizations are in their own > global ApplicationResources files. getText method is the standard method > from ActionSupport. > > Any idea what is the cause of this, and what might be the solution? >