WW-167 not working
Has anyone been able to confirm that this issue is working? I don't seem to get it to work yet JIRA says it is. This is about having a tag with an image and text inside the button. Thanks, Alberto - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WW-167 not working
I apologize for sending the wrong Jira Issue reference. The correct one is as Martin stated (WW-1677, thanks Martin). And I agree with Martin, the body of the tag is not properly built (when the is used). I saw a new comment on Jira reflecting the "reopened" state of this issue. I don't have the access to "reopen" an issue, but thought of asking the group. Thanks! On Nov 28, 2007 11:36 PM, Eric Martin <[EMAIL PROTECTED]> wrote: > > Martin, > > Yes, there is a problem with the output. The SubmitTextName should be > inside > the button tag, but in your example and others posted, the value gets > placed > outside the button tag (seems to get displayed before the rendering of the > button. > > I would expect the output to be: > > value="SubmitTextName">SubmitTextName > > In HTML, what is used for the value attribute, is what will be sent to the > server on submit. Whereas, the "value" that is nested in the button tag, > is > only the "label" of the button and is not sent on submit. > > So, as far as Struts is concerned, I would expect the following: > > - User nests a "value" inside the s:submit tag, but does not include a > value > attribute > > > > > > SubmitTextName > > == > > - User does not nest a "value", but does include the value attribute > > > > value="SubmitTextName">SubmitTextName > > == > > - User does not nest or include a value with the s:submit tag. A default > value will be used for both. > > > > Submit > > == > > - User adds both a nested "value" and a value attribute: > > > > > > value="SubmitTextName">SomeOtherSubmitTextName > > == > > Hopefully that makes sense ;) Thanks for looking into this... > > -Eric > > > > > mgainty wrote: > > > > Eric- > > > > I just tossed this into a test.jsp page > > > > > > > > > > ..and this was the rendered html output.. > > > >SubmitTextName > > Submit > > > > anything wrong with the output??? > > Martin-- > > ----- Original Message - > > From: "Eric Martin" <[EMAIL PROTECTED]> > > To: > > Sent: Wednesday, November 28, 2007 8:27 PM > > Subject: Re: WW-167 not working > > > > > >> > >> https://issues.apache.org/struts/browse/WW-1677 > >> > >> > >> mgainty wrote: > >> > > >> > Alberto- > >> > > >> > which button component are you speaking of? > >> > > >> > Martin-- > >> > - Original Message - > >> > From: "Alberto A. Flores" <[EMAIL PROTECTED]> > >> > To: > >> > Sent: Wednesday, November 28, 2007 3:05 PM > >> > Subject: WW-167 not working > >> > > >> > > >> >> Has anyone been able to confirm that this issue is working? I don't > > seem > >> >> to get it to work yet JIRA says it is. This is about having a > > >> >> tag with an image and text inside the button. > >> >> > >> >> Thanks, > >> >> > >> >> Alberto > >> >> > >> >> > > > > -- > View this message in context: > http://www.nabble.com/WW-167-not-working-tf4892993.html#a14019260 > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Alberto http://www.linkedin.com/in/aflores
Re: struts 1.2.9 and cancel button
Can you post the snippet of the way you are using The "html:cancel" (Struts 1.x) tag still submits with interesting behavior: - If the "property" attribute is "set", then the isCancelled() method will not pick it up. Validation will still occurs (submission is attempted). - If the "property" attribute is not "set" then validation does not occur and the "isCancelled()" method will pick it up. Hope this helps! Alberto Garner, Shawn wrote: We trying to use the htm:cancel button but it is not working. I've followed the instructions here http://wiki.apache.org/struts/StrutsUpgradeNotes128to129#head-e417741603 dac43bb4fbde589271c568309643e4 but we are still getting a org.apache.struts.action.InvalidCancelException We're using the validator plugin. We added And type="org.apache.struts.action.InvalidCancelException" path="ourAction.do?action=open"/> where button.cancel is the resource bundle key that gets displayed for the button. It appears from the stack trace that validations are still being called. Any help would be appreciated. Shawn -Message Disclaimer- This e-mail message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply email to [EMAIL PROTECTED] and delete or destroy all copies of the original message and attachments thereto. Email sent to or from the Principal Financial Group or any of its member companies may be retained as required by law or regulation. Nothing in this message is intended to constitute an Electronic signature for purposes of the Uniform Electronic Transactions Act (UETA) or the Electronic Signatures in Global and National Commerce Act ("E-Sign") unless a specific statement to the contrary is included in this message. While this communication may be used to promote or market a transaction or an idea that is discussed in the publication, it is intended to provide general information about the subject matter covered and is provided with the understanding that The Principal is not rendering legal, accounting, or tax advice. It is not a marketed opinion and may not be used to avoid penalties under the Internal Revenue Code. You should consult with appropriate counsel or other advisors on all matters pertaining to legal, tax, or accounting obligations and requirements. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts 1.2.9 and cancel button
Can you confirm that your form is pointing to the right path? Also, check that you are not overriding the same path (in struts config) with a similar path are overrideable. Garner, Shawn wrote: From the stack track it looks like the Mapping.isCancellable is returning false. How can this be? It is in the struts-config.xml under the right action. Shawn -Original Message- From: Garner, Shawn Sent: Thursday, December 06, 2007 1:27 PM To: Struts Users Mailing List Subject: RE: struts 1.2.9 and cancel button I wonder if it is because we are using ValidatorPlugin or LookupDispatchAction. Seems like it isn't getting past the validations so it never gets to the action: 2007,org.apache.struts.action.InvalidCancelException org.apache.struts.action.InvalidCancelException,E3,, ,,, org.apache.struts.action.InvalidCancelException at org.apache.struts.action.RequestProcessor.processValidate(RequestProcess or.java:942)at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 207)at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at -Original Message- From: Garner, Shawn Sent: Thursday, December 06, 2007 12:39 PM To: Struts Users Mailing List Subject: RE: struts 1.2.9 and cancel button I verified it was the right action, the one in the JSP form matches the action config in the struts config. Shawn -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Benedict Sent: Thursday, December 06, 2007 9:59 AM To: Struts Users Mailing List Subject: Re: struts 1.2.9 and cancel button Did you add to the correct action mapping? On Dec 6, 2007 9:42 AM, Garner, Shawn <[EMAIL PROTECTED]> wrote: We trying to use the htm:cancel button but it is not working. I've followed the instructions here http://wiki.apache.org/struts/StrutsUpgradeNotes128to129#head-e417741603 dac43bb4fbde589271c568309643e4 but we are still getting a org.apache.struts.action.InvalidCancelException We're using the validator plugin. We added And where button.cancel is the resource bundle key that gets displayed for the button. It appears from the stack trace that validations are still being called. Any help would be appreciated. Shawn -Message Disclaimer- This e-mail message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply email to [EMAIL PROTECTED] and delete or destroy all copies of the original message and attachments thereto. Email sent to or from the Principal Financial Group or any of its member companies may be retained as required by law or regulation. Nothing in this message is intended to constitute an Electronic signature for purposes of the Uniform Electronic Transactions Act (UETA) or the Electronic Signatures in Global and National Commerce Act ("E-Sign") unless a specific statement to the contrary is included in this message. While this communication may be used to promote or market a transaction or an idea that is discussed in the publication, it is intended to provide general information about the subject matter covered and is provided with the understanding that The Principal is not rendering legal, accounting, or tax advice. It is not a marketed opinion and may not be used to avoid penalties under the Internal Revenue Code. You should consult with appropriate counsel or other advisors on all matters pertaining to legal, tax, or accounting obligations and requirements. -Message Disclaimer- This e-mail message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply email to [EMAIL PROTECTED] and delete or destroy all copies of the original message and attachments thereto. Email sent to or from the Principal Financial Group or any of its member companies may be retained as required by law or regulation. Nothing in this message is intended to constitute an Electronic signature for purposes of the Uniform Electronic Transactions Act (UETA) or the Electronic Signatures in Global and National Commerce Act ("E-Sign") unless a specific statement to the contrary is included in this message. While this communication may be used to promote or market a transaction
Re: Struts 2.0.11 + Tiles
Have you try replacing this: tilesDefinitions /WEB-INF/tiles.xml with this org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG /WEB-INF/tiles.xml Antonio Petrelli wrote: 2007/12/7, Rodrigo Pereira <[EMAIL PROTECTED]>: java.lang.NullPointerException org.apache.struts2.views.tiles.TilesResult.doExecute( TilesResult.java:104) Ok this is symptom that the Tiles container has not been loaded (there is an issue that addresses the problem of the NPE, just to throw a better exception). See: https://issues.apache.org/struts/browse/WW-2033 Check the startup of your webapp: do you get an exception? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts 1.2.9 and cancel button
By the way, have you considered using Struts 1.3.8? I have code (currently) that works just fine and that does what you need (forward to a *.do on cancel). Clearly, you don't need to upgrade right now (you can handle your use case in your method controller), however it's worth considering since 1.3.8 solves a lot bugs and security fixes. Garner, Shawn wrote: Yeah, we have preprocessing to do. I've hardly ever went right to a JSP page and this seems to be pretty common from the Struts Apps I've seen. I'd say after the action has been processed it would be a good idea to clear it from the request like you said. Shawn -Original Message- From: [EMAIL PROTECTED] on behalf of Paul Benedict Sent: Thu 12/6/2007 10:24 PM To: Struts Users Mailing List Subject: Re: struts 1.2.9 and cancel button Unless you actually have processing to do, there's no reason to forward to /landingPage.do. You should be forwarding straight to your JSP or Tile instead. The problem here is because you are chaining actions within one request. I don't know if it is a bug for Struts not to reset the cancel token after an action. I believe it's the request that's canceled, not the action, but there's probably a good argument for your expectation. Paul On Dec 6, 2007 4:55 PM, Garner, Shawn <[EMAIL PROTECTED]> wrote: Yeah, I had to step through. Alright I found the problem and if you ask me it is a bug with struts request processor. It does read in the cancellable on the action for the page I press the cancel button on, skips validation, hits the action and I see it. Now when I return my forward I'm going to a /landingPage.do Now the request processor is hit again and it still hits request.getAttribute(Globals.CANCEL_KEY) but since the landing page doesn't have cancellable in the mapping you get the exception. If you ask me once it checks request.getAttribute(Globals.CANCEL_KEY) it should remove it from the request. I fixed it by adding to the landing mapping but but I don't think you should have to do that since it was already processed once by the request processor. Shawn -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Benedict Sent: Thursday, December 06, 2007 4:38 PM To: Struts Users Mailing List Subject: Re: struts 1.2.9 and cancel button Have you attempted to set a breakpoint in the Controller and step through the cancellable check? On Dec 6, 2007 4:17 PM, Garner, Shawn <[EMAIL PROTECTED]> wrote: And there is only one defined in the struts config. -Original Message- From: Alberto A. Flores [mailto:[EMAIL PROTECTED] Sent: Thursday, December 06, 2007 2:46 PM To: Struts Users Mailing List Subject: Re: struts 1.2.9 and cancel button Can you confirm that your form is pointing to the right path? Also, check that you are not overriding the same path (in struts config) with a similar path are overrideable. Garner, Shawn wrote: >From the stack track it looks like the Mapping.isCancellable is returning false. How can this be? It is in the struts-config.xml under the right action. Shawn -Original Message- From: Garner, Shawn Sent: Thursday, December 06, 2007 1:27 PM To: Struts Users Mailing List Subject: RE: struts 1.2.9 and cancel button I wonder if it is because we are using ValidatorPlugin or LookupDispatchAction. Seems like it isn't getting past the validations so it never gets to the action: 2007,org.apache.struts.action.InvalidCancelException org.apache.struts.action.InvalidCancelException,E3,, ,,, org.apache.struts.action.InvalidCancelException at org.apache.struts.action.RequestProcessor.processValidate(RequestProcess or.java:942) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 207) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at -Original Message- From: Garner, Shawn Sent: Thursday, December 06, 2007 12:39 PM To: Struts Users Mailing List Subject: RE: struts 1.2.9 and cancel button I verified it was the right action, the one in the JSP form matches the action config in the struts config. Shawn -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Benedict Sent: Thursday, December 06, 2007 9:59 AM To: Struts Users Mailing List Subject: Re: struts 1.2.9 and cancel button Did you add to the correct action mapping? On Dec 6, 2007 9:42 AM, Garner, Shawn <[EMAIL PROTECTED]> wrote: We trying to use the htm:cancel button but it is not working. I've followed the instructions here http://wiki.apache.org/struts/StrutsUpgradeNotes128to129#head-e417741603 dac43bb4fbde589271c568309643e4 but we are still getting a org.apache.st
Runtime Expressions within Tag
I'm currently migrating an app from Struts 1.x to 2.x and encounter this situation where I was calculating the tabIndex of a JSP on the fly (reusable JSP). In struts 1.x this was done using "/> ... According to the Struts2 documentation, non-string attributes are evaluated as expressions, so the following: should do the work, but instead the above code is *appending* a 1 (string concatenation). Am I missing something or this is a bug? Any ideas! -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Runtime Expressions within Tag
Thanks Wes, No offense to this approach, but is this the only way to do additions (and for this matter, any other operations) within a struts2 tag?. This is simply not clean (e.g. adding a property to my action for a counter, etc). Thanks anyway! Alberto Wes Wannemacher wrote: #request.foo is going to evaluate as a j.l.String. If your action has a getter for foo, then just refer to it as "%{foo + 1}", conversely, if you are feeling confident, you can make a static call to parse it - "[EMAIL PROTECTED]@parseInt(#request.foo) +1}" -Wes On 12/10/07, Alberto A. Flores <[EMAIL PROTECTED]> wrote: I'm currently migrating an app from Struts 1.x to 2.x and encounter this situation where I was calculating the tabIndex of a JSP on the fly (reusable JSP). In struts 1.x this was done using "/> ... According to the Struts2 documentation, non-string attributes are evaluated as expressions, so the following: should do the work, but instead the above code is *appending* a 1 (string concatenation). Am I missing something or this is a bug? Any ideas! -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Runtime Expressions within Tag
Thanks Wes, I understood what you meant in your first reply and I appreciate it. However I'm used to doing simple calculations on a JSP (like just adding a 1 to a guaranteed numeric value), independent of the Action class. I guess this is part of my coding techniques in using non-thread safe Struts 1.x Action classes vs the thread-safe nature of Struts 2.x (since each action is instantiated per request). I must admit I'm still getting used to it and their advantages. I supposed I took advantage of the weak typing occurred in EL expressions. My questions was more oriented in whether such weak typing can be achieved using Struts 2.x tags. Adding a property to my action seemed like too much of an overhead to my action. My first guess would be no, since OGNL is meant to encourage strong typing, but thought of asking. In general, I try to keep my JSPs as readable as they can be and adding a non-string variable to the JSP by virtue of the Action class didn't seem right. Furthermore, it seemed to me like everytime I wanted to do a similar computation on the fly, I would need to add a property to my action(s) so that i can compute something on a JSP (e.g. looping over a collection, etc). But if there is no other way, I'll be adding the setter/getter to my Action (I agree with you on the Exception issue). Thanks for your help! Wes Wannemacher wrote: I don't think you are understanding what I am telling you... When you read a parameter directly, it will be a string. It's pretty much the same as calling - request.getParameter("paramName"); (http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletRequest.html#getParameter(java.lang.String)) Since that returns a String, it will be treated like a String. Adding a getter to your action will pass it through the converters, etc. so that you can treat it like a number. My second suggestion is to do some OGNL scripting to convert it, but I would advise to add getter/setter to your action since a NumberFormatException can be raised (that could be silently swallowed). On 12/10/07, Alberto A. Flores <[EMAIL PROTECTED]> wrote: Thanks Wes, No offense to this approach, but is this the only way to do additions (and for this matter, any other operations) within a struts2 tag?. This is simply not clean (e.g. adding a property to my action for a counter, etc). Thanks anyway! Alberto Wes Wannemacher wrote: #request.foo is going to evaluate as a j.l.String. If your action has a getter for foo, then just refer to it as "%{foo + 1}", conversely, if you are feeling confident, you can make a static call to parse it - "[EMAIL PROTECTED]@parseInt(#request.foo) +1}" -Wes On 12/10/07, Alberto A. Flores <[EMAIL PROTECTED]> wrote: I'm currently migrating an app from Struts 1.x to 2.x and encounter this situation where I was calculating the tabIndex of a JSP on the fly (reusable JSP). In struts 1.x this was done using "/> ... According to the Struts2 documentation, non-string attributes are evaluated as expressions, so the following: should do the work, but instead the above code is *appending* a 1 (string concatenation). Am I missing something or this is a bug? Any ideas! -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Runtime Expressions within Tag
In case anyone also needs this, I avoided this by using the tag (thus using the value stack). It worked just fine without adding the extra property to the Action class. Wes Wannemacher wrote: I don't think you are understanding what I am telling you... When you read a parameter directly, it will be a string. It's pretty much the same as calling - request.getParameter("paramName"); (http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletRequest.html#getParameter(java.lang.String)) Since that returns a String, it will be treated like a String. Adding a getter to your action will pass it through the converters, etc. so that you can treat it like a number. My second suggestion is to do some OGNL scripting to convert it, but I would advise to add getter/setter to your action since a NumberFormatException can be raised (that could be silently swallowed). On 12/10/07, Alberto A. Flores <[EMAIL PROTECTED]> wrote: Thanks Wes, No offense to this approach, but is this the only way to do additions (and for this matter, any other operations) within a struts2 tag?. This is simply not clean (e.g. adding a property to my action for a counter, etc). Thanks anyway! Alberto Wes Wannemacher wrote: #request.foo is going to evaluate as a j.l.String. If your action has a getter for foo, then just refer to it as "%{foo + 1}", conversely, if you are feeling confident, you can make a static call to parse it - "[EMAIL PROTECTED]@parseInt(#request.foo) +1}" -Wes On 12/10/07, Alberto A. Flores <[EMAIL PROTECTED]> wrote: I'm currently migrating an app from Struts 1.x to 2.x and encounter this situation where I was calculating the tabIndex of a JSP on the fly (reusable JSP). In struts 1.x this was done using "/> ... According to the Struts2 documentation, non-string attributes are evaluated as expressions, so the following: should do the work, but instead the above code is *appending* a 1 (string concatenation). Am I missing something or this is a bug? Any ideas! -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot pass the correct property value to a form
Add")) { wbasForm.setMode("add"); menu.removeAllSubItems(); MenuItem curMenuItem = menu.getSelectedMenuItem(); MenuItem subMenuItem = menu.findMenuItemByName("WelfareBenefitsCodesEdit"); curMenuItem.setSubMenuItem(subMenuItem); } else if(editAllowed && wbasForm.getOperation().equals("zoom")) { wbasForm.setMode("edit"); FactoryBD bd = new FactoryBD(); System.out.println("Form-Fund Code: " + wbasForm.getZoomKey()); System.out.println("Form-County Code: " + wbasForm.getCountyCode()); System.out.println("Form-Effective Date: " + wbasForm.getEffDate()); WBasPropertyVO wbasVO = bd.getWBasProperty(wbasForm.getZoomKey(),wbasForm.getCountyCode(),wbasForm.getEffDate()); System.out.println("Fund Name: " + wbasVO.getFundName()); System.out.println("County Code: " + wbasVO.getCountyCode()); System.out.println("Agreement Number: " + wbasVO.getAgreementNum()); System.out.println("Part-Time Rate: " + wbasVO.getPtRate().toString()); System.out.println("Full-Time Rate: " + wbasVO.getFtRate().toString()); System.out.println("Effective Date: " + wbasVO.getEffDate()); System.out.println("Exparation Date: " + wbasVO.getExpDate()); wbasForm.setStrFundCode(wbasForm.getZoomKey()); wbasForm.setStrFundName(wbasVO.getFundName()); wbasForm.setCountyCode(wbasVO.getCountyCode()); wbasForm.setStrAgrNum(wbasVO.getAgreementNum()); wbasForm.setPrtRate(wbasVO.getPtRate().toString()); wbasForm.setFltRate(wbasVO.getFtRate().toString()); wbasForm.setEffDate(wbasVO.getEffDate()); wbasForm.setStrExpDate(wbasVO.getExpDate()); request.setAttribute("wbasPropsForm",wbasForm); request.setAttribute("sView", wbasVO); } else if (editAllowed && oper.equals("update")) { menu.removeAllSubItems(); String error = updateWBasProperties(session,wbasForm); if(!error.equals("OK")) { request.setAttribute("error",error); wbasForm.setMode("edit"); } else{ wbasForm.setMode("edited"); } request.setAttribute("wbasPropsForm", wbasForm); } return mapping.findForward("SearchFunds"); } private String updateWBasProperties(HttpSession session, WBasCodesPropsForm form) throws ServerException { if(form.getStrFundNameEdit().length() > Constants.FUND_NAME_LENGTH) { return "Fund Name should not be more then " + Constants.FUND_NAME_LENGTH + "characters long"; } return "OK"; } } THANK YOU VERY MUCH!!! Eugene - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] :working: -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
development.mode = true
Folks, When I set the property "development.mode" to "true" I received a lot of useful information in case of errors, however i also receive this additional Error in my log (when submitting a form): ERROR ParametersInterceptor [http-8080-Processor24] 11 Dec 2007 14:20:18: ParametersInterceptor - [setParameters]: Unexpected Exception caught setting '__checkbox_dna' on 'class foo.bar.MyAction: Error setting expression '__checkbox_dna' with value [Ljava.lang.String;@dc91e2' Of course this appears for *every* property in my JSP. When I set the property "development.mode" to "false", this ERROR log disappears. In either case, I properly get my model object updated as I expected (with the parameters from the HTML form). IMHO, it seems like the log level in the ParametersInterceptor class has the wrong log level but I wanted to check if anyone knows anything about this? Am I missing something I should be concerned about? As a way of reference, my action mapping containts: and my action extends ActionSupport, implements ModelDriven, Preparable and ServletRequestAware. The prepare() method instantiates a new instance of the model object, so I expect this model to be mapped to the properties in the JSP page (using struts 2.x tags) and like I said earlier, my model seems to have all needed properties from the request. Any feedback will be greatly appreciated. Thanks! -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: development.mode = true
Thanks! Mike Jennings wrote: You have a form value on the page called _checkbox_dna that is being set to a string value, but there is no getter or setter in your action to map this value to. It is nothing to worry about right now. Alberto A. Flores wrote: Folks, When I set the property "development.mode" to "true" I received a lot of useful information in case of errors, however i also receive this additional Error in my log (when submitting a form): ERROR ParametersInterceptor [http-8080-Processor24] 11 Dec 2007 14:20:18: ParametersInterceptor - [setParameters]: Unexpected Exception caught setting '__checkbox_dna' on 'class foo.bar.MyAction: Error setting expression '__checkbox_dna' with value [Ljava.lang.String;@dc91e2' Of course this appears for *every* property in my JSP. When I set the property "development.mode" to "false", this ERROR log disappears. In either case, I properly get my model object updated as I expected (with the parameters from the HTML form). IMHO, it seems like the log level in the ParametersInterceptor class has the wrong log level but I wanted to check if anyone knows anything about this? Am I missing something I should be concerned about? As a way of reference, my action mapping containts: and my action extends ActionSupport, implements ModelDriven, Preparable and ServletRequestAware. The prepare() method instantiates a new instance of the model object, so I expect this model to be mapped to the properties in the JSP page (using struts 2.x tags) and like I said earlier, my model seems to have all needed properties from the request. Any feedback will be greatly appreciated. Thanks! - 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] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation on Struts 2.x
Folks, I'm not sure if I should be worrying about this, but I'm adding validation to our Struts 2.x and we need to decide whether we should use Annotations or XML. My first concern would probably be whether annotations add (and possibly hurt) performance (this may be if such annotations are defined as RUNTIME). The "annotations" methods seems very elegant, but before on using them, I'd like to ask if anyone has experienced anything heavy? Thanks! -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form bean directly into session
I have a form with many, many fields on it. I would like to process some of them in my Action but get all them into the session object so my forwarded jsp can use them as the values. So may I ask: 1. How can I put the entire form bean from an action into the session scope without extracting each name/value pair and individually putting that in the session? Set scope="session" in struts-config mapping. 2. From the forwarded jsp, how do I access the placed form bean and use the getters for the value of input fields? Thank you. use struts tags, where the bean name is the name of the form as defined in struts-config. Alternatively, you could use JSTL to access these forms (beans) as well. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 + Spring 2 + JPA + Oracle + Connection Caching/Pooling
Database Connection Pooling is typically handled (already) by the container. You can get your datasource from this connection pooling using JNDI. Spring has a way of doing this nicely using the JndiObjectFactoryBean. Each container has a different way to configure this JNDI configuration, so you need to read their documentation and play with it. Now, ORMs typically do their own connection caching (e.g. Hibernate), but in my understanding, the prefer way of doing connection pooling is via JNDI, so as to use the JEE specification appropriately. In the Struts sample, I think TopLink (instead of Hibernate) is used. Alternatively, the commons DBCP does connection pooling for you as well (if you don't want to use JNDI and rely on the container for pooling). It's a matter of creating a new and let Spring inject the one you want. Your choice, of course. BTW, this is hardly a Struts question :) Filipe David Manana wrote: Hi all, I want to create a web app with Struts 2 that is Oracle database driven. Integrating Struts 2 + Spring 2 + JPA (as described in http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html), how do I configure Oracle database Connection Caching (pooling)? Oracle's JDBC driver provided in the Oracle Instant Client package has a Connection Cache implementation class ( oracle.jdbc.pool.OracleConnectionCacheImpl) which I can use in my JDBC code. I have been unsuccessfully googling for how to enable this Connection Caching feature with Struts 2 + Spring 2 + JPA. Has anybody done it before? -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form bean directly into session
However, how do I refer to my placed formBean from a struts tag? One way to do it would be: now "foo" is a variable within your JSP page with the value "fname" from your form. How does it know the difference from my formBean and the default formBean created from ApplicationResources? FormBeans are created on demand according to the mapping of the requested resource. This means that if the request mapping was "myPath.do" with scope="request", then a new Form will be instantiated, otherwise the form will be looked in the HttpSession object. If none is there, a new one will be instantiated and placed there as an attribute. I guess I never heard of "applicationResources" creating forms (such file typically contains resource bundles) Can I refer to it as: This should be valid code, however keep in mind that this is only because the "myFormBeanName" bean (Form) is in scope (session). If it wouldn't, this would have thrown an NPE. I believe the correct expression should be: From the documentation (http://struts.apache.org/1.x/struts-taglib/tagreference.html#text): "The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized." The default value of the tag is to load the current value of the "fname" from the Form object mapped to the surrounding . Using it this way (as you wrote will always force to use the Form object in session. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: rendering
Try theme="simple" in your tag. Alternatively, you can set up a constant in struts.xml of place it in struts.properties (in classpath) wild_oscar wrote: I am finding it strange that is rendered as: Is this the normal rendering of the textfield? Can't I render it just as a normal input tag, without all the tr and td's? Because I can't seem to get my table right when I want to do something like: SOP Code Any help appreciated. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: substitute for JSP EL tags in struts 2.0.11
If you mean for "jsps using EL tags" the JSTL tags, then a quick fix can be to make your EL expressions use scope="request" and make the tags (Struts 2.x) use the expression "%{#request.varInScope}" to get to them. If you mean the EL tags from Struts 1.x, then you are going to have to change a lot more and take each case indivually to use JSTL (or Struts 2.x tags). The latter work (in my opinion is more work) Swathi Ram wrote: I recently upgraded to Struts 2.0.11, and all my jsps using the EL tags don't work anymore. I'm using these along with displaytags, to pass values of checkbox lists or field values to the action class. Is there any other way to do this. For example, in a table list of users, if the checkbox is checked then the userid must be passed to the action class. Thanks. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: substitute for JSP EL tags in struts 2.0.11
Ok, this is a bit more of a hack, but should work (haven't test it). From the DisplayTag documentation (note that "id" is similar to "uid"): "The object representing the current row is also added to the pageContext under this name, so that you can refer to it in column bodies using ${uid}" <% Object job = pageContext("jobResults") request.setAttribute("jobResult", job); %> fieldValue="%{#request.jobResult}"/> Have you consider whether the using the struts tag there is even needed? Why not doing trying JSTL with HTML code? When the checkbox is checked then I should be able to get the corresponding userid value in the action class. Any idea how I can achieve that. Thanks Alberto A. Flores wrote: If you mean for "jsps using EL tags" the JSTL tags, then a quick fix can be to make your EL expressions use scope="request" and make the tags (Struts 2.x) use the expression "%{#request.varInScope}" to get to them. If you mean the EL tags from Struts 1.x, then you are going to have to change a lot more and take each case indivually to use JSTL (or Struts 2.x tags). The latter work (in my opinion is more work) Swathi Ram wrote: I recently upgraded to Struts 2.0.11, and all my jsps using the EL tags don't work anymore. I'm using these along with displaytags, to pass values of checkbox lists or field values to the action class. Is there any other way to do this. For example, in a table list of users, if the checkbox is checked then the userid must be passed to the action class. Thanks. -- Alberto A. Flores http://www.linkedin.com/in/aflores --------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: substitute for JSP EL tags in struts 2.0.11
Have you tried: Now foo has (should) have the value of the row and placed in request scope. Swathi Ram wrote: I'm unable to get the current row using PageContext. It is throwing me an error. Alberto A. Flores wrote: Ok, this is a bit more of a hack, but should work (haven't test it). From the DisplayTag documentation (note that "id" is similar to "uid"): "The object representing the current row is also added to the pageContext under this name, so that you can refer to it in column bodies using ${uid}" <% Object job = pageContext("jobResults") request.setAttribute("jobResult", job); %> fieldValue="%{#request.jobResult}"/> Have you consider whether the using the struts tag there is even needed? Why not doing trying JSTL with HTML code? When the checkbox is checked then I should be able to get the corresponding userid value in the action class. Any idea how I can achieve that. Thanks Alberto A. Flores wrote: If you mean for "jsps using EL tags" the JSTL tags, then a quick fix can be to make your EL expressions use scope="request" and make the tags (Struts 2.x) use the expression "%{#request.varInScope}" to get to them. If you mean the EL tags from Struts 1.x, then you are going to have to change a lot more and take each case indivually to use JSTL (or Struts 2.x tags). The latter work (in my opinion is more work) Swathi Ram wrote: I recently upgraded to Struts 2.0.11, and all my jsps using the EL tags don't work anymore. I'm using these along with displaytags, to pass values of checkbox lists or field values to the action class. Is there any other way to do this. For example, in a table list of users, if the checkbox is checked then the userid must be passed to the action class. Thanks. -- Alberto A. Flores http://www.linkedin.com/in/aflores ------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores --------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionMappingAware ?
Is this a Struts 1.x or Struts 2.x? Dale Newfield wrote: I think I'm missing something. Shouldn't there be a way for an action to get ahold of the mapping that resulted in the action being called, and maybe even the ActionMapper that chose it? ActionMapper has a very useful method getUriFromActionMapping that I'd like to be able to call from within the action... -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] ActionMappingAware ?
Have you tried? ActionContext.getContext().getContextMap().get(ServeltActionContext.ACTION_MAPPING); Although I haven't taken the time (yet) to explore all source code relationships within Struts 2. Good luck! Dale Newfield wrote: Alberto A. Flores wrote: Is this a Struts 1.x or Struts 2.x? Sorry I didn't include that. Struts2. (If I recall correctly, that was one of the arguments to the action's exectute method in Struts1.) -Dale Dale Newfield wrote: I think I'm missing something. Shouldn't there be a way for an action to get ahold of the mapping that resulted in the action being called, and maybe even the ActionMapper that chose it? ActionMapper has a very useful method getUriFromActionMapping that I'd like to be able to call from within the action... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Resource Bundles and token replacement
In struts 1.x, a resource bundle can have: errors.required={0} is required. And the validation.xml files will have a param set to the token (key) to be plugged in the {0} variable. Is there such a functionality in Struts 2? I have been able to only print one resource bundle using the key attribute in the tag. The closes I've made it is to display the name of the validated field doing: errors.required=${getText(fieldName}} is required. If the only alternatively is to write my own template, can someone point in the right direction in where, how to get started. Hope this is not a big question. Thanks, -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2]Checkbox value
Yes, you can use tags within tags, but remember that the quotes are important: (Notice the single quotes with double quotes). I see two things wrong: 1. You are calling a method directly. the %{#userId} approach should do the trick (so long as it is part of your Action) 2. IMHO, I would almost guess you are missing the tag declaration on your JSP page. Have you added <@ taglib uri="/struts-tags" prefix="s"/> Johannes Geppert wrote: type="checkbox" value=""/> try this version: type="checkbox" value="%{userId()}"/> you can't use tags in tags. Best Regards Johannes Geppert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Resource Bundles and token replacement
Thanks Wes, Thanks for your help. The snippet you wrote is valid code, however I was hoping for a similar solution where I only need to use the Normally in Struts 1.x, I'll write and in my validation.xml, I would define the field to validate and the key to add to be replaced for the {0} variable. Do you know if this can be done in Struts 2.x? I suspect that I can write my own template, but I really would hate to do it just for this case. Wes Wannemacher wrote: I could be wrong, but if you are using the s:text tag, you can specify an s:param that will be used. I could be wrong, and hopefully someone will correct me if I am but - Mr. Smith package.properties - message.key=Hello {0} The docs aren't real specific on it, but there is some information here - http://struts.apache.org/2.0.11/docs/text.html On 12/12/07, Alberto A. Flores <[EMAIL PROTECTED]> wrote: In struts 1.x, a resource bundle can have: errors.required={0} is required. And the validation.xml files will have a param set to the token (key) to be plugged in the {0} variable. Is there such a functionality in Struts 2? I have been able to only print one resource bundle using the key attribute in the tag. The closes I've made it is to display the name of the validated field doing: errors.required=${getText(fieldName}} is required. If the only alternatively is to write my own template, can someone point in the right direction in where, how to get started. Hope this is not a big question. Thanks, -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New to Struts
I agree that it may better *not* to have Struts 1.x background if possible, if you plan on doing Struts 1.x in the future (e.g. put it on your Resume), please be aware that it is not the same. If you have a Struts 1.x background, I strongly recommend the InfoQ tutorials (there are videos and a three part migration guide). If you don't know Struts 1.x, then I'll suggest going to roseindia. lbastil wrote: I would say for some reasons it could be even advantage to not know struts1 and directly start with struts2. A very good resource beside the available tutorials is: http://www.infoq.com/minibooks/starting-struts2 (or even better, you buy the new book) Regards, basti aum strut wrote: Hi All, I am new to struts and wana to learn it.Please suggest me can i start directly to learn Struts2 or do i need to have prior knowledge of Struts1.Any help or suggestion in this regard is much appriciated. Thanks, Aum -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation error ordering
With the "convention over configuration" approach in Struts 2, is there any way to have control over the order of the errors displayed? It looks like "conversion errors" are displayed as part of the tag and these are checked before the xxx-validation.xml constraints are checked. Thoughts? -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Required validator dosen't work
You may want to read on http://struts.apache.org/2.x/docs/type-conversion.html The last topic "Type Conversion Error Handling". I had the same problem. It turns out that there's no "validation" concept of a "type" (similar to Struts1"), however Struts 2 will give you control over type conversion problems (similar approach, but with more control). So, you really don't have to do much (other than formatting the message if the default doesn't suit your needs) Arpan Debroy wrote: Thank you Laurie , Using 'Long' is the correct way to get 'required' validator worked. But now I want show error message when user will put string or character instead of any long value. What validator to use? On Dec 11, 2007 7:13 PM, Laurie Harper <[EMAIL PROTECTED]> wrote: The 'requiredstring' validator will check for both not-null and not-empty, where 'required' only checks for non-null. If you're using a numeric primitive type (i.e. 'long' rather than 'Long'), you can never have a null value, so required can never fail. In that case, you need to specify range constraints in your validation, or switch to using the wrapper type instead of primitives. L. Arpan Debroy wrote: Yeah..I am using numbers only.The "required" validator not working for numbers also. If you want you can test it quickly. On Dec 10, 2007 11:01 PM, Jiang, Jane (NIH/NCI) [C] < [EMAIL PROTECTED]> wrote: Use "required" validator only when a field contains a number. Use requiredstring for String based field. -Original Message- From: Arpan Debroy [mailto:[EMAIL PROTECTED] Sent: Monday, December 10, 2007 11:00 AM To: Struts Users Mailing List Subject: Re: Required validator dosen't work Yeah, I am using following - Other validators are working. Anyway have anyone ever used "required" validator or can you use it now once to test. Thanks On Dec 10, 2007 5:26 PM, Simon Berger <[EMAIL PROTECTED]> wrote: Do you have the Validation Interceptor on your Stack? Arpan Debroy schrieb: I want to validate - 1) The text box should have some value("required" validator doesn't show any error message even if it's empty).. 2) The text box must have any numerical(I am using long data type) value. I have no clue how to do it for long. Can anyone please help.. Thanks On Dec 6, 2007 1:50 AM, Dave Newton <[EMAIL PROTECTED]> wrote: --- xniit2003 <[EMAIL PROTECTED]> wrote: I am trying to use "required" validator in struts2. But it seems this one dosen't work at all. Have anybody successfully used "required" validator. What data type are you attempting to validate? d. - 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] -- Thanks & Regards Arpan Debroy AOL Online India Private Ltd RMZ EcoSpace Campus 1A Outer Ring Road, Bellandur, Bangalore - 560037 India Mobile No :+9886006306 on-board :+91 (80) 4035 4528 E-mail : [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: formBean I18N
Do you mean changing the name of the method? Or calling the resource bundle to generate a string (using the proper locale)? Chris Pat wrote: Hello Is it possible to have the reset() of a formBean be internationalized? I can do it on the jsp. However how do I refer to the correct language message resource bundle in the formBean itself? tia -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with web.xml and Struts 1.3
Saving message key '.reloading [DEBUG 2006-08-22 10:51:46,599] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.processPath [DEBUG 2006-08-22 10:51:46,599] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.configInit [DEBUG 2006-08-22 10:51:46,599] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.configVerifying [DEBUG 2006-08-22 10:51:46,600] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.configExtends [DEBUG 2006-08-22 10:51:46,600] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.configFieldRequired [DEBUG 2006-08-22 10:51:46,600] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.sessionCreate [DEBUG 2006-08-22 10:51:46,601] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.verifyForwardConfig.missing [DEBUG 2006-08-22 10:51:46,601] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.configExtends.creation [DEBUG 2006-08-22 10:51:46,601] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.configCompleted [DEBUG 2006-08-22 10:51:46,601] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.verifyActionMappingClass.invalid [DEBUG 2006-08-22 10:51:46,602] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.configMapping [DEBUG 2006-08-22 10:51:46,602] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.requestDispatcher [DEBUG 2006-08-22 10:51:46,602] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.configParse [DEBUG 2006-08-22 10:51:46,603] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.finalizing [DEBUG 2006-08-22 10:51:46,603] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.formBean [DEBUG 2006-08-22 10:51:46,603] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.verifyActionMappingClass.missing [DEBUG 2006-08-22 10:51:46,603] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.verifyPlugInConfigs.invalid [DEBUG 2006-08-22 10:51:46,604] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.applicationLoading [DEBUG 2006-08-22 10:51:46,604] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.mappingType [DEBUG 2006-08-22 10:51:46,604] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.actionCreate [DEBUG 2006-08-22 10:51:46,605] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.applicationResources [DEBUG 2006-08-22 10:51:46,605] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.configFatal [DEBUG 2006-08-22 10:51:46,605] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.forwardPathNull [DEBUG 2006-08-22 10:51:46,605] org.apache.struts.util.PropertyMessageResources :278 Saving message key '.verifyMessageResourcesConfigs.invalid [ERROR 2006-08-22 10:51:46,607] org.apache.struts.action.ActionServlet:1727 The /WEB-INF/web.xml was not found. [ERROR 2006-08-22 10:51:46,608] org.apache.struts.action.ActionServlet :397 Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency. javax.servlet.ServletException: The /WEB-INF/web.xml was not found. at org.apache.struts.action.ActionServlet.initServlet()V( ActionServlet.java:1728) at org.apache.struts.action.ActionServlet.init()V(ActionServlet.java :348) at javax.servlet.GenericServlet.init (Ljavax/servlet/ServletConfig;)V(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run ()Ljava/lang/Object;(ServletStubImpl.java:1094) 60,1-8 6% but WEB-INF/web.xml EXISTS and the path WEB-INF/web,xml is correct , and WEB-INF are un capital letters.I don't know?¿?¿? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: formBean I18N
Take a look at: http://struts.apache.org/1.x/apidocs/org/apache/struts/validator/Resources.html#getMessage(javax.servlet.http.HttpServletRequest,%20java.lang.String) Hope this helps... It should be straight forward. Chris Pat wrote: Hi Alberto The second. To result with a localized text string for the value of the field when reset() is called. "Alberto A. Flores" <[EMAIL PROTECTED]> wrote: Do you mean changing the name of the method? Or calling the resource bundle to generate a string (using the proper locale)? Chris Pat wrote: Hello Is it possible to have the reset() of a formBean be internationalized? I can do it on the jsp. However how do I refer to the correct language message resource bundle in the formBean itself? tia -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
StrutsTypeConverter API
Does anyone knows why the API for the StrutsTypeConverter abstract class takes an array of Strings instead of a single one (the convertFromString method)? The sample app seems to be always checking for the first element. Is OGNL supposed to add more? Any feedback will be appreciated... Thanks! -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
UEL and Struts 2.x
Are there any plans (on the Struts2 team) to address the problem that comes with UEL expressions (JSP 2.1 - JSR-245) in using the "#" symbol? I'm currently using such symbol to get access to "request" attributes (so my Struts2 tags can read values from "request scoped" beans), by doing the following: %{#request.myBean} where "myBean" is an attribute in the request object. If anyone knows of any other way to do the same without the "#" sign, would you let me know? Thanks, -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UEL and Struts 2.x
Good to know... Thanks! Wes Wannemacher wrote: You will be okay, AFAIK, the symbol clash is with '#{' which OGNL uses to create anonymous maps/lists. Your usage will be okay since it doesn't invoke UEL. -Wes On 12/17/07, Alberto A. Flores <[EMAIL PROTECTED]> wrote: Are there any plans (on the Struts2 team) to address the problem that comes with UEL expressions (JSP 2.1 - JSR-245) in using the "#" symbol? I'm currently using such symbol to get access to "request" attributes (so my Struts2 tags can read values from "request scoped" beans), by doing the following: %{#request.myBean} where "myBean" is an attribute in the request object. If anyone knows of any other way to do the same without the "#" sign, would you let me know? Thanks, -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2.x: Redirecting "input" result
Is it possible to redirect the "input" result (after validation has finished) of an action mapping properly? I currently have something like: showList.tile bar success.tile The current behavior I'm experiencing is one where the redirection takes place, however the validation errors appear to be lost. Thoughts? -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OpenSessionInView with Struts 2.x
Is anyone using openSessionInView with Struts 2 (Hibernate, Spring)? I've found a problem where a domain model is still persisted (even though I'm not saving it) after validation finishes (showing validation errors). My prepare method makes a query (using a HibernateTemplate().get() method) but that's all? Has anyone seen something similar? I'm very sorry if this is not a Struts2 question, but thought of asking since Struts2 is using Filters now and was wondering if anyone has seen any similar behavior. Thanks, -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.x: Redirecting "input" result
Thanks to all for your answers. I completely missed that thread (Adam). I'll try it today. Alberto Adam Hardy wrote: Alberto A. Flores on 17/12/07 21:06, wrote: Is it possible to redirect the "input" result (after validation has finished) of an action mapping properly? I currently have something like: showList.tile bar success.tile The current behavior I'm experiencing is one where the redirection takes place, however the validation errors appear to be lost. Thoughts? I guess you missed this thread: http://www.nabble.com/How-to-redirect-error-message-to14238972.html Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OpenSessionInView with Struts 2.x
Thank you everyone for all your input. I'm currently opting for changing my code (luckily is not that much) to never maintained a "persistent" object within the ValueStack, but rather a "transient" object. Of course, this is an additional overhead (have to copy the object, query, etc, etc), but I think is our best approach since Hibernate Validator is not viable option right now (I would also argue that validation could/should be pushed back to the model, unfortunately we are working with a poorly design db where we use reverse engineering to build all hbm and src files and I'm not sure if I have enough resources to fix that part of our build, e.g. add Hibernate Validator, modify templates, etc). If I may ask, how to "avoid the transaction commit when validation fails" (as you mentioned)? Is there an interceptor to handle this scenario? I see that the workflow interceptor is part of the xwork package (not available with Struts2 distribution source code) and before I jump into repackaging one from xwork source (which I'm not even sure where can I find one), I would probably consider writing one myself to handle this case. I also notice that the validate() method is triggered before the prepare() method (which makes total sense), however I would like to guess that this scenario is best handled by an "interceptor" as I sensed such is the recommended approach in the documentation. Ted Husted wrote: When a workflow automatically opens and closes a transaction, so that it can cover multiple operations, and something goes wrong during the course of the transaction, then we need to rollback the transaction. In the case of validation, sometimes changes are made to a property which causes it to become (for example) NULL, and later in the lifecycle the validator sees that the property is NULL, and raises the validation error. But, by then, the property is changed, and the Hibernate Session (or JPA EntityManager) will commit the change when the transaction is automatically closed. Since the Hibernate Validator and JSR 299 push validation back to the model (where it arguably belongs), making it easy to signal for a rollback in a multioperation transaction becomes more important. I'm still ramping up on the JPA myself, but in some early tests I found that not committing the transaction has the same affect of a rollback. -- HTH, Ted * <http://www.StrutsMentor.com/> On Dec 17, 2007 4:04 PM, Alberto A. Flores <[EMAIL PROTECTED]> wrote: Is anyone using openSessionInView with Struts 2 (Hibernate, Spring)? I've found a problem where a domain model is still persisted (even though I'm not saving it) after validation finishes (showing validation errors). My prepare method makes a query (using a HibernateTemplate().get() method) but that's all? Has anyone seen something similar? I'm very sorry if this is not a Struts2 question, but thought of asking since Struts2 is using Filters now and was wondering if anyone has seen any similar behavior. Thanks, -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OpenSessionInView with Struts 2.x
Gary, Thanks a lot for bringing this to my attention. You are correct, that's the setup I have in place. I checked my "readonly" configuration and it turned out that there was a hidden bug in my xml code (nasty to trace) where the "read-only" attribute was not part part of my "get*" keys. I changed it and the OSIV started to do the right thing (not persisting dirty objects when the view made changes). Although this is no longer an issue, the problem of the "changed" state of the domain object is still reflected in the view (changed properties) where roll-backs do no apply on validation errors (the Action method is not part of the transaction). Since part of my UI requirements is to show the before and after (during the edit process), I really needed to have the current state of the object from db. I played with my struts.xml to obtain the needed result and was successful with the approach of using "transient" objects. A little overhead but it helps the purposes of our app (which is pretty extensive). Thanks everyone for the help given Alberto Gary Affonso wrote: This post is going to make a few assumptions: 1) You're using S2 and Spring 2) You're using Spring's OSIV filter (as opposed to Hibernate's) 3) You're using Spring's Hibernate DAO framework 4) You're using a Spring-configured transaction manager 5) You're declaring transaction boundaries and their configuration somehow (declaratively in the xml, for example). That's a lot of assumptions but that's also the typical setup (in my experience, at least) when using S2, Spring, and Hibernate. If you're *not* doing the above ignore the rest of the post. And ask yourself why you're not. :-) Assuming that's your setup, then I'm a little confused by this thread. To get the behavior you describe you actually have to work at it a little. And the implication is that you're getting it by accident. Here's a snippet from the docs for Spring's OSIV filter: "NOTE: This filter will by default not flush the Hibernate Session, with the flush mode set to FlushMode.NEVER. It assumes to be used in combination with service layer transactions that care for the flushing: The active transaction manager will temporarily change the flush mode to FlushMode.AUTO during a read-write transaction, with the flush mode reset to FlushMode.NEVER at the end of each transaction. If you intend to use this filter without transactions, consider changing the default flush mode (through the "flushMode" property)." It does this to avoid exactly the problem you're having (objects dirtied by the view getting automatically persisted). Here's a thread about this from somebody who wanted to be able to write from within the OSIV session but was having trouble doing it: http://forum.springframework.org/archive/index.php/t-12414.html Even though it's pretty much the opposite problem you're having, I think it will be educational to give that a read. Now, you're saying you're getting non-default behavior (your dirty objects are being auto-flushed.). That implies to me that your transaction manager is changing the flush-mode of the OSIV session, probably because you've used server/dao methods configured as read/write instead of read-only. If that's the case, the recommended solution here would be to see if you can easily re-configure the transactions involved with this view. If they're a bunch of hibernate-related calls that are all read-only, just be sure that spring's transaction config *knows* that they're read only. That way the OSIV filter will "do the right thing". Or did I miss something? - Gary Alberto A. Flores wrote: Thank you everyone for all your input. I'm currently opting for changing my code (luckily is not that much) to never maintained a "persistent" object within the ValueStack, but rather a "transient" object. Of course, this is an additional overhead (have to copy the object, query, etc, etc), but I think is our best approach since Hibernate Validator is not viable option right now (I would also argue that validation could/should be pushed back to the model, unfortunately we are working with a poorly design db where we use reverse engineering to build all hbm and src files and I'm not sure if I have enough resources to fix that part of our build, e.g. add Hibernate Validator, modify templates, etc). If I may ask, how to "avoid the transaction commit when validation fails" (as you mentioned)? Is there an interceptor to handle this scenario? I see that the workflow interceptor is part of the xwork package (not available with Struts2 distribution source code) and before I jump into repackaging one from xwork source (which I'
Re: validation and CSS
I believe the errors are within a "span" with class "errorField" (it may be something else). Custom CSS can make you look like whatever you want. [EMAIL PROTECTED] wrote: Thanks Dave. It seems the simple theme is used so the message is in black. I overrode the ..errorMessage style in JSP which solved my problem but I'm not sure if it's a right way to do that. Thanks again. On Dec 19, 2007 8:09 PM, Dave Newton <[EMAIL PROTECTED]> wrote: Er, the default stylesheet *does* make it show up in read. Are you using the tag? IIRC that is what includes the CSS file. d. --- "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Is there a way to apply style sheet (CSS) to the message validator generates? For example, how to make the "Color me red" message in red when it is shown up? *Color me red* Many thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation and CSS
As the matter of fact, I found several ways in which you can modify the outcome of the tag. The basic (and in my opinion, a hack) is to look at the generated HTML code and then use your own CSS to modify the look and feel of your view. I'm currently using the "simple" theme and in all my "textfield" tags I don't see any span associated, but if you do, take a look at the generated HTML code and see whether there is any span associated there (this is how I figured how to modify the errors generated with the . If you want to get fancy, you can certainly write your own template (freemarker). This gives you full support as to how to modify the entire HTML code. I would warn you about this one, since it adds additional code that unless you are familiar with, you may not want to touch, so consider yourself warned :) - This helped me changed some errors to use a "div" instead of "ul, li" combination (in the generated HTML code). This is done using the "template" and "templateDir" attributes within the UI tags. Playing with this can prove very entertaining. I originally started by copying the template (ftl template) from the source distribution and modifying it so that I can see how things can be done (and also to learn some Freemarker). Note that even if you are not using the *simple* theme, the is meant to give you additional CSS for you. So consider this as you do your UI. This is a practice I don't like since personally, I prefer to have more control over the produced HTML code, however it's up to you. Good luck! [EMAIL PROTECTED] wrote: Thanks Alberto. Which class contains style for ? I need to customize it so that no is around it and the text associated with it is in bold. e.g., If the value of the "some key" is Password, I want the "Password" is in bold. Any suggestion? Thanks again. On Dec 19, 2007 10:00 PM, Alberto A. Flores <[EMAIL PROTECTED]> wrote: I believe the errors are within a "span" with class "errorField" (it may be something else). Custom CSS can make you look like whatever you want. [EMAIL PROTECTED] wrote: Thanks Dave. It seems the simple theme is used so the message is in black. I overrode the ..errorMessage style in JSP which solved my problem but I'm not sure if it's a right way to do that. Thanks again. On Dec 19, 2007 8:09 PM, Dave Newton <[EMAIL PROTECTED]> wrote: Er, the default stylesheet *does* make it show up in read. Are you using the tag? IIRC that is what includes the CSS file. d. --- "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Is there a way to apply style sheet (CSS) to the message validator generates? For example, how to make the "Color me red" message in red when it is shown up? *Color me red* Many thanks. ------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores --------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Taglib not seen, no text fields?
Easy way to check: unpack the jar and see if the META-INF directory contains the tld. It could very well be an incorrectly built jar. (it happens) :) Dave Newton wrote: --- AbelMacAdam <[EMAIL PROTECTED]> wrote: I'm learning to work with Struts. Struts 1, apparently? (I'd skip it if you can and use Struts 2.) Cannot find the tag library descriptor for /tags/struts-html The first line of the jsp with the error is: <%@ taglib uri="/tags/struts-html" prefix="html" %> My WEB-INF/web.xml contains the following lines: /tags/struts-html /WEB-INF/struts_html.tld What version of Struts 1 are you using? Declaring the tablig (whoa... taglib) in web.xml hasn't been required for a pretty long time; if you're running with the Tomcat bundled with Europa you most definitely don't need that. Looking at the docs for Struts 1.3.8 [1] the taglib URI is: <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"; %> d. [1] http://struts.apache.org/1.3.8/struts-taglib/tlddoc/html/tld-summary.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Taglib not seen, no text fields?
How are you building your application? It sounds like you are not using maven (I highly recommend it so you avoid many problem). Now, a couple of things about this post: - The error you are referring, is it an error in Eclipse or during deployment? Two BIG different things. - If Eclipse doesn't recognize the struts 2 tag, it's because you have not included the strut2-*.jar files in the classpath. Please check the documentation of Eclipse if you are not familiar how to do that. Since the way URI resolution has changed through out the different JSP versions, Eclipse will resolve the URI according to the following heuristic (see link - http://www.eclipse.org/webtools/jst/components/jsp/designs/taglibindex/taglibindex.html) Please keep in mind that the fact that it resolves in Eclipse is no indication that it will resolve during deployment (unless you have a good development environment that mimics your deployment jars) - Depending on the container that you are using, you don't need to use web.xml at all (tld file should be within the jar file and the container should know where to look for it) - What jars have you included? At a minimum you shouls have: struts-core-x.jar, xwork-x.jar, ognl-x.jar, freemarker-x.jar (x refers to the release, which may not be the same). These releases are easy to obtain if you use maven. If you don't then, when you download the struts 2 distribution, these should come. If you are learning, just copy *all* and learn what breaks as you take jar by jar off the lib directory. - If the textfield doesn't show, there may be many reasons for that to happen. Have you consider? (i) Not having all jars in the lib directory, (ii) your struts tag having a "name" attribute mapping to an unknown property. (iii) Have you looked at the produced HTML? (iv) Have you checked all logs? AbelMacAdam wrote: AbelMacAdam wrote: Hi, I'm learning to work with Struts. (FWIW, I use Eclipse Europa, and Apache/Tomcat). Now I have my first example with a tld-file. First of all, I noticed the following error in Eclipse on a jsp: Cannot find the tag library descriptor for /tags/struts-html The first line of the jsp with the error is: <%@ taglib uri="/tags/struts-html" prefix="html" %> My WEB-INF/web.xml contains the following lines: /tags/struts-html /WEB-INF/struts_html.tld And the same WEB-INF directory also contains the struts_html.tld file. So far the background. If I run this example in Tomcat I get a page without textfields and a submit button. So this example clearly does not work. Do you know what I need to do to get this example working? Am I right in assuming I get not textfields/buttons because the tag library descriptor is not found? TIA, Abel What version of Struts 1 are you using? None. I actually use 2.0.11. Easy way to check: unpack the jar and see if the META-INF directory contains the tld. It could very well be an incorrectly built jar. Struts.jar contains struts-html.tld And strangely enough, the next example did not show the error, and was displayed correctly. I even added Struts to the first example. But it still does not work. If no one else has an explanation I write it off to earth rays. Abel -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Taglib not seen, no text fields?
No such luck. The error message is gone in Eclipse, but the input boxes and submit button are still gone in Tomcat. you mean the generated HTML code, right? Strangely enough, the taglib was not in web.xml, but in a jsp. uhm? web.xml supports entries for taglibs, the URI in the JSP only says look for the tag library definition here (as well as other things e.g. namespaces, etc) So many places to check. As a newbie, I do not know where to check. But hopefully in the future I will know (as a matter of fact, I already look in the different log files of Tomcat and Apache, but can't find any interesting tidbits pointing me to profound knowledge. But that's being a starter, I think). I'm very sorry, but it sounded like you had some experience using Tomcat. If not, take a look at the logs directory. Alternatively, if you are not familiar with log4j, you could always learn it as well to turn on many more logging (or alternatively commons logging). Logging is always helpful as you may know by now... :) On your question of not having all jars in (Tomcats/)the lib directory: No. Should I copy everything to Tomcat? No exactly. All jars pertaining to your web app should go in the lib directory of WEB-INF/lib directory (WAR file). If you are building an EAR, then it should go in the top level (depending on how your dependencies are) however I suspect you are dealing with EAR files. There are many reasons for this, however such discussion is beyond the scope of this thread. On your second question of my struts tag having an attribute to an unknown property. I don't know. I think this is not the case, as I use the code of the author and think this code is flawless (*famous last words of a newbie*). I have to admit that I've never used the sample applications to learn Struts 2. I've had bad experiences in the past where I find cases where things are broken and I don't know if such is the case. But in general, a simple HelloWorld sample app should give some light. Not sure what your background is (newbie to Struts2 or to all webapp world...) but hopefully someone will take a look at it soon (definetely not me) :) But as I said, the next example is not broken. So I will ponder on. But thanks for your answer. No problem! and good luck! -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: i18n and variable tiles definitions
May I suggest to instead of using the "title" value in the tiles, use the keys (e.g. "titleKey"), then fetched it using whatever approach you want to: Example: resource_en.properties application.title=Hello World Application tiles.xml jsp page (of course this uses unnecessary code, but the above will work for sure) Hope this helps! Peter Rumstle wrote: Hi everyone, I am running into what appears to be a limitation in tiles. I hope someone has encountered this problem before and knows of a workaround. I have a tiles based layout that accepts a "title" in the tiles definition. My problem is that I need the title to be more dynamic. It needs to do two things: 1. Support different titles depending on the locale. 2. Accept a dynamic field identifying the record number that the page is showing. For example, rather than say "Record Detail" like in my example it should say "Record Detail: 38847829" and in other languages it should be translated using an existing ResourceBundle (ex. "Detalle De registro: 38847829"). My problem lies in the fact that my .template tile includes the tag, but does not know which page it is rendering. Only the "body" tile and the actual tiles definition knows which page it is rendering for. Other pages use the same .template tile but require different dynamic fields in their title. Has anyone got something like this working before? Thanks! _ Introducing the City @ Live! Take a tour! http://getyourliveid.ca/?icid=LIVEIDENCA006 -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: i18n and variable tiles definitions
you can do the same thing passing the strings keys in the tiles, then play with the jsp pages using JSTL ... //repeat process I'm pretty sure you should be able to also put tags within tags (nested), but I've never tried it. Peter Rumstle wrote: Thats an excellent solution for the i18n part. I will change my code to use this method. I still don't know what the best way to add variables to the title tho. I know i can have variable placeholders in my resource file ex. resource_en.properties record.detail.title=Record Detail:{0} user.detail.title=User Detail:{0} application.title=Hello World Application tiles.xml jsp template page // Somehow i need to pass in optional variables that are provided by my controller to the title Is this possible with tiles? btw, sorry for posting to two mailing lists about this if thats bad form. Date: Thu, 20 Dec 2007 13:29:32 -0500 From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: Re: i18n and variable tiles definitions May I suggest to instead of using the "title" value in the tiles, use the keys (e.g. "titleKey"), then fetched it using whatever approach you want to: Example: resource_en.properties application.title=Hello World Application tiles.xml jsp page (of course this uses unnecessary code, but the above will work for sure) Hope this helps! Peter Rumstle wrote: Hi everyone, I am running into what appears to be a limitation in tiles. I hope someone has encountered this problem before and knows of a workaround. I have a tiles based layout that accepts a "title" in the tiles definition. My problem is that I need the title to be more dynamic. It needs to do two things: 1. Support different titles depending on the locale. 2. Accept a dynamic field identifying the record number that the page is showing. For example, rather than say "Record Detail" like in my example it should say "Record Detail: 38847829" and in other languages it should be translated using an existing ResourceBundle (ex. "Detalle De registro: 38847829"). My problem lies in the fact that my .template tile includes the tag, but does not know which page it is rendering. Only the "body" tile and the actual tiles definition knows which page it is rendering for. Other pages use the same .template tile but require different dynamic fields in their title. Has anyone got something like this working before? Thanks! _ Introducing the City @ Live! Take a tour! http://getyourliveid.ca/?icid=LIVEIDENCA006 -- Alberto A. Flores http://www.linkedin.com/in/aflores _ Discover new ways to stay in touch with Windows Live! Visit the City @ Live today! http://getyourliveid.ca/?icid=LIVEIDENCA006 -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: i18n and variable tiles definitions
yes Peter Rumstle wrote: So I've found a method that works. Perhaps it s what you were trying to explain in the first place. Rather than use an EL expression in the tiles definition to say which object should be used in the page title key parameter, I just define a parameter called titleKeyParam1 that the controller will optionally set directly. There is nothing about the parameters in the tiles definition file, only the titleKey. ie. tiles-layout.xml jsp file - Then the controller optionally sets the titleKeyParam1 as an object in the model. From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: RE: i18n and variable tiles definitions Date: Thu, 20 Dec 2007 13:47:33 -0800 btw, I've also tried this slight variation: tiles.xml name="titleKey" value="record.detail.title" type="string"/> name="titleKeyParam1" value="${recordId}" type="string"/> Which gives me the page title: "Record Detail: ${recordId}". Also giving me the problem that it is not evaluating the expression. From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: RE: i18n and variable tiles definitions Date: Thu, 20 Dec 2007 13:41:13 -0800 This idea seems really promising, but I have been unable to implement it. Here is what I have tried: resource_en.properties record.detail.title=Record Detail:{0} tiles.xml jsp template page My controller passes to the jsp view a parameter called "recordId". I know that is working because I can use the value elsewhere. The problem is that my title displays as: "Record Detail: recordId" instead of showing me the value of ${recordId} (I expected something like "Record Detail: 12345") I've tried a few variations on this without success :-( How can I get the title to show the value of the expression i set in my tiles definition? Date: Thu, 20 Dec 2007 15:01:20 -0500 From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: Re: i18n and variable tiles definitions you can do the same thing passing the strings keys in the tiles, then play with the jsp pages using JSTL ... //repeat process I'm pretty sure you should be able to also put tags within tags (nested), but I've never tried it. Peter Rumstle wrote: Thats an excellent solution for the i18n part. I will change my code to use this method. I still don't know what the best way to add variables to the title tho. I know i can have variable placeholders in my resource file ex. resource_en.properties record.detail.title=Record Detail:{0} user.detail.title=User Detail:{0} application.title=Hello World Application tiles.xml jsp template page // Somehow i need to pass in optional variables that are provided by my controller to the title Is this possible with tiles? btw, sorry for posting to two mailing lists about this if thats bad form. Date: Thu, 20 Dec 2007 13:29:32 -0500 From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: Re: i18n and variable tiles definitions May I suggest to instead of using the "title" value in the tiles, use the keys (e.g. "titleKey"), then fetched it using whatever approach you want to: Example: resource_en.properties application.title=Hello World Application tiles.xml jsp page (of course this uses unnecessary code, but the above will work for sure) Hope this helps! Peter Rumstle wrote: Hi everyone, I am running into what appears to be a limitation in tiles. I hope someone has encountered this problem before and knows of a workaround. I have a tiles based layout that accepts a "title" in the tiles definition. My problem is that I need the title to be more dynamic. It needs to do two things: 1. Support different titles depending on the locale. 2. Accept a dynamic field identifying the record number that the page is showing. For example, rather than say "Record Detail" like in my example it should say "Record Detail: 38847829" and in other languages it should be translated using an existing ResourceBundle (ex. "Detalle De registro: 38847829"). My problem lies in the fact that my .template tile includes the tag, but does not know which page it is rendering. Only the "body" tile and the actual tiles definition knows which page it is rendering for. Other pages use the same .template tile but require different dynamic fields in their title. Has anyone got something like this working before? Thanks! _ Introducing the City @ Live! Take a tour! http://getyourliveid.ca/?icid=LIVEIDENCA006 -- Alberto A. Flores http://www.linkedin.com/in/aflores _________
Re: Struts Token help
Assuming you are referring to Struts 1.x, when you work with tokens the servlet will ensure that your response will have a hidden token everytime your action finishes execution. It does this so that it knows what to expect and control multiple logins. Once it's compared (1 and only once), the servlet will get rid of it, so multiple submissions (double clicking, back button and submit again) are caught (by mismatch). So the behavior you see is the correct one, and yes... you need to save it each time (if you want the token checking to work in each interaction). Depending on your application, it may be acceptable to double submit (or even use the back button in a shopping cart app) in some parts of your application. You typically want to be careful when you are ready to call a bean to persist your data, where you need to do the checking. In other words, the saveToken prepares your form to be checked for double submissions, the isTokenValid() checks that prepared form whether it was already submitted. BTW, unless you have a good reason to use that static boolean within an action, this will causing problem. Actions are not thread-safe (they are reused during different request/sessions). This is a bomb awaiting to explode if you ask me (unless you know what you are doing e.g. synchronizing it, etc, etc) Indresh Chadha wrote: Hi, I need to stop: 1. multiple post to an action 2. refresh of a page using Struts. What i tried was using the Struts Token. I have a common BaseAction class that extends Action class. All the other action classes extend the BaseAction class. In my BaseAction class I did the following: 1. public static boolean blnFirst = true; 2. In execute method: if(blnFirst){ System.out.println("BaseAction: FIRST Time"); saveToken(httpRequest); this.blnFirst = false; } Saving the token adds an attribute: org.apache.struts.Globals.TRANSACTION_TOKEN_KEY in the session Now when I try to check the validity of the token by isTokenValid(httpRequest), it is everytime resolving to NULL. This piece of code: httpRequest.getSession().getAttribute(Globals.TRANSACTION_TOKEN_KEY) returns some value only the first time.All the other time it returns null. Do I need to save the token every time? (Which I dont think so) OR just once(which I'm doing) OR is there any other way? I'm resetting the token every time using resetToken(httpRequest). Please help me out. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.1.x vs. 2.0.x
will do... thanks a lot! Dave Newton wrote: --- "Alberto A. Flores" <[EMAIL PROTECTED]> wrote: I was wondering about the differences between these two. I have heard a lot about some differences, but it doesn't look like the Apache site has a direct link to 2.1.x release. Is it even a release? Nope. Should I be preparing our application for an upgrade? Most S2.0 code should work under S2.1, I think, although I haven't ported a full application. There are some configuration differences (camelCase vs. using-hyphens, for one). IIRC someone started a 2.0 v. 2.1 page on the public wiki; you may want to check there. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2.1.x vs. 2.0.x
Folks, I was wondering about the differences between these two. I have heard a lot about some differences, but it doesn't look like the Apache site has a direct link to 2.1.x release. Is it even a release? Should I be preparing our application for an upgrade? Any feedback will be appreciated. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts 2 vs struts 1+spring
This sounds like you need to ask this question in the Spring Forum, not here. If you don't understand the value of Spring in your current app, go ahead and try. Hopefully that will be illustrative. I can assure that some of the things you will lose (if you are using at all) are not provided in Struts (MVC) and Hibernate (persistence). If you are following the typical scenario, here are some of the things you would lose (that no Struts release will do): - Transaction Management (if you are using Spring for this) - AOP support - Dependency Injection - JNDI lookups - Scalable security - Simple programming model I'm sure some other people can add more of their own. You must not forget that at the end of the day, these are tools. You are welcome to write you own version at your own expense :) Joe Yuen wrote: Well, that's kind of the essence of the question. What would you loose if you did? It seems to me that there is quite a bit over overlap to Struts2 and Spring. From: Gary Affonso [mailto:[EMAIL PROTECTED] Sent: Fri 12/21/2007 1:51 PM To: Struts Users Mailing List Subject: Re: struts 2 vs struts 1+spring Joe Yuen wrote: I have an application that currently is implemented using struts 1.2.8 + spring 1.2.8 + hibernate. What would be the advantages to migrate this > to a struts 2 + hibernate solution? Er, huh? In my experience it's *spring* that sits at the core of an app. That's the thing that doesn't go away. The web-framework (s1, webwork, s2, jsf, wicket), the persistence technology (hibernate, jpa backed with hibernate, ibatis, etc.) should all sort of orbit around the spring core, swapping in a new web-framework should be way easier if you keep your spring core around. Why would you cut Spring out of the mix when you move to S2? - Gary - 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] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to avoid form's validation if the user choose cancel?
one way I did that was by using the "non-validating" method point to a method (in the Action class) to have the following annotation @SkipValidation Then in the struts tag, you force the button to use such method (method attribute in tag). Good luck! xianwinwin wrote: I have a login form. it has 3 buttons: 1. login 2. register 3. cancel when the user clicks the login - the application validates that the user input data on the 'username' and 'password' fields. Question: how can I avoid this validation if the user clicks either 'register' or 'cancel' I'm using struts2: this is the code: thanks -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Formatting data] - Format a number as currency
I'll recommend using using JSTL instead. On Jan 21, 2008 8:11 PM, Pascal SEREMES-DAMAL <[EMAIL PROTECTED]> wrote: > Hi everyone!!! > > I'd like to know if it is possible to format a number into a currency with > the struts taglib. > > Thanks. > -- Alberto http://www.linkedin.com/in/aflores
Re: Why should we keep
The "driverClassName" uses reflection to load the driver appropriately, so this sounds like a classloading issue. I'm going to guess that you are not including the dbcp jar files (you shouldn't be doing this anyway), thus the Tomcat classloader is always looking for the jdbc driver in the CATALINA/commons/lib (this is where the DBCP jars are located by default in Tomcat as per the documentation, see reference). In general, you want to keep your jdbc drivers maintained by the container (and not the application). Depending on the type of architecture you have, you may want to reconsider your need to place them in WEB-INF/lib to begin with. Reference: http://fresh.t-systems-sfr.com/unix/www/apache-tomcat-5.5.25.tar.gz:a/apache-tomcat-5.5.25/webapps/tomcat-docs/class-loader-howto.html Sai Reddy wrote: Hi Friends, I'm using Struts 1.2.7, Tomcat 5.5.25. I'm trying to create a datasource for my struts application. This is my struts-config.xml file . . . . When I place "mysql-connector-java-5.0.3-bin.jar" file in "/WEB-INF/lib" directory, I get an error saying "com.mysql.jdbc.Driver not found". But when I place "mysql-connector-java-5.0.3-bin.jar" file in "$CATALINA_HOME/commons/lib" directory, everything works fine! Why should we must place the .jar file in "$CATALINA_HOME/commons/lib" only rather than in "/WEB-INF/lib". Why is Tomcat unable to find when I place it in "/WEB-INF/lib" folder?? D.Sai Reddy VNR VJIET. ----- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: struts1 and struts2 together
I have been migrating code from struts 1.x to 2.x and depending on how decoupled your presentation logic is, you should expect significant amount of work. The results have been very successful thus far (3 of 4 modules were migrated completely). Definitely less code to maintain afterwards and sure it's more readable (in my opinion), however the migration is not as trivial and you may find some "gotchas" along the way depending on how you have used Struts 1.x (tags, servlet, dispatchers, etc). Expect a decent learning curve as well due to some new features (value stack, thread-safety, OGNL notation) The one thing I would recommend is to absolutely understand your need to migrate. We determined it was the right move based on some of the new features that Struts 2 provided out of the box, and we needed for our application (We were writing more code just to make Struts 1 look like Struts 2 basically). Hope this help Otto, Frank wrote: no problem. I haven't migrate our project, because I have realized a new topic with struts2 in our project. It's a configurator with ajax (YUI). the rest is still struts1. kind regards, frank -Ursprüngliche Nachricht- Von: nagendrabvvs [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 30. Januar 2008 14:10 An: user@struts.apache.org Betreff: Re: AW: struts1 and struts2 together Thanks a lot for quick reply, frank. Can i ask you one question? That, Were you able to moigrate your proj successfully with out any problems? -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actualizar Strust 1 a Strust 2
Todo depende de cuanto tiempo (y presupuesto) tengas disponible. Tambien depende de cuanto has escrito hasta el momento. On Feb 11, 2008 4:08 PM, Alvaro Ernesto Gomez Cerna < [EMAIL PROTECTED]> wrote: > Buenas tardes Grupo, actualmente me encuentro desarrollando en Strust bajo > JSP, > en Jdeveloper, me gustaria actualizarlo a la Version Strust 2, pues quiero > utilizar Ajax que tiene integrado, alguien me podria ayudar como hacerlo. > > > > -Mensaje original- > De: Allen, Daniel [mailto:[EMAIL PROTECTED] > Enviado el: Lunes, 11 de Febrero de 2008 02:48 p.m. > Para: Struts Users Mailing List > Asunto: Struts 2 equivalents? > > Hey. > > I have to convert an application written with Struts and Tiles 1 to 2. > Could anyone tell me what the Struts2 equivalents for some of the old > Struts1 tag libraries are? > > I'm looking specifically for > http://struts.apache.org/tags-html and > http://struts.apache.org/tags-logic > > Unfortunately, Google just brings me a lot of pages from Struts 1 > documentation... > ~DVA > > -- > 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] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Alberto http://www.linkedin.com/in/aflores
Re: Actualizar Strust 1 a Strust 2
BTW, I would like to apologize in advance to the forum for posting in Spanish only. I can only imagine this may be somewhat disrespectful to some. I'll try to translate any response as to not exclude anyone from what is mentioned here. Best Regards, Alberto Alvaro Ernesto Gomez Cerna wrote: Me parece bien, ya anteriormente habia escuchado sobre DRW y el otro de JSON, pero me habia inclinado por Strust para no utilizar muchas librerias de uno y otro fabricante, pero si me gustaria manejar ambas y asi como dices ir cambiando despacio de Strust 1 hacia Strust 2, pues veo que trae muchas mas bondades. Que librerias necestaria incluir para mantener ambas dentro del mismo proyecto. Asi ir haciendo las nuevas formas en Strust 2 -Mensaje original- De: Alberto A. Flores [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 11 de Febrero de 2008 05:51 p.m. Para: Struts Users Mailing List Asunto: Re: Actualizar Strust 1 a Strust 2 Si es AJAX lo unico que necesitas, entonces quiza sea mejor que utilizes algun paquete "open-source" que te permita esta posibilidad. De esta maneras puedes hacer que tu aplicacion(es) puedan mejorar progresivamente. Un paquete que he utilizado mucho anteriormente es AjaxTags. Tambien esta DWR y tambien he usado Scriptaculous. Estos son buenos paquetes. Migrar una aplicacion de Struts 1.x a Struts 2.x no es tan sencillo y tomaria tiempo, sin embargo, puedes tener una aplicacion que utilize los dos a la vez. Aunque no se como se haria esto en JDeveloper, si se lo basico (configuration en WEB-INF, jars, etc). Pienso que deberias considerar cautelosamente tus prioridades antes de lanzarte a este tipo de cambio. Debes de considerar el tiempo que te va a costar, cuanta gente estaria involucrada, recursos, etc. Personalmente, estoy muy contento con el cambio, pero puedo entender si es que no se puede. Todo depende de la situacion especifica. Si quieres comenzar a tener ambos Struts a la vez, avisame si tienes dudas pues eso es lo que continue haciendo actualmente. Alberto Alvaro Ernesto Gomez Cerna wrote: Actualmente tengo todos los proyectos sobre Jdeveloper 10.1.3, totalmente Cliente Servidor, el problema es que para actualizar un dato siempre tengo que refrescar todo la pantalla, y me gustaria utilizar el Ajax que viene en la Version 2 de Strust, ya he descargado las librerias de 2.0.11 de Strust, pero no se como integrarlas al Jdeveloper aun.. Aunque lo que gustaria es de implementar solo el Ajax a la version actual que tengo. -Mensaje original----- De: Alberto A. Flores [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 11 de Febrero de 2008 04:15 p.m. Para: Struts Users Mailing List; [EMAIL PROTECTED] Asunto: Re: Actualizar Strust 1 a Strust 2 Todo depende de cuanto tiempo (y presupuesto) tengas disponible. Tambien depende de cuanto has escrito hasta el momento. On Feb 11, 2008 4:08 PM, Alvaro Ernesto Gomez Cerna < [EMAIL PROTECTED]> wrote: Buenas tardes Grupo, actualmente me encuentro desarrollando en Strust bajo JSP, en Jdeveloper, me gustaria actualizarlo a la Version Strust 2, pues quiero utilizar Ajax que tiene integrado, alguien me podria ayudar como hacerlo. -Mensaje original- De: Allen, Daniel [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 11 de Febrero de 2008 02:48 p.m. Para: Struts Users Mailing List Asunto: Struts 2 equivalents? Hey. I have to convert an application written with Struts and Tiles 1 to 2. Could anyone tell me what the Struts2 equivalents for some of the old Struts1 tag libraries are? I'm looking specifically for http://struts.apache.org/tags-html and http://struts.apache.org/tags-logic Unfortunately, Google just brings me a lot of pages from Struts 1 documentation... ~DVA -- 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 un
Re: Actualizar Strust 1 a Strust 2
Para comenzar, necesitas como minimo 4 jars: * struts-core-xxx.jar * xwork-xxx.jar * ognl-xxx.jar * freemarker-xxx.jar Si utilizas maven, hacer este cambio seria mas facil. Sino, Ant tambien te puede ayudar, pero dependiendo como es que mantienes tus dependencias, seria un poco mas complicado. Ten en cuenta que al final si se puede mantener ambos Struts juntos. Todos estos jars tienen que estar en WEB-INF/lib. Una vez ahi, necesitas anadir un filtro. Struts 2 (a diferencia de Struts 1) utiliza Tecnologia de Filtros (Struts 1 es basado en Servlets). Esto es una ayuda fenomenal pues ayuda mucho al problema de "Thread Safety" (perdon, no se como traducir esto al ingles). Si lees ingles, los siguientes articulos me ayudaron mucho a comenzar a tener ambos Struts en el mismo proyecto: http://www.infoq.com/articles/converting-struts-2-part1 http://www.infoq.com/articles/migrating-struts-2-part2 http://www.infoq.com/articles/migrating-struts-2-part3 Asi mismo, si tienes preguntas acerca de "Tiles" (si es que lo usas) estos tambien pueden usarse juntos. Tiles en Struts 1 es diferent a Struts 2, asi que esto tambien debes de considerar al hacer el cambio. Espero esto te ayude. Buena suerte! Alvaro Ernesto Gomez Cerna wrote: Me parece bien, ya anteriormente habia escuchado sobre DRW y el otro de JSON, pero me habia inclinado por Strust para no utilizar muchas librerias de uno y otro fabricante, pero si me gustaria manejar ambas y asi como dices ir cambiando despacio de Strust 1 hacia Strust 2, pues veo que trae muchas mas bondades. Que librerias necestaria incluir para mantener ambas dentro del mismo proyecto. Asi ir haciendo las nuevas formas en Strust 2 -Mensaje original- De: Alberto A. Flores [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 11 de Febrero de 2008 05:51 p.m. Para: Struts Users Mailing List Asunto: Re: Actualizar Strust 1 a Strust 2 Si es AJAX lo unico que necesitas, entonces quiza sea mejor que utilizes algun paquete "open-source" que te permita esta posibilidad. De esta maneras puedes hacer que tu aplicacion(es) puedan mejorar progresivamente. Un paquete que he utilizado mucho anteriormente es AjaxTags. Tambien esta DWR y tambien he usado Scriptaculous. Estos son buenos paquetes. Migrar una aplicacion de Struts 1.x a Struts 2.x no es tan sencillo y tomaria tiempo, sin embargo, puedes tener una aplicacion que utilize los dos a la vez. Aunque no se como se haria esto en JDeveloper, si se lo basico (configuration en WEB-INF, jars, etc). Pienso que deberias considerar cautelosamente tus prioridades antes de lanzarte a este tipo de cambio. Debes de considerar el tiempo que te va a costar, cuanta gente estaria involucrada, recursos, etc. Personalmente, estoy muy contento con el cambio, pero puedo entender si es que no se puede. Todo depende de la situacion especifica. Si quieres comenzar a tener ambos Struts a la vez, avisame si tienes dudas pues eso es lo que continue haciendo actualmente. Alberto Alvaro Ernesto Gomez Cerna wrote: Actualmente tengo todos los proyectos sobre Jdeveloper 10.1.3, totalmente Cliente Servidor, el problema es que para actualizar un dato siempre tengo que refrescar todo la pantalla, y me gustaria utilizar el Ajax que viene en la Version 2 de Strust, ya he descargado las librerias de 2.0.11 de Strust, pero no se como integrarlas al Jdeveloper aun.. Aunque lo que gustaria es de implementar solo el Ajax a la version actual que tengo. -Mensaje original- De: Alberto A. Flores [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 11 de Febrero de 2008 04:15 p.m. Para: Struts Users Mailing List; [EMAIL PROTECTED] Asunto: Re: Actualizar Strust 1 a Strust 2 Todo depende de cuanto tiempo (y presupuesto) tengas disponible. Tambien depende de cuanto has escrito hasta el momento. On Feb 11, 2008 4:08 PM, Alvaro Ernesto Gomez Cerna < [EMAIL PROTECTED]> wrote: Buenas tardes Grupo, actualmente me encuentro desarrollando en Strust bajo JSP, en Jdeveloper, me gustaria actualizarlo a la Version Strust 2, pues quiero utilizar Ajax que tiene integrado, alguien me podria ayudar como hacerlo. -Mensaje original- De: Allen, Daniel [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 11 de Febrero de 2008 02:48 p.m. Para: Struts Users Mailing List Asunto: Struts 2 equivalents? Hey. I have to convert an application written with Struts and Tiles 1 to 2. Could anyone tell me what the Struts2 equivalents for some of the old Struts1 tag libraries are? I'm looking specifically for http://struts.apache.org/tags-html and http://struts.apache.org/tags-logic Unfortunately, Google just brings me a lot of pages from Struts 1 documentation... ~DVA -- 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 de
Re: Actualizar Strust 1 a Strust 2
Si es AJAX lo unico que necesitas, entonces quiza sea mejor que utilizes algun paquete "open-source" que te permita esta posibilidad. De esta maneras puedes hacer que tu aplicacion(es) puedan mejorar progresivamente. Un paquete que he utilizado mucho anteriormente es AjaxTags. Tambien esta DWR y tambien he usado Scriptaculous. Estos son buenos paquetes. Migrar una aplicacion de Struts 1.x a Struts 2.x no es tan sencillo y tomaria tiempo, sin embargo, puedes tener una aplicacion que utilize los dos a la vez. Aunque no se como se haria esto en JDeveloper, si se lo basico (configuration en WEB-INF, jars, etc). Pienso que deberias considerar cautelosamente tus prioridades antes de lanzarte a este tipo de cambio. Debes de considerar el tiempo que te va a costar, cuanta gente estaria involucrada, recursos, etc. Personalmente, estoy muy contento con el cambio, pero puedo entender si es que no se puede. Todo depende de la situacion especifica. Si quieres comenzar a tener ambos Struts a la vez, avisame si tienes dudas pues eso es lo que continue haciendo actualmente. Alberto Alvaro Ernesto Gomez Cerna wrote: Actualmente tengo todos los proyectos sobre Jdeveloper 10.1.3, totalmente Cliente Servidor, el problema es que para actualizar un dato siempre tengo que refrescar todo la pantalla, y me gustaria utilizar el Ajax que viene en la Version 2 de Strust, ya he descargado las librerias de 2.0.11 de Strust, pero no se como integrarlas al Jdeveloper aun.. Aunque lo que gustaria es de implementar solo el Ajax a la version actual que tengo. -Mensaje original- De: Alberto A. Flores [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 11 de Febrero de 2008 04:15 p.m. Para: Struts Users Mailing List; [EMAIL PROTECTED] Asunto: Re: Actualizar Strust 1 a Strust 2 Todo depende de cuanto tiempo (y presupuesto) tengas disponible. Tambien depende de cuanto has escrito hasta el momento. On Feb 11, 2008 4:08 PM, Alvaro Ernesto Gomez Cerna < [EMAIL PROTECTED]> wrote: Buenas tardes Grupo, actualmente me encuentro desarrollando en Strust bajo JSP, en Jdeveloper, me gustaria actualizarlo a la Version Strust 2, pues quiero utilizar Ajax que tiene integrado, alguien me podria ayudar como hacerlo. -Mensaje original- De: Allen, Daniel [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 11 de Febrero de 2008 02:48 p.m. Para: Struts Users Mailing List Asunto: Struts 2 equivalents? Hey. I have to convert an application written with Struts and Tiles 1 to 2. Could anyone tell me what the Struts2 equivalents for some of the old Struts1 tag libraries are? I'm looking specifically for http://struts.apache.org/tags-html and http://struts.apache.org/tags-logic Unfortunately, Google just brings me a lot of pages from Struts 1 documentation... ~DVA -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Beging in Strust 2 with Jdeveloper 10.1.3
NoClassDefFoundError is an Throwable which indicates that the container does not find a class definition. Looks like your path does not reference the libraries for xwork-xxx.jar. Please refer to the documentation on JDeveloper (if you are using that IDE) or if you are deploying your war/ear in a container, please mention which one (to better help you) Alvaro Ernesto Gomez Cerna wrote: Now beging in strust 2 with Jdeveloper. Display error en screen all compile, What is problem..? The codigo is form is simple: <%@ page contentType="text/html;charset=windows-1252"%> <%@ taglib uri="/struts-tags" prefix="s"%> untitled The error running is: Error: java.lang.NoClassDefFoundError: com/opensymphony/xwork2/util/ValueStack - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to handle multiple buttons in a form?
Have you tried using the "method" attribute (of the tag)? akinss wrote: Yep I've had the same problem and it has been registered in the Struts 2 jira. https://issues.apache.org/struts/browse/WW-2362 Not sure how to work around it though. Steve Jason Dolinger wrote: Hi all, I'm new to Struts 2 (and Struts in general), and I'm having a hard time figuring out how to handle the simple case of multiple buttons within a form. The method I'm trying to use is described in the Struts 2 cookbook here: http://struts.apache.org/2.x/docs/html-form-buttons-howto.html. I've copied these verbatim (along with a small struts.xml to wire them up), and both button boolean fields always remain false. Should this work? I'm using Struts 2.0.11. There's always the route of using Javascript to detect which button was clicked, but I'd rather avoid it if not necessary. I've also seen mention of a Struts LookupDispatcher or MapDispatcher. Is there something similar in Struts 2? Thanks, any input is greatly appreciated! Regards, Jason -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: any tag library to set an object in request in jsp
In case this was not a Struts question, check out: http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html Hope this helps! Alberto On Wed, Mar 5, 2008 at 5:08 PM, temp temp <[EMAIL PROTECTED]> wrote: > I usally use scriptlet in jsp to set some object in request is there a way > tro do this using any tag library > > instead of this > <%request.setAttribute( > CustomReviewFormflowAction.IReviewFormFlowProperties.ATTRIBUTE_REVIEW_FORM_SECTION,vReviewFormSectionHeader); > %> > can I use any exsisting taglibrary ? > miro > > > - > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it > now. > -- Alberto http://www.linkedin.com/in/aflores
Re: Struts App - Tomcat on Windows in India and Poland
I just solved the same problem on a linux and windows servers. Please use UTF-8. On Wed, Mar 5, 2008 at 5:58 PM, Jeromy Evans < [EMAIL PROTECTED]> wrote: > Adam Gordon wrote: > > > > Maybe if we invented magic, it would allow him to do what he needed > > without following our advice. > > > > --adam > > Thanks Adam! > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Alberto http://www.linkedin.com/in/aflores
Re: Is my struts.xml never read?
please post your struts.xml and the url you are trying to hit. Your web.xml relevant part will also behelpful ... On Mon, Sep 22, 2008 at 5:43 PM, Emil Lundberg <[EMAIL PROTECTED]>wrote: > That's strange... When i set /> in struts.xml, struts goes into devMode, but still doesn't find my action > mappings. Did I do something wrong? I've worked with struts before but I > just can't seem to get this right for some reason... Could it have something > to do with that I'm not using Spring yet in this project? > > /Emil > > > Dave Newton wrote: > >> --- On Mon, 9/22/08, Emil Lundberg <[EMAIL PROTECTED]> wrote: >> >> >>> I'm having a problem with Struts2 in Eclipse. I've >>> set all the JARs up and the FilterDispatcher launches >>> properly. The problem is that it seems my struts.xml is never read, >>> because I keep getting a message saying "There is no Action mapped for >>> namespace / and action >>> name home. - [unknown location]" when trying to access >>> http://localhost/home.action (yes, Tomcat is configured to port 80). >>> I've searched all over for a week or so but I still haven't found a >>> solution. I think the problem is where I put struts.xml or some >>> configuration somewhere. >>> >>> >> >> Are you deploying it to the root application context? >> >> If you put struts.xml at the root of your source directory it should be >> deployed properly. >> If you haven't already, turn on devMode. You can also set the XWork and S2 >> logging to DEBUG to get more of an idea what's happening with the >> configuration. >> >> Dave >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Alberto http://www.linkedin.com/in/aflores
Re: Custom Tag Libs
I disagree about the difficulty level of writing your tag in Struts2. However, I would strongly encourage you (as others have) to see if an already existing tag doesn't fit your needs. I'm hoping to post something in my blog about some of this soon, however it would be worthwhile to state what you are trying to accomplish. On Wed, Oct 8, 2008 at 7:06 PM, <[EMAIL PROTECTED]> wrote: > David -- > > I would strongly discourage you from writing your own custom tags until you > discover there is not already one "in the box!" Besides Struts 2, you > still > have all the JSTL tags available as well. If by "old school" you mean you > haven't looked around the available tags today, your best bet would be to > start looking. Writing your own tags can be a pain in the rear. > > Scott > > On Wed, Oct 8, 2008 at 5:20 PM, David C. Hicks <[EMAIL PROTECTED]> wrote: > > > Can anyone point me to a source of information about how to build a > custom > > tag lib for Struts2? Maybe it's a plugin? I'm a little old school and > > still learning. > > > > Thanks! > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- Alberto http://www.linkedin.com/in/aflores
Re: Struts 1.3 + Spring -> "No WebApplicationContext found: no ContextLoaderListener registered?"
Have you added the contextLoaderListener in web.xml? Yayo wrote: Hi and thanks in advance! I've got a struts - spring based application and a declared bean wich implements both ApplicationContextAware and ServletContextAware. I debug the code and both setters receive data but when I try to use the servletContext it spites me this error: 21:15:56,031 ERROR ContextLoader:214 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'updateFeedProcessTarget' defined in ServletContext resource [/WEB-INF/spring/batch.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered? at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1302) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:463) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run (AbstractAutowireCapableBeanFactory.java:404) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:375) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject( AbstractBeanFactory.java:263) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:170) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean( AbstractBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:184) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:163) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:430) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:729) at org.springframework.context.support.AbstractApplicationContext.refresh( AbstractApplicationContext.java:381) at org.springframework.web.context.ContextLoader.createWebApplicationContext( ContextLoader.java:254) at org.springframework.web.context.ContextLoader.initWebApplicationContext( ContextLoader.java:198) at org.springframework.web.context.ContextLoaderListener.contextInitialized( ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart( StandardContext.java:3827) at org.apache.catalina.core.StandardContext.start(StandardContext.java :4334) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java :443) at org.apache.catalina.core.StandardService.start(StandardService.java :516) at org.apache.catalina.core.StandardServer.start(StandardServer.java :710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered? at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext (WebApplicationContextUtils.java:95) at com.eduyayo.select.batch.Process.getSession(Process.java:153) at com.eduyayo.select.batch.Process.init(Process.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod (AbstractAutowireCapableBeanFactory.java:1378) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java:1339) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1299) ... 30 more:
Re: [OT] Re: Struts2 and tag
Please note: java.lang.NoClassDefFoundError: *org/apache/commons/lang/UnhandledException * Indicates the classloader couldn't find a class (which one, you may ask?). Looks like commons.lang couldn't find the UnhandledException class. Please make sure you have all displaytag dependencies. You may want to consider using maven2 to avoid these problems. On Sat, Apr 5, 2008 at 1:52 PM, aum strut <[EMAIL PROTECTED]> wrote: > yes i have already put the display tag jr file in my lib folder > only problem in my opinion is use of > > <%@ taglib uri="http://displaytag.sf.net"; prefix="display" %> > tag lib directiveas removing this directive will aslo remove the > exception, > according to exceptin it is unable to find the class. > myself also trying to use the display tag first time with struts2 and i am > also not sure abot how to configure it with struts2. > > > On 4/5/08, Dave Newton <[EMAIL PROTECTED]> wrote: > > > > --- aum strut <[EMAIL PROTECTED]> wrote: > > > here is the exception which i am facing > > > > > > java.lang.NoClassDefFoundError: > > *org/apache/commons/lang/UnhandledException > > > * > > > > So what does that exception tell you? > > > > (I have very limited internet access today, so I can't look up the > > requirements for displaytag. but do you have all the required libraries > > for > > it?) > > > > Dave > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- Alberto http://www.linkedin.com/in/aflores
Re: date conversion
Also, consider to inject the format in your IoC container (Guice, Spring, etc). Zoran Avtarovski wrote: We had the same issue and went with writing a new converter (shown below). And then created a xwork-conversion.properties file pointing to it. Z. private final static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM/"); @Overridepublic Object convertFromString(Map context, String[] values, Class toType) throws TypeConversionException {try {return DATE_FORMAT.parse( values[0]);} catch (ParseException e) { e.printStackTrace();throw new TypeConversionException("xwork.default.invalid.fieldvalue");} return null;} @Overridepublic String convertToString(Map context, Object object) {Calendar cal = Calendar.getInstance(); cal.setTime((Date) object);try { return DATE_FORMAT.format(object);} catch (Exception e) { throw new TypeConversionException("xwork.default.invalid.fieldvalue"); }} Can you patch a whole class? What would be useful is parameterizable type converters, to specify the date format in this case. (they're not parameterizable, are they?) Dave Newton on 08/04/08 22:13, wrote: --- Adam Hardy <[EMAIL PROTECTED]> wrote: One area where S1 actually had the upper hand :( Submit a patch :) Dave Dave Newton on 08/04/08 18:36, wrote: The built-in type converter uses "uses the SHORT format for the Locale associated with the current request" according to the type conversion docs, so yes, you'll need to do your own if you're using a different input format. Looking through the XWork conversion code it's hard for me to tell what it's *actually* doing, though :/ Dave --- Brad A Cupit <[EMAIL PROTECTED]> wrote: JSTL has the tag. If you want to do it in Java, rather than your JSP, you can use SimpleDateFormat. Be aware that SimpleDataFormat is not thread safe, so don't assign it to a static field or use it in a singleton. If you use it as an instance field on an Action you'll be safe, since Actions are created per request. If you want a thread safe version of SimpleDateFormat, Jakarta Commons lang has FastDateFormat: http://commons.apache.org/lang/ Brad Cupit Louisiana State University - UIS e-mail: [EMAIL PROTECTED] office: 225.578.4774 -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 12:11 PM To: Struts Users Mailing List Subject: date conversion Hi quick question, I can't find any specific mention of what I want so I assume I have to code my own Converter. I need a date in the ISO format -MM-DD There is no converter that I can configure in the struts package, is there? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: date conversion
Consider placing the SimpleDateFormat as a local variable (within the method) to avoid non-thread safe operations (guaranteed by the jvm spec). Brad A Cupit wrote: the static SimpleDateFormat (assuming this code is in an S2 Action that is instantiated per request) is not thread safe. http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#sy nchronization Brad Cupit Louisiana State University - UIS -Original Message- From: Zoran Avtarovski [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 7:30 PM To: Struts Users Mailing List Subject: Re: date conversion We had the same issue and went with writing a new converter (shown below). And then created a xwork-conversion.properties file pointing to it. Z. private final static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM/"); @Overridepublic Object convertFromString(Map context, String[] values, Class toType) throws TypeConversionException {try {return DATE_FORMAT.parse( values[0]);} catch (ParseException e) { e.printStackTrace();throw new TypeConversionException("xwork.default.invalid.fieldvalue"); } return null;} @Overridepublic String convertToString(Map context, Object object) {Calendar cal = Calendar.getInstance(); cal.setTime((Date) object);try { return DATE_FORMAT.format(object);} catch (Exception e) { throw new TypeConversionException("xwork.default.invalid.fieldvalue"); }} Can you patch a whole class? What would be useful is parameterizable type converters, to specify the date format in this case. (they're not parameterizable, are they?) Dave Newton on 08/04/08 22:13, wrote: --- Adam Hardy <[EMAIL PROTECTED]> wrote: One area where S1 actually had the upper hand :( Submit a patch :) Dave Dave Newton on 08/04/08 18:36, wrote: The built-in type converter uses "uses the SHORT format for the Locale associated with the current request" according to the type conversion docs, so yes, you'll need to do your own if you're using a different input format. Looking through the XWork conversion code it's hard for me to tell what it's *actually* doing, though :/ Dave --- Brad A Cupit <[EMAIL PROTECTED]> wrote: JSTL has the tag. If you want to do it in Java, rather than your JSP, you can use SimpleDateFormat. Be aware that SimpleDataFormat is not thread safe, so don't assign it to a static field or use it in a singleton. If you use it as an instance field on an Action you'll be safe, since Actions are created per request. If you want a thread safe version of SimpleDateFormat, Jakarta Commons lang has FastDateFormat: http://commons.apache.org/lang/ Brad Cupit Louisiana State University - UIS e-mail: [EMAIL PROTECTED] office: 225.578.4774 -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 12:11 PM To: Struts Users Mailing List Subject: date conversion Hi quick question, I can't find any specific mention of what I want so I assume I have to code my own Converter. I need a date in the ISO format -MM-DD There is no converter that I can configure in the struts package, is there? - 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] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: date conversion
the synchronized is not needed Adam Hardy wrote: Actually I use it in a static method on a utility class, and call SimpleDateFormat inside a synchronized block. Brad A Cupit on 09/04/08 13:51, wrote: Consider placing the SimpleDateFormat as a local variable exactly right or, consider using a ThreadLocal or, consider using commons-lang's FastDateFormat http://commons.apache.org/lang/api-release/org/apache/commons/lang/time/ FastDateFormat.html Brad Cupit Louisiana State University - UIS e-mail: [EMAIL PROTECTED] office: 225.578.4774 -Original Message- From: Alberto A. Flores [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 09, 2008 7:48 AM To: Struts Users Mailing List Subject: Re: date conversion Consider placing the SimpleDateFormat as a local variable (within the method) to avoid non-thread safe operations (guaranteed by the jvm spec). Brad A Cupit wrote: the static SimpleDateFormat (assuming this code is in an S2 Action that is instantiated per request) is not thread safe. http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#sy nchronization Brad Cupit Louisiana State University - UIS -Original Message- From: Zoran Avtarovski [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 7:30 PM To: Struts Users Mailing List Subject: Re: date conversion We had the same issue and went with writing a new converter (shown below). And then created a xwork-conversion.properties file pointing to it. Z. private final static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM/"); @Overridepublic Object convertFromString(Map context, String[] values, Class toType) throws TypeConversionException {try {return DATE_FORMAT.parse( values[0]);} catch (ParseException e) { e.printStackTrace();throw new TypeConversionException("xwork.default.invalid.fieldvalue"); } return null;} @Overridepublic String convertToString(Map context, Object object) {Calendar cal = Calendar.getInstance(); cal.setTime((Date) object);try { return DATE_FORMAT.format(object);} catch (Exception e) { throw new TypeConversionException("xwork.default.invalid.fieldvalue"); }} Can you patch a whole class? What would be useful is parameterizable type converters, to specify the date format in this case. (they're not parameterizable, are they?) Dave Newton on 08/04/08 22:13, wrote: --- Adam Hardy <[EMAIL PROTECTED]> wrote: One area where S1 actually had the upper hand :( Submit a patch :) Dave Dave Newton on 08/04/08 18:36, wrote: The built-in type converter uses "uses the SHORT format for the Locale associated with the current request" according to the type conversion docs, so yes, you'll need to do your own if you're using a different input format. Looking through the XWork conversion code it's hard for me to tell what it's *actually* doing, though :/ Dave --- Brad A Cupit <[EMAIL PROTECTED]> wrote: JSTL has the tag. If you want to do it in Java, rather than your JSP, you can use SimpleDateFormat. Be aware that SimpleDataFormat is not thread safe, so don't assign it to a static field or use it in a singleton. If you use it as an instance field on an Action you'll be safe, since Actions are created per request. If you want a thread safe version of SimpleDateFormat, Jakarta Commons lang has FastDateFormat: http://commons.apache.org/lang/ Brad Cupit Louisiana State University - UIS e-mail: [EMAIL PROTECTED] office: 225.578.4774 -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 12:11 PM To: Struts Users Mailing List Subject: date conversion Hi quick question, I can't find any specific mention of what I want so I assume I have to code my own Converter. I need a date in the ISO format -MM-DD There is no converter that I can configure in the struts package, is there? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Local Host Error
Also, note that if you have IIS running, you would need to change the listening port (on either IIS or Apache). Lukasz Lenart wrote: Hello. To preface I am very new to using Apache. I am attempting to experiment locally, however I cannot connect to local host nor the 127.0.0.1 directly. I am looking to try and get the "IT works!" Apache Are you using Skype? By default, Skype block port 80 and 443, disable such port in Skype or change the default port for Apache. You can also use netstat -b from command prompt to see all programs with opened ports. Regards -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: migration from struts 1 to 2
d then make sure your own ActionForms extend ValidatorForm instead of ActionForm. You can declare validation rules in a validations.xml file. For example, the validation.xml file you use states that a defect's description is required. The 'validate' method is invoked by the Action before saving a record. When the user does not provide a description, the Struts ActionErrors collection is populated and its contents displayed on the view page with the help of an tag. “validation.xml” file that validates a form, is described below: In Struts 2, we define validation in -validation.xml file. For example, validations defined for MyClass-validation.xml are Regards, Sukrit Thareja Nils-Helge Garli wrote: The section about migration in the documentation [1] would be a good place to start. [1] - http://struts.apache.org/2.0.11.1/docs/migration-guide.html Nils-H On Tue, Apr 22, 2008 at 1:17 AM, Lalchandra Rampersad <[EMAIL PROTECTED]> wrote: How do I migrate from struts 1 to 2? Saludos Lalchandra Rampersaud ------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Injecting values into struts.xml
Does anyone know if it's possible to inject values into struts.xml (something like PropertyConfigurer does in Spring)? Thanks! -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Injecting Spring Services into Struts 2 Actions
Related to this question, I'm leveraging Spring's use of the @Resource annotation to the private member variable (no setter needed), thus fully relying on Spring's injection mechanism. I supposed it all depends on tight coupling to Spring you want to add. Relph,Brian wrote: The actions are auto-wired by name by default - so if any of its properties match bean-ids in your spring config, and they have setters, then those properties will get set. The part about declaring the dependencies means you disable the auto-wiring, and declare your actions as spring beans. So, instead of this: /WEB-INF/view/index.jsp You would do this: /WEB-INF/view/index.jsp Along with additional spring config: Notice this does not actually disable auto-wiring (you would have to set the auto-wire attribute in the spring config, either globally or per-bean), but it does declaratively state what to set on the action as properties. Brian Relph -Original Message- From: Asleson, Ryan [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 8:29 AM To: Struts Users Mailing List Subject: Injecting Spring Services into Struts 2 Actions Hello, I found this guide to injecting Spring beans into Struts 2 Actions: http://cwiki.apache.org/WW/spring.html According to the red box at the bottom of the document, the Struts 2 Action does not need to be registered with Spring. So far so good. However, I'm a little unclear as to how exactly it "knows" what Spring beans to inject into the Struts 2 Action. Assuming I have a Struts 2 Action that depends on a PersonService, I assume that the Struts 2 Action would have a public mutator for the PersonService like this: public void setPersonService(PersonService service) { this.personService = service; } How does the injection system "know" that this method should be used for injecting a Spring bean? Imagine that the Struts 2 Action has several "set" methods, and that there are a number of configured Spring beans. It would take way too long for the injection system to look through every "set" method on the Action and try to find a matching Spring bean, especially if there are a lot of Spring beans (and there usually are). The document above includes this comment: We strongly recommend that you find declarative ways of letting Spring know what to provide for your actions. But it doesn't give an example of how to let Spring know what to provide to the actions. So, the question is: How do I tell Spring what beans need to be injected into the Action? Thanks -Ryan This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi, what is the difference between specify time out and do not specify the timeout value in the web.xml file
Please include container type, version, etc, etc. Laurie Harper wrote: shrimpywu wrote: hi, what is the difference between specify time out and do not specify the timeout value in the web.xml file 30 According to the Servlet specification, if you don't specify this session timeout will be set to the container's default (which will be server dependent). before, i do not specify this in the web.xml file when the session has been timeout, i sometime got some exception but after i did that..no exception any more..why??? Without even knowing what the exception was there's no way to guess. You'd probably be better off trying to diagnose why the exception occurs in the first place, rather than ask why it goes away. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Spring Security and Struts2 Using tiles
Folks, My understanding is that Spring Security does not secure resources on *forwards* (I believe tiles2 do forward/chaining). In an application using Struts2, Spring and Tiles2, these forwards work just fine. Has anyone had success using these three frameworks together using Spring Security? I tried it today and It turned out that the security tag (http://www.springframework/security/tags/): never fetches anything. Furthermore, the code: SecurityContextHolder.getContext().getAuthentication() returns null (in the forwarded jsp page). Has anyone know what to do in this case? I'm beginning to think I can not use Spring Security at all. Regards, -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Spring Security and Struts2 Using tiles
I don't thinks that's possible as the Struts2 result would be something like: my.tile In here, I don't have access to the forward. Antonio Petrelli wrote: 2008/5/13 Alberto A. Flores <[EMAIL PROTECTED]>: My understanding is that Spring Security does not secure resources on *forwards* (I believe tiles2 do forward/chaining). Forwards and includes, that's where I think there may be a fault. Can you try if, using simple tags, the security tags work? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Spring Security and Struts2 Using tiles
I would, but it seems to me like there is little that can be done on the Struts2 side (unless a plugin of some sort is written). Essentially, when control is forwarded to the tile, Spring security can not do much (or maybe I'm missing something). The Spring Security team is well aware of (as far as forwards), that resources are not secured on forwards (which sucks, really, unless I'm doing something terribly wrong). I'll see if I can create a subset of my current app describing the problem. Probably would post a war file? Is that what you meant? Antonio Petrelli wrote: 2008/5/13 Alberto A. Flores <[EMAIL PROTECTED]>: I don't thinks that's possible as the Struts2 result would be something like: my.tile In here, I don't have access to the forward. Mmm... it's starting to be complicated, and I think that there is a bug somewhere. Can you open a JIRA issue, attaching, if possible, a sample web application? http://issues.apache.org/struts Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Spring Security and Struts2 Using tiles
After further testing, it looks like even without tiles, the strut2 action mapping is not secured with Acegi/Spring Security (as of version 2.0.1, Struts version 2.0.11). As far as I can tell, it has to do with the FilterDispatcher (Struts2) always forwarding to ActionProxy class to process work (hence the Spring Security Filter never knows of the request) Antonio Petrelli wrote: 2008/5/13 Alberto A. Flores <[EMAIL PROTECTED]>: I would, but it seems to me like there is little that can be done on the Struts2 side (unless a plugin of some sort is written). Essentially, when control is forwarded to the tile, Spring security can not do much (or maybe I'm missing something). I see... The Spring Security team is well aware of (as far as forwards), that resources are not secured on forwards (which sucks, really, unless I'm doing something terribly wrong). Great, at least the bug is not at Struts or Tiles side :-) I'll see if I can create a subset of my current app describing the problem. Probably would post a war file? Is that what you meant? Exactly, with the source. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sitemesh or Tiles2
Actually, for me it was a tradeoff. Here are a few thoughts: Good things about Sitemesh: - Sitemesh does not have as much XML configuration as tiles, which was very compelling (most configuration was maintained in the JSP page). - Relatively simple to learn and simpler to maintain since most things you need are configured once in an XML (decorator) and the rest you could rely on an included JSP (optional) to managed other attributes. - Since there is no XML that dictates the tiles (only a filter that knows how to decorate the fetched HTML page), there is no need to add the overhead of managing another XML structure (e.g. tiles) to know which tile goes where. Bad things about Sitemesh: - Sitemesh has not been maintained for a long time. Release of 2.3 was done in 2006 and 2.4 and 3.0 is still in development. - Sitemesh uses a StringBuffer object to decorate the output (as far as I know, this is the case in version 2.3) which means that depending on the presentation you need to fetch, such decorating can become an expensive operation. I like Sitemesh a lot and after working with both for some years now, I would recommend Sitemesh mostly for simplicity. Hope this helps! Kibo wrote: Hi konference In Struts1 i used Tiles and i was satisfied. I saw that now in Struts2 it is recomended use Sitemesh. I read about Sitemesh and i dont find whay is Sitemesh for me better then Tiles 2. Maybe is Sitemesh better when: - i need to decorate some old application - i use other framework then Struts2 but I started new application in Struts2. Is it other reason why i have to use Sitemesh? Thanks very much - Tomas Jurman Czech Republic -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to change automatic type conversion error message
Read the section "Type Conversion Error Handling" in: http://struts.apache.org/2.x/docs/type-conversion.html You need to define an "invalid.fieldvalue." to do custom type conversion error. Arpan Debroy wrote: In my application "id" attribute is int type of "Group" bean. In my JSP I have written like that :- Now if user puts a string into this text field, then error message come like that *invalid value for the field group.id But I want to show the error message with only "id" not "group.id". Is there anybody, who can show me any example how to do that. * -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Display the Image from the Database
Please refer to: http://struts.apache.org/2.0.11.1/docs/how-can-we-display-dynamic-or-static-images-that-can-be-provided-as-an-array-of-bytes.html The search engine in the wiki is a pretty good tool :) I actually found that method very useful. Vaani wrote: Hi i am new to struts... how to display the created image from database.i got the image in byte array format. can any one tell me how to convert the byte array format into image format and display it using struts. Thanks in Advance With Regards vani -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Looking for some more troubleshooting resources
Check the HTML form that is submitted to the server. Understanding namespaces is a bit tricky in the beginning. Also check the "slashes" configuration attribute as part of the mapping name. On Fri, Jun 13, 2008 at 10:08 PM, Karr, David <[EMAIL PROTECTED]> wrote: > I'm starting to do some simple experiments with Struts2 (those who know > me would wonder what took me so long :) ). I have one blocking problem, > but I would more appreciate hints on how to diagnose particular kinds of > problems, as opposed to just giving me the answer. > > In this case I'm getting the infamous "No result defined for action > and result input". The problem is I'm pretty sure I HAVE an > input result in my action. > > My struts.xml is very simple: > --- > > Configuration 2.0//EN" "struts-2.0.dtd" > > > > > >/form.jsp >/form.jsp > > > > --- > > So, for instance, what pieces of information could I look at that could > give me hints on what I'm doing wrong here? > -- Alberto http://www.linkedin.com/in/aflores
Re: Spring Security and Struts2 Using tiles
I had to put those efforts on the side as it was in a prototype and proof of concept phase. However, I have just began (today) to officially make serious effort into making it work (if at all possible) for our project. I should have a better answer by the end of the day... but any feedback would be much appreciated... JerryK wrote: I was able to get this working with Acegi, by setting the Dispatcher property in web.xml /* REQUEST INCLUDE FORWARD But, now when i try this with Spring Security 2.0.1, i am facing the same problem as you have described here. Have you found any solution so far? Alberto A. Flores wrote: Folks, My understanding is that Spring Security does not secure resources on *forwards* (I believe tiles2 do forward/chaining). In an application using Struts2, Spring and Tiles2, these forwards work just fine. Has anyone had success using these three frameworks together using Spring Security? I tried it today and It turned out that the security tag (http://www.springframework/security/tags/): never fetches anything. Furthermore, the code: SecurityContextHolder.getContext().getAuthentication() returns null (in the forwarded jsp page). Has anyone know what to do in this case? I'm beginning to think I can not use Spring Security at all. Regards, -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 + applicationContext.xml
Have you considered using the @Controller annotation (stereotype) on all Struts2 Actions (this way, Spring knows the bean id name). You can always control the scoping of the object @Controller("fooAction") @Scope("request") public class MyFooAction { } I found this a cleaner (and easier) way to avoid having to maintain another XML for our presentation. Frans Thamura wrote: I'm not sure what you're asking, but actions not defined in the Spring config file will still be injected by beans that *are* in the Spring config file. i think the idea to make the action package inside spring i have experience, writing action is another bored repeated job - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: This is odd, sometimes my requests 'miss' the Struts2 filter
As far as I know, the servlet spec 2.3 didn't comment much on what to do on forwards (whether to make forwarded resources pass through the filters as well or not). Tomcat 4.x assumed you didn't have to, whereas other containers (e.g. weblogic 8) passed them through. This was fix in servlet spec 2.4 (Tomcat 5.x) where additional configuration can be made for these cases (the default is only request, but now you have control over forwards, includes, errors, etc). Depending on what your JSP is trying to do (target url), you security would need to address those destinations as well. Also, consider checking WW-2025 (Struts2 JIRA) as the fix above seems to break in IE7 (not sure why either, but I know that IE handles HTTP 1.1 in a weird way, so I'm not surprised). Also, have you declared a security-role, disabled caching on your JSP, etc, etc, while testing this problem. It is also possible that you properly authenticated once and the session never got invalidated and you were always running on a valid session (cookie based). Lyallex wrote: Hello Tomcat version 5.5.26 Struts2 version 2.0.11.1 I'm trying to understand why, given the following in web.xml requests sometimes 'miss out' the Struts2 filter struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* It appears to really only be an issue with web.xml declarative security Reading around the various archives it appears that this is a know issue when trying to use Struts2 Actions as the target but I'm not trying to do that I just use a standard jsp. The really odd thing is that the login process works perfectly sometimes and sometimes it fails with the (apparently well known) message The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter ... Here's the login config FORM Form based authentication /login.jsp /login.jsp Someone, somwhere on my journey through the archives suggested this fix. struts2 /* REQUEST FORWARD It does appear to solve the problem I was just wondering why ? Is there a definitive resolution to this problem out there somewhere ? TIA lyallex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: This is odd, sometimes my requests 'miss' the Struts2 filter
You are correct, the default is REQUEST (if no dispatcher is specified). Also, depending on your needs, consider using Spring Security. I was finally able to add it to all my struts2 app without problems. J2EE authentication has it's own limitations as you will continue to learn and in these kind of cases (forwards, includes, etc) you'll have to write your own code anyway (whereas with Spring or not). Please, excuse me if it sounds like I try to evangelize Spring. I must admit that I had written code with and without it and Spring makes you code a lot easier to maintain, yet writing/configuring following specs (as it sounds like you are doing) teaches you good lessons... As a way of reference, the SRV.12.5.3 (from servlet spec 2.4) says that in the form based authentication (as you said you are doing)... "The login form associated with the security constraint is sent to the client and the URL path triggering the authentication is stored by the container" The spec clearly doesn't specify whether a forward or a response.redirect() is used. This means that it is up to the container to decide how this is implemented. Depending on your portability requirements, this may or may not be an issue (Tomcat vs Weblogic, Resin, etc)... Lyallex wrote: OK, I think I've twigged this now Every jsp page has this include recently I have included this in header.jsp (I'm messing around with Struts2 i18n) <%@ taglib prefix="s" uri= "/struts-tags" %> ... If I go back to this config in web.xml .. struts2 /* ... /welcome.jsp ... when I access the site the welcome page with it's included header loads fine. So obviously the request is going through the filter. If I then click the login link it all goes horribly wrong. looking at the exception trace it appears that login.jsp which also loads the header is where the problem lies So, it appears that there is a forward going on (or at least a redirect) somewhere when Tomcat sees that I am trying to access a protected resource This makes sense as I'm trying to access a servlet (Login) but I actually get a jsp (login.jsp) according to http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd another valid value for is INCLUDE so I tried this on it's own ... boom, it all went wrong, so it looks like the default behaviour for the filter mapping thing is REQUEST. If you add any dispatcher then that seems to override the default config. Distressingly (perhaps) struts2 /* REQUEST INCLUDE Doesn't do it, it has to be struts2 /* REQUEST FORWARD phew, got there in the end I'm still not entirely convinced I've got to the bottom of things as I'm sure I had this working with the tags in the header but without the stuff ... then again it's been a long week and I'm probably mistaken. Anyway, whoever said there was a forward going on ... take a bow, you were right and I was talking tosh If it's true that this fix does indeed break in some versions of IE then we are in a spot of bother with this. Thanks for the input, it got me thinking. Rgds lyallex On Thu, Jul 10, 2008 at 11:11 AM, Lyallex <[EMAIL PROTECTED]> wrote: Hello Tomcat version 5.5.26 Struts2 version 2.0.11.1 I'm trying to understand why, given the following in web.xml requests sometimes 'miss out' the Struts2 filter struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2 /* It appears to really only be an issue with web.xml declarative security Reading around the various archives it appears that this is a know issue when trying to use Struts2 Actions as the target but I'm not trying to do that I just use a standard jsp. The really odd thing is that the login process works perfectly sometimes and sometimes it fails with the (apparently well known) message The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter ... Here's the login config FORM Form based authentication /login.jsp /login.jsp Someone, somwhere on my journey through the archives suggested this fix. struts2 /* REQUEST FORWARD It does appear to solve the problem I was just wondering why ? Is there a definitive resolution to this problem out there somewhere ? TIA lyallex ------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: This is odd, sometimes my requests 'miss' the Struts2 filter
The spec clearly doesn't specify whether a forward or a response.redirect() is used. This means that it is up to the container to decide how this is implemented. Depending on your portability requirements, this may or may not be an issue (Tomcat vs Weblogic, Resin, etc)... Hmm, the whole point of 'following the spec' as you put it and indeed as I see it is to avoid portability problems ... Although this is the real intent, 100% portability is not unfortunately true (due to some vague concepts/definitions in the spec). AFAIK, this is the reason why you see some issues with some frameworks where special handling/configuration is necessary when deployed in some containers. Good luck! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tiles questions
That's because the tiles inheritance you are trying to use doesn't make sense. The managerPage1 tile does NOT have a "middle" element in the parent tile (which is defined in the managerBody tile). You probably need to use a different strategy, perhaps check the role and forward to the proper tile (tile layout for managers and tile layout for non-managers). Zhang, Larry (L.) wrote: I have a mainLayout which has a header, body and footer.(and thus I have 4 jsps, mainLayout.jsp, header.jsp, body.jsp, and footer.jsp, and notice that body.jsp will be different for each different screen page). One setting can be of: Then I have a further requirement: Manager pages's body has left, middle and right. All manager pages will have common left and right, but middle will be different. So I define the managerBody like Then if I have managerPage1, I can define as: "/> Unfortunately, this doesn't work. Can somebody help? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: web.xml servlet/filter-mappings
Also, please remember that the order of the in web.xml is VERY important. Don Brown wrote: Could you post more information? Struts should only be responding to URI's that contain configured extensions via the struts.action.extension setting, which defaults to "action". Don On Tue, Jul 15, 2008 at 7:01 PM, Mikkel Lindhard <[EMAIL PROTECTED]> wrote: Hello list I have an web-application which use both Struts 2 and Axis 2. Before struts 2.1 i didn't have a problem using the following configuration in web-xml AxisServlet /services/* struts2 /* The problem with Struts2.1.x is that the /service/xxx calls are taken over by the struts filter even though it doesnt have a mapping for it. is there a way i can configure struts to not handle the request if the mapping doesnt exist? Or might there be another solution? :) Thanks in advance. Mikkel - 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] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts menu problem
This is clearly not a Struts2 question, but a Struts menu question (name is misleading since it can be used outside the context of struts. I'm using it like that). A few thought: - Have you checked the generated HTML code? - Have you checked the generated CSS? - If using velocity, have you check what the velocity macro used? Consider enforcing you own CSS as this seems to me like a CSS/HTML code problem, not a server side problem. nauke. wrote: Hi, I don't suppose anyone knows why this issue is occurring ... ? Thanks On Mon, Jul 14, 2008 at 4:30 PM, nauke. <[EMAIL PROTECTED]> wrote: Hi! I'm using struts version 2.0.11. I am using struts menu, which works provided it is not on top of a table ... Please see screenshot of issue here: http://mytmpdir.googlepages.com/menu.jpg No idea how I can fix this! Does anyone? Thanks guys -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2: display int in JSP
Please remember that because of java's autboxing, you shouldn't have much problems (other than the cases when you are expecting zero). So changing the type (from int to Integer) is really not a dramatic change. Phan, Hienthuc T wrote: That works. Thanks. I'm migrating from Struts 1 & was hoping not have to change the data type. -Original Message- From: Jishnu Viswanath [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2008 2:24 PM To: Struts Users Mailing List Subject: RE: Struts2: display int in JSP Use Integer instead of int Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Phan, Hienthuc T [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2008 2:35 AM To: Struts Users Mailing List Subject: Struts2: display int in JSP Hi, In my action, I have several variables of type int. When the variable is not initialized, it's displayed as 0 in the JSP. I would like un-initialized variable of type int to be display as blank/empty. What is the best way to accomplish this? Thanks. Public class XXAction extends ActionSupport { private int age; private String name = new String("xyz"); private String email; //getters & setters } JSP page would display: Name: xyz Email: Age:0 Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]