Re: Validation Framework
Thanks guys, now it perfectly works. As a conclusion, most of the online articles on how to use the validation framework work just fine, but they all missed the validate=true attribute. Besides this, I had a wrong value of my action's input attribute. Thanks again, you are very helpful. Regards, Balazs - Original Message From: Dave Newton [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, March 13, 2007 6:21:52 PM Subject: Re: Validation Framework --- Christopher Schultz wrote: I didn't say that you need another URL that doesn't perform validation. Oh. I guess I don't know another way to show a form via an Action without running validation except by defining an Action. d. Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games. http://games.yahoo.com/games/front - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121
Re: Validation on java.util.List
Hi Dave, I came up with my own solution. Basically I wrote a method that I called manually (i.e. I didnt use expressionvalidator annotation).. in that method, i perform the check myself. If there was any error, I did addFieldError(customers[index], getText(some.text.from.properties.file )); then in the JSP, i have to put the fielderror in the right place. e.g.: c:forEach begin=0 end=10 var=i s:textfield key=customers[${i}].username / s:textfield key=customers[${i}].age / s:fielderrors s:paramcustomers[index]/s:param %--- cant remember the exact syntax.. its in their documentation --% /s:fielderrors /c:forEach I didnt use expressionvalidator annotation, since the attribute message is compulsory. I dont want to set message attribute, since I am creating the fielderror manually by hand (and I think the message will go to actionerrors instead of fielderrors). Anyway, I hope that helps you out. It is not the best solution.. so if you found a better way to do it, please let me know. On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Alex Wibowo [EMAIL PROTECTED] wrote: I am using Struts 2.0. Has anyone ever done validation on individual item in java.util.List before? I'm drawing a blank on this one too after poking it with a stick for about an hour now... I have a similar requirement (but with fairly heavy inter-field dependencies) so if you come up with something, please follow up! d. No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. http://mobile.yahoo.com/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, WiB ---
Re: Global messages.jsp file included in a SiteMesh decorator
2007/3/14, mraible [EMAIL PROTECTED]: I have a messages.jsp[1] that's included (using %@ include file=/common/messages.jsp %) in my default decorator. This file has a couple of calls to the valueStack - namely hasActionErrors() and hasFieldErrors(). This worked fine in WebWork 2.1.x and Struts 2.0.1 - even when pages where rendered that didn't go through Struts. However, starting with the 2.0.6 release, the s:if tag throws a NPE because the ValueStack isn't in the request. I believe it's a bug, but wanted to check with this list first to confirm. Thanks, Matt [1] messages.jsp: % if (request.getAttribute(struts.valueStack) != null) { % s:if test=hasActionErrors() div class=error id=errorMessages s:iterator value=actionErrors c:url value= alt=fmt:message key=icon.warning/ class=icon / s:property escape=false/br / /s:iterator /div /s:if s:if test=hasFieldErrors() div class=error id=errorMessages s:iterator value=fieldErrors s:iterator value=value c:url value= alt=fmt:message key=icon.warning/ class=icon / s:property escape=false/br / /s:iterator /s:iterator /div /s:if % } % %-- Success Messages --% c:if test=${not empty messages} div class=message id=successMessages c:forEach var=msg items=${messages} c:url value= alt=fmt:message key=icon.information/ class=icon / c:out value=${msg} escapeXml=false/br / /c:forEach /div c:remove var=messages scope=session/ /c:if You have to add the ActionContextCleanUp filter to your web application if you wan't to be able to access the value stack from a sitemesh decorator: http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/ActionContextCleanUp.html On the same subject, I have opened an issue in JIRA. Without this filter, I can't access the value stack from JSTL on any JSP page (not a sitemesh decorator page): https://issues.apache.org/struts/browse/WW-1798 Do you confirm this? -- Guillaume Carré - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[s2] Datetimepicker not working on non-English?
Hi all, I have got the impression that datetimepicker, when picking the date, does not work in non-English localization. You can easily reproduce this one when opening showcase and adding ?request_locale=de to the location bar. Then browse to CRUD--List available employees-- choose an employee, try picking a date and press submit. I get a validation error - Invalid field value for field currentEmployee.birthDate. Has anyone got any success with datetimepicker and non-English locale? I am using struts2-2.0.6. Thanks, Petr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] Datetimepicker not working on non-English?
I am using it with PL locale, but I needed to add another property: displayFormat=-MM-dd regards Dariusz Wojtas On 3/14/07, Petr Blahos [EMAIL PROTECTED] wrote: Hi all, I have got the impression that datetimepicker, when picking the date, does not work in non-English localization. You can easily reproduce this one when opening showcase and adding ?request_locale=de to the location bar. Then browse to CRUD--List available employees-- choose an employee, try picking a date and press submit. I get a validation error - Invalid field value for field currentEmployee.birthDate. Has anyone got any success with datetimepicker and non-English locale? I am using struts2-2.0.6. Thanks, Petr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OGNL - invalid syntax. JSP EL?
There must be a way (or we should build a way) that Struts could allow customization of the el that gets substituted before passing it off to OGNL. I would ask on the dev list and possibly even file a JIRA ticket on this. Thanks -- James Mitchell The Ruby Roundup http://www.rubyroundup.com/ On Mar 13, 2007, at 7:39 PM, Dave Newton wrote: --- Piero Sartini [EMAIL PROTECTED] wrote: I don't think its good to be incompatible with JSP.. It wasn't incompatible until 2.1, IIRC, and it was JSF-only up until then, before the unification effort. Maybe take it up w/ the OGNL folks? I agree that this may cause a problem in some environments. d. __ __ Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121 - 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]
{S2] Newbie: Sharing a POJO between two or more actions
Hi I need to share an object between two actions. As I'm familiar with servlet programming I reached for the SessionAware interface and share the object that way. And it works. However. the Javadoc for SessionAware discourages the use of this interface as it ties the actions to a servlet environment. What is the recommended Struts 2 way of doing this? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: {S2] Newbie: Sharing a POJO between two or more actions
--- Roger Varley wrote: What is the recommended Struts 2 way of doing this? If you really need to share an object between actions I'm not how else you'd do it. It has also been noted that technically you aren't being tied to servlet by implementing that interface, although at one point you may have been. d. We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation on java.util.List
--- Alex Wibowo [EMAIL PROTECTED] wrote: It is not the best solution.. so if you found a better way to do it, please let me know. I don't know if this is a better way or not and it does not use annotations (at least not yet), but... (1) Create a validation config file for the *object* (in my case, DummyUser-validation.xml; I'm just testing, and I'm a dummy :) - that's the object under validation, not the Action. (2) Annotate the Action's method as usual, but add a @VisitorFieldValidator on the list of collections, like so: @Validations ( // Other validators, then: visitorFields = { @VisitorFieldValidator( fieldName = users, message=, appendPrefix=true )}) This eliminates the need to manually insert the s:fielderror.../ element. So my Action has a ListDummyUser _users with appropriate getter/setter. The VisitorFieldValidator is validating on this object (the list) and by magic knows what validation file to use (I'm assuming via type; I currently have @Element specified but it's probably not required: @Element(value=DummyUser.class) @CreateIfNull(value=true) private ListDummyUser _users = new ArrayListDummyUser(); HTH, d. 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DispachAction - does not contain specified method
Thanks Mark ! , it worked. On 3/13/07, Mark Shifman [EMAIL PROTECTED] wrote: You should look at the source http://svn.apache.org/viewvc/struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/DispatchAction.java?view=markup and the javadoc Method which is dispatched to when there is no value for specified request parameter included in the request. Subclasses of DispatchAction should override this method if they wish to provide default behavior different than throwing a ServletException. overriding unspecified should do the trick *protected* ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) *throws* Exception { String message = messages.getMessage(*dispatch.parameter*, mapping.getPath(), mapping.getParameter()); log.error(message); *throw* *new* ServletException(message); } mas Nitin Ahuja wrote: Hi, I am using DispatchAction as my base action class. when submit url http://.../myAction.do?action=view; and there is no view method defined in my action class, then it throws following exception. Is there any way to call a default method when the method view does not exists ? Or how can I redirect or forward the request to a default page ? javax.servlet.ServletException: Action[/myAction] does not contain specified method (check logs) at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720) at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118) at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505) at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157) at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598) Thanks, -Nitin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Mark Shifman MD. Ph.D. Yale Center for Medical Informatics Phone (203)737-5219 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- ... Yesterday I dared to struggle, today I dare to win. --- Bernadette Devlin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ResourceBundle in Javascript?
Hi, Does anyone know how can I acces Message ResourceBundle key/values in Javascript? Thanks, -Nitin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation on java.util.List
Just a quick followup regarding annotations: --- Dave Newton [EMAIL PROTECTED] wrote: I don't know if this is a better way or not and it does not use annotations (at least not yet), but... If you annotate the class contained in the collection the @VisitorFieldValidator still works. This won't work for me, because my class is being generated by HibernateTools (for now, anyway; I may switch to annotated POJOs) so I still need to use the XML validation config, but there you go. d. Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ResourceBundle in Javascript?
--- Nitin Ahuja [EMAIL PROTECTED] wrote: Does anyone know how can I acces Message ResourceBundle key/values in Javascript? ?! You'd have to pass in something that [had] rendered a JavaScript representation of the bundle. I haven't given it any thought, but you *might* be able to use DWR to do this in a relatively transparent way. d. Never miss an email again! Yahoo! Toolbar alerts you the instant new Mail arrives. http://tools.search.yahoo.com/toolbar/features/mail/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Html:Cancel and html:submit works only on new page
Hi, I have a navigation page which takes me to pageA.jsp throw an html:link PageA.jsp has a textbox, a submit button and a cancel button. If I navigate through the index.jsp navigation menu to goto PageA.jsp, the cancel and submit requests don't work - they both return a blank page - no cancel is captured etc. However, when I goto the PageA.jsp directly in a new browser window, both buttons work ok - capturing data in the textbox, capturing the cancel event. Anyone has any pointers... ? Thanks, Amit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to submit multiple selection?
For example, i want to get the ids of the selected messages in the forum and delete the selected messages. (Suppose i am the admin). how to achieve this? seems won't work. -- View this message in context: http://www.nabble.com/How-to-submit-multiple-selection--tf3401936.html#a9473724 Sent from the Struts - User mailing list archive at Nabble.com.
Re: ResourceBundle in Javascript?
I think you are confusing client side and server side code. musachy On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Nitin Ahuja [EMAIL PROTECTED] wrote: Does anyone know how can I acces Message ResourceBundle key/values in Javascript? ?! You'd have to pass in something that [had] rendered a JavaScript representation of the bundle. I haven't given it any thought, but you *might* be able to use DWR to do this in a relatively transparent way. d. Never miss an email again! Yahoo! Toolbar alerts you the instant new Mail arrives. http://tools.search.yahoo.com/toolbar/features/mail/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: [s2] Datetimepicker not working on non-English?
If the field used by the datetimepicker is of type Date, there shouldn't be a problem, if it is an string, the displayFormat will be used to try to parse the date. By the way if you have some feedback on a better way to do this, now it is a good time (for 2.1.x) regards musachy On 3/14/07, Dariusz Wojtas [EMAIL PROTECTED] wrote: I am using it with PL locale, but I needed to add another property: displayFormat=-MM-dd regards Dariusz Wojtas On 3/14/07, Petr Blahos [EMAIL PROTECTED] wrote: Hi all, I have got the impression that datetimepicker, when picking the date, does not work in non-English localization. You can easily reproduce this one when opening showcase and adding ?request_locale=de to the location bar. Then browse to CRUD--List available employees-- choose an employee, try picking a date and press submit. I get a validation error - Invalid field value for field currentEmployee.birthDate. Has anyone got any success with datetimepicker and non-English locale? I am using struts2-2.0.6. Thanks, Petr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: ResourceBundle in Javascript?
Hi Dave, What is DWR ? I found a simple wayout, but there is dependency i.e I have to assign the the value of message resource key to an html object in jsp. Here is what i did.. in jsp html:button onclick=javascript:display(this); property=xyz bean:message key=form.select //html:button and in java script function display(button) { alert(button.value); } this will display the value of key form.select thanks, -Nitin On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Nitin Ahuja [EMAIL PROTECTED] wrote: Does anyone know how can I acces Message ResourceBundle key/values in Javascript? ?! You'd have to pass in something that [had] rendered a JavaScript representation of the bundle. I haven't given it any thought, but you *might* be able to use DWR to do this in a relatively transparent way. d. Never miss an email again! Yahoo! Toolbar alerts you the instant new Mail arrives. http://tools.search.yahoo.com/toolbar/features/mail/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- ... Yesterday I dared to struggle, today I dare to win. --- Bernadette Devlin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ResourceBundle in Javascript?
script var myMessage = 'bean:message key=form.select /'; function sayit() { alert(myMessage); } /script On 3/14/07, Nitin Ahuja [EMAIL PROTECTED] wrote: Hi Dave, What is DWR ? I found a simple wayout, but there is dependency i.e I have to assign the the value of message resource key to an html object in jsp. Here is what i did.. in jsp html:button onclick=javascript:display(this); property=xyz bean:message key=form.select //html:button and in java script function display(button) { alert(button.value); } this will display the value of key form.select thanks, -Nitin On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Nitin Ahuja [EMAIL PROTECTED] wrote: Does anyone know how can I acces Message ResourceBundle key/values in Javascript? ?! You'd have to pass in something that [had] rendered a JavaScript representation of the bundle. I haven't given it any thought, but you *might* be able to use DWR to do this in a relatively transparent way. d. Never miss an email again! Yahoo! Toolbar alerts you the instant new Mail arrives. http://tools.search.yahoo.com/toolbar/features/mail/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- ... Yesterday I dared to struggle, today I dare to win. --- Bernadette Devlin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: ResourceBundle in Javascript?
--- Nitin Ahuja [EMAIL PROTECTED] wrote: What is DWR ? http://getahead.org/dwr I have to assign the the value of message resource key to an html object in jsp. Message bundles are server-side. You want to access it on the client. So you need to build a representation of the message bundle in JavaScript, which is what you did, in a roundabout way. If you just need to access a single message out of a bundle, maybe this is okay, although I'd probably just put the message into scope via an Action then build your JavaScript using JSTL, which might be enough for whatever it is you're trying to do. But without knowing what you're trying to accomplish, it's hard to say. d. It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. http://tools.search.yahoo.com/toolbar/features/mail/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ResourceBundle in Javascript?
--- Musachy Barroso wrote: script var myMessage = 'bean:message key=form.select /'; function sayit() { alert(myMessage); } /script Or that ;) d. 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Bean access from several pages in request scope
Dear Struts users, I have a form bean with request scope. When submitting the form, the bean can be accessed from the next page as expected. On the next page I'd like to show a Modify button that goes back to the previous page with all the values entered, so the bean must accessed again. If I set the bean scope to session, I can reach the data just fine and works perfectly. Is there a way to access all the data from the form page when someon pushes the Modify button without setting the bean scope to session? So the form data should be carried along several pages until all the data are stored in a database. I thought it was not a very good idea to set the bean scope to session, because in session scope I store user ID, etc... Presumably I should use bean:define and I tried it without success. Any ideas how to accomplish this? thanks a lot, Regards, Balazs Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games. http://games.yahoo.com/games/front
[S2] Result Type Dispatcher problem
Hello, I have a problem with the result type dispatcher when I try to dispatch the success or error to another action. I get 404 error. This works fine with result type chain. Here is my configuration. action name=TaskInsert class=com.isone.struts.action.InsertDataAction result type=tiles name=successsampleapp.examples.task.insert/result result name=errorTaskList.action/result /action action name=TaskDoInsert class=com.isone.struts.action.InsertDataAction method=doInsert result name=inputTaskInsert/result result type=redirect-action name=successTaskList/result !--result type=chain name=errorTaskInsert/result THIS WORKS -- result name=errorTaskInsert.action/result !--THIS DOES NOT WORK. I Tried everything. With and without .action, and starting the action with a / -- /action Am I doing something wrong. This seems very basic to be.. Thanks Anil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ResourceBundle in Javascript?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nitin, Dave Newton wrote: Message bundles are server-side. You want to access it on the client. [snip] If you just need to access a single message out of a bundle, maybe this is okay, although I'd probably just put the message into scope via an Action then build your JavaScript using JSTL, which might be enough for whatever it is you're trying to do. This is what I do (albeit without JSTL) when I need to use a localized string in javascript. It's also what velocity-tools does in order to render client-side validation error messages. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF9/yr9CaO5/Lv0PARAo43AKCSt6AGuumgaFCqdGeNtkaN0KsYZACfR3yA XeNvNT3i3MPasVFgbqLwuaI= =rWgL -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Result Type Dispatcher problem
--- Inamdar, Anil [EMAIL PROTECTED] wrote: result name=errorTaskInsert.action/result !--THIS DOES NOT WORK. I Tried everything. Did you try: result name=error type=redirect-action TaskInsert /result d. Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bean access from several pages in request scope
--- Balazs Michnay [EMAIL PROTECTED] wrote: Is there a way to access all the data from the form page when someon pushes the Modify button without setting the bean scope to session? Sure; use the id to retrieve the bean (just like you would for a normal 'edit' CRUD-type action) and pre-populate the form. So the form data should be carried along several pages until all the data are stored in a database. That's pretty much what session is for, unless you want to re-retrieve the bean on each page, or you need to allow trivial multi-page/tab capabilities. d. Need Mail bonding? Go to the Yahoo! Mail QA for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=listsid=396546091 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation on java.util.List
Hi Dave, Thanks for that.. I will have a look at the VisitorValidator tomorrow (its 1 AM here :P ) I am sort of in the same position as you (using Hibernate objects at the web layer)... I have given that a thought before (annotating the hibernate objects with validation annotation). But that will tie up the hibernate objects to Struts, wouldnt it? Might not be a problem if the user of the object is just the webapp.. Anyway...just to clarify what you have there..: 1. Annotate the object with struts validation annotation. In my example, something like: public class Customer{ @RequiredStringValidator(message = You must enter a value for username.) public String username; } 2. Annotate the Action class @Validation public class CustomerAction { public ListCustomer customer = new ArrayListCustomer(); @Validations ( visitorFields = { @VisitorFieldValidator(fieldName = customer , message=, appendPrefix=true) } ) public String execute(){ } } And hopefully if everything works right, the validation should work? Not sure if I can eliminate the s:fieldErrors/ ... since I'm using simple theme - my understanding is that with simple theme, I have to specifically write the actionErrors fieldErrors. Could be wrong though... (I'm new to Struts 2). Also... with your @Validations above.. if you specify message=, wouldnt that create an extra empty error message? I experienced that before. Thanks again, and I'll let you know how I go with this tomorrow. Cheers. WiB. On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: Just a quick followup regarding annotations: --- Dave Newton [EMAIL PROTECTED] wrote: I don't know if this is a better way or not and it does not use annotations (at least not yet), but... If you annotate the class contained in the collection the @VisitorFieldValidator still works. This won't work for me, because my class is being generated by HibernateTools (for now, anyway; I may switch to annotated POJOs) so I still need to use the XML validation config, but there you go. d. Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, WiB ---
RE: [S2] Result Type Dispatcher problem
Yes I tried with redirect-action and it works. But I don't want a redirect as I lose my messages and other data from the previous action Thanks Anil -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 09:56 AM To: Struts Users Mailing List Subject: Re: [S2] Result Type Dispatcher problem --- Inamdar, Anil [EMAIL PROTECTED] wrote: result name=errorTaskInsert.action/result !--THIS DOES NOT WORK. I Tried everything. Did you try: result name=error type=redirect-action TaskInsert /result d. Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bean access from several pages in request scope
Sure; use the id to retrieve the bean (just like you would for a normal 'edit' CRUD-type action) and pre-populate the form. Could you please provide a concrete example? I don't really understand what an 'edit' CRUD-type action is. use the id to retrieve the bean How do I retrieve it? Should I use bean:define (as I tried) ? I have two actions. One for the form and one for the modify button on the page that shows up on form submission: // action input=/LP/JSP_L01.jsp name=BEAN_L01 path=/L01FormAction scope=request type=com.myapp.struts.ACT_L01 validate=true set-property property=cancellable value=true/ forward name=cancel path=/index.jsp/ forward name=success path=/LP/JSP_L01_1.jsp/ /action action input=/LP/JSP_L01.jsp name=BEAN_L01 path=/L01FormModifyAction scope=request type=com.myapp.struts.ACT_L01Modify forward name=success path=/LP/JSP_L01.jsp/ /action // Thanks so much for some help. Regards, Balazs Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097
Re: How to submit multiple selection?
are you using struts 1 ? if so, have a look at html:multibox. basically you will need a collection in your action form (something like ListString selectedIds = new ArrayListString()). for struts 2, i havent had time to check it yet.. just migrated to Struts 2 a couple days ago :P On 3/14/07, xushaoxun [EMAIL PROTECTED] wrote: For example, i want to get the ids of the selected messages in the forum and delete the selected messages. (Suppose i am the admin). how to achieve this? seems won't work. -- View this message in context: http://www.nabble.com/How-to-submit-multiple-selection--tf3401936.html#a9473724 Sent from the Struts - User mailing list archive at Nabble.com. -- Best regards, WiB ---
Re: Validation on java.util.List
--- Alex Wibowo [EMAIL PROTECTED] wrote: But that will tie up the hibernate objects to Struts, wouldnt it? XWork, technically, but yes. The other issue (I think; haven't explored it yet) is that you'd lose the ability to validate differently based on the Action method (which I need). So I'm going to stick w/ the XML validation config, because the visitor thing lets me specify a validation context (like a method, I hope!) and currently my Hibernate objects are being created from the mapping XML files, so I can't do it via annotations anyway. And hopefully if everything works right, the validation should work? Yep. I'm not entirely sure I understand the appendPrefix attribute, since mine worked both with and without it :/ Not sure if I can eliminate the s:fieldErrors/ ... since I'm using simple theme - my understanding is that with simple theme, I have to specifically write the actionErrors fieldErrors. Could be wrong though... Nope, I believe you are correct. with your @Validations above.. if you specify message=, wouldnt that create an extra empty error message? I experienced that before. AFAICT a visitor's message is prepended to the validation message for the visited object; if you want just the msg defined in your POJO then I think you leave the visitor's message empty. d. Looking for earth-friendly autos? Browse Top Cars by Green Rating at Yahoo! Autos' Green Center. http://autos.yahoo.com/green_center/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: {S2] Newbie: Sharing a POJO between two or more actions
with SessionAware, you have to implement: void *setSessionhttp://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/SessionAware.html#setSession%28java.util.Map%29 *(Map http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html session) so during testing you can easily set it with HashMap. that way you can test your action independent of the servlet container. I believe I read this somewhere in the doco. Cheers, WiB. On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Roger Varley wrote: What is the recommended Struts 2 way of doing this? If you really need to share an object between actions I'm not how else you'd do it. It has also been noted that technically you aren't being tied to servlet by implementing that interface, although at one point you may have been. d. We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, WiB ---
RE: [S2] Result Type Dispatcher problem
--- Inamdar, Anil [EMAIL PROTECTED] wrote: Yes I tried with redirect-action and it works. But I don't want a redirect as I lose my messages and other data from the previous action Oh, I didn't notice that you said that in your original post. The default result type is redirect. I don't know as you can redirect to an action w/o specifying redirect-action. Once you redirect, of course you're going to lose request-scoped data. The way you have your actions defined isn't how I normally picture S2 flow working. Personally, I have a single action defined for a datatype (in general, anyway) and display the initial form via a /actionName!input.action link (or you could use wildcards, or whatever). If there's a validation issue, it goes back to !input by magic. If I have an error during execution (so my form submission action is either the default, or I put the method in the url like /actionName!update.action or whatever) I add a message and return INPUT which brings me back to my input (which in my case is a tile). That way I don't have to think about anything, it just works. Is there a particular reason you've set up your actions the way you have? d. Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games. http://games.yahoo.com/games/front - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bean access from several pages in request scope
--- Balazs Michnay [EMAIL PROTECTED] wrote: Could you please provide a concrete example? I don't really understand what an 'edit' CRUD-type action is. Your modify button is basically a link to the form that allows you to edit an instance of the bean. As a URL it might look like: /editBean.do?id=42 So make sure the page with the modify button has either a form with the ID of the bean you created or some other way to access the id and either submit the form or create the link. When you hit the editBean action use the ID to retrieve the bean instance. How do I retrieve it? It's in a database, right? So you retrieve it in your Action and copy the bean properties to the form (or however you're implementing your forms). d. We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[s1] Struts / Netbeans Hands On Lab
Theres a Hands on Lab for Struts (1.2.9) / Netbeans by Sang Shin availbale here: http://www.javapassion.com/handsonlabs/strutsbasics/ Niall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global messages.jsp file included in a SiteMesh decorator
Guillaume Carré wrote: 2007/3/14, mraible [EMAIL PROTECTED]: I have a messages.jsp[1] that's included (using %@ include file=/common/messages.jsp %) in my default decorator. This file has a couple of calls to the valueStack - namely hasActionErrors() and hasFieldErrors(). This worked fine in WebWork 2.1.x and Struts 2.0.1 - even when pages where rendered that didn't go through Struts. However, starting with the 2.0.6 release, the s:if tag throws a NPE because the ValueStack isn't in the request. I believe it's a bug, but wanted to check with this list first to confirm. Thanks, Matt [1] messages.jsp: % if (request.getAttribute(struts.valueStack) != null) { % s:if test=hasActionErrors() div class=error id=errorMessages s:iterator value=actionErrors c:url value= alt=fmt:message key=icon.warning/ class=icon / s:property escape=false/br / /s:iterator /div /s:if s:if test=hasFieldErrors() div class=error id=errorMessages s:iterator value=fieldErrors s:iterator value=value c:url value= alt=fmt:message key=icon.warning/ class=icon / s:property escape=false/br / /s:iterator /s:iterator /div /s:if % } % %-- Success Messages --% c:if test=${not empty messages} div class=message id=successMessages c:forEach var=msg items=${messages} c:url value= alt=fmt:message key=icon.information/ class=icon / c:out value=${msg} escapeXml=false/br / /c:forEach /div c:remove var=messages scope=session/ /c:if You have to add the ActionContextCleanUp filter to your web application if you wan't to be able to access the value stack from a sitemesh decorator: http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/ActionContextCleanUp.html On the same subject, I have opened an issue in JIRA. Without this filter, I can't access the value stack from JSTL on any JSP page (not a sitemesh decorator page): https://issues.apache.org/struts/browse/WW-1798 Do you confirm this? -- Guillaume Carré That's the problem, I *do* have the ActionContextCleanUp filter in my web.xml: filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern dispatcherREQUEST/dispatcher dispatcherFORWARD/dispatcher /filter-mapping filter-mapping filter-namethemeFilter/filter-name url-pattern/*/url-pattern dispatcherREQUEST/dispatcher dispatcherFORWARD/dispatcher /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestaticFilter/filter-name url-pattern/*/url-pattern dispatcherREQUEST/dispatcher dispatcherFORWARD/dispatcher /filter-mapping filter-mapping filter-namestruts/filter-name url-pattern/*/url-pattern /filter-mapping Matt -- View this message in context: http://www.nabble.com/Global-messages.jsp-file-included-in-a-SiteMesh-decorator-tf3400265.html#a9477319 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Revising user input
Hi; I am using Struts 1.2.7, and am developing a user form that employs the validator framework. Once validation is successful, I display the results back to the user on a JSP page, before final submission to the business layer for database update. At this point I would like to give the user the opportunity to edit the content by providing a link back to the original form, with values present for further updating/validation. I simple javascript:back() approach is not feasible (nor desirable), as it will play back any validation errors that may have occurred. I set the scope of the form to session, but then the contents are always in the form fields, even when the user returns to the form page to enter brand new data. Could someone provide insight on the best approach to allow for re-display (and re-validation) of form content? Any guidance would be appreciated... thanks! Regards, --Chris
[s2] How to pass param to actions from Struts.xml
Folks, Is there a way to pass parameter to an Action using the struts.xml config file. 1 ) I see that the action .. has a param attribute. How can I access its value from within the action? My action already implements the ParameterAwre interface. However, I am unable to see the value on the Map provided by the setParameter() IoC call. 2) Is this the same functionality as the the Struts ActionMapping? Thanks in advance Harring Figueiredo
Re: Global messages.jsp file included in a SiteMesh decorator
2007/3/14, mraible [EMAIL PROTECTED]: That's the problem, I *do* have the ActionContextCleanUp filter in my web.xml: It's working here for me, I've included a test.jsp in my sitemesh decorator with a ww:property value=test/ in it, and it's able to access the test object from the value stack. But I still have my JSTL problem without the ActionContextCleanUp filter, even when I'm not in a sitemesh decorator... -- Guillaume Carré - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global messages.jsp file included in a SiteMesh decorator
Guillaume Carré wrote: 2007/3/14, mraible [EMAIL PROTECTED]: That's the problem, I *do* have the ActionContextCleanUp filter in my web.xml: It's working here for me, I've included a test.jsp in my sitemesh decorator with a ww:property value=test/ in it, and it's able to access the test object from the value stack. But I still have my JSTL problem without the ActionContextCleanUp filter, even when I'm not in a sitemesh decorator... -- Guillaume Carré What if you use s:if test=hasActionErrors() foo /s:if - does that work for you as well? Thanks, Matt -- View this message in context: http://www.nabble.com/Global-messages.jsp-file-included-in-a-SiteMesh-decorator-tf3400265.html#a9477819 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
fmt:setLocale little OT
Hello there! I'm struggling with this for the last couple of hours, I'm pretty sure is a dumb thing I forgot. I'm setting the locale for my JSPs (not using struts yet, this is for a presentation) and fmt:setLocale refuses to override the default locale. I'm using jakarta standards 1.1.2 apache 5.5.17 and nothing... The examples from the standards do work, and mine is just as same as the ones in the examples... fmt:setLocale value=pt/ fmt:setBundle value=messages/ fmt:message Hello /fmt:message It keeps printing the one in the messages_en.properties and not the one at messages_pt.properties. This simple yet annoying little thing is driving me nuts. Any ideas? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Revising user input
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris, Christopher Becker wrote: A simple javascript:back() approach is not feasible (nor desirable) [...] [snip] Could someone provide insight on the best approach to allow for re-display (and re-validation) of form content? Any guidance would be appreciated... thanks! You have three obvious options. I'm sure there are others. 1. Use a session-based form, and then just use a link back to the form display. (Remember to remove the form from the session when you're done, just to keep things tidy). 2. Create a link back to your form display and put every form field value into the URL parameters. Something like: a href=/myform.do?firstName=ChrislastName=Beckergender=M...edit/a 3. Use a form to POST back to the original for display: form action=/myform.do input type=hidden name=firstName value=Chris / input type=hidden name=LastName value=Becker / input type=hidden name=gender value=M / ... input type=submit value=Edit / /form Of course, 2 and 3 Are really the same technique done in different ways. If you have a lot of form elements, you might want to use the form-based solution to avoid URLs that are potentially too long for the server (or just ugly to you). Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF+CGi9CaO5/Lv0PARAkDoAKCnFQhqNC5IcYK2tuSh1QsK0zPTBwCgkHyk RfWnYu41HcZaLVaimkPpnkI= =62SA -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global messages.jsp file included in a SiteMesh decorator
2007/3/14, mraible [EMAIL PROTECTED]: What if you use s:if test=hasActionErrors() foo /s:if - does that work for you as well? yes it does work as well, as advertized. And if I remove the ActionContextCleanUp filter, it doesn't work anymore, I have the following exception: java.lang.NullPointerException at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:50) at org.apache.jsp.decorators.main_jsp._jspx_meth_ww_property_0(main_jsp.java:420) I'm using Tomcat 5.5.17. -- Guillaume Carré - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DataSources
I'm looking into upgrading from 1.2.9 to 1.3.8, and I'm having a hard time figuring out how to get DataSources for my application. In the old version, I did the configuration in the struts-config.xml file, and could say the following in the action: DataSource ds = getDataSource(request,datasourceID); I understand that this was removed in 1.3, but it's unclear how to make the switch. The documentation has a one-liner about using JNDI to get DataSources, but I can't seem to find any examples. Here's the original configuration: data-sources data-source key=datasourceID type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=com.mysql.jdbc.Driver / set-property property=url value=jdbc:mysql://localhost:3306/mydb?autoReconnect=true / set-property property=maxActive value=20 / set-property property=maxWait value=5000 / set-property property=defaultAutoCommit value=true / set-property property=defaultReadOnly value=false / set-property property=username value=strutsuser / set-property property=password value=foo / /data-source /data-sources Any help would be greatly appreciated! Thanks! Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] How to pass param to actions from Struts.xml
Create a setter with the same name as your param. ex : for : action name=blah class=MyAction param name=myValueThis value/param /action in MyAction : public class MyAction implements Action { private String myValue; public void setMyValue( String value) { this.myValue = value; } } Type conversion's done on this param value just like any other parameter. hth, -a Harring Figueiredo wrote: Folks, Is there a way to pass parameter to an Action using the struts.xml config file. 1 ) I see that the action .. has a param attribute. How can I access its value from within the action? My action already implements the ParameterAwre interface. However, I am unable to see the value on the Map provided by the setParameter() IoC call. 2) Is this the same functionality as the the Struts ActionMapping? Thanks in advance Harring Figueiredo -- View this message in context: http://www.nabble.com/-s2--How-to-pass-param-to-actions-from-Struts.xml-tf3403074.html#a9478391 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global messages.jsp file included in a SiteMesh decorator
Guillaume Carré wrote: 2007/3/14, mraible [EMAIL PROTECTED]: What if you use s:if test=hasActionErrors() foo /s:if - does that work for you as well? yes it does work as well, as advertized. And if I remove the ActionContextCleanUp filter, it doesn't work anymore, I have the following exception: java.lang.NullPointerException at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:50) at org.apache.jsp.decorators.main_jsp._jspx_meth_ww_property_0(main_jsp.java:420) I'm using Tomcat 5.5.17. What if you remove the filter-mapping for Struts' filter in your web.xml? I have a staticFilter in my application that forwards to static resources and doesn't hit the Struts FilterDispatcher when one is found. Maybe that's causing my problem? Matt -- View this message in context: http://www.nabble.com/Global-messages.jsp-file-included-in-a-SiteMesh-decorator-tf3400265.html#a9478424 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2.0.6 and Validation
Hi there, I am trying to get validation going for my application and so far nothing works. I would like to use annotations. Here is what I try to do: package ... import ... @Results({ @Result(name = success, value = /jsp/hitlist.jsp), // value = hitlist.action, type = ServletActionRedirectResult.class), @Result(name = error, value = /jsp/index.jsp) }) @ParentPackage(default) @Validation() public class SearchAction extends ActionSupport { private SearchParam searchParam; @Validations( expressions = [EMAIL PROTECTED](expression = searchParam.keywords ne null and searchParam.location ne null message = Wrong search parameters) } ) public String search() { // do search return SUCCESS; } public SearchParam getSearchParam() { return searchParam; } public void setSearchParam(SearchParam searchParam) { this.searchParam = searchParam; } } SearchParam is class containing two properties keywords and location (with matching getter and setters). When I run the application without any annotation it works fine. What I mean is that the keywords and locations field get properly passed into action. The problem starts with validation. Currently I get the following error: No result defined for action SearchAction and result input No result defined for action SearchAction and result input at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:345) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at Can anyone see what I am doing wrong? Is it actually possible to have validation on 'complex' datatypes as I am trying to do with SearchParam? Or do I need keywords and locations as simple String properties in the Action directly? I also tried to apply the ExpressionValidator annotation directly on setSearchParam method, but then I got the following error message: caught OgnlException while setting property 'methodName' on type ' com.opensymphony.xwork2.validator.validators.ExpressionValidator'. ognl.NoSuchPropertyException: com.opensymphony.xwork2.validator.validators.ExpressionValidator.methodName Any help is greatly appreciated. --Hardy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSources
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel, Daniel Blumenthal wrote: I'm looking into upgrading from 1.2.9 to 1.3.8, and I'm having a hard time figuring out how to get DataSources for my application. I understand that this was removed in 1.3, but it's unclear how to make the switch. It depends on your servlet container. You /can/ configure a JNDI datasource by hand in your own code, say, in a ServletContextInitListener, but it's often easier to have your container provide the datasource for you. For instance, Apache Tomcat makes this pretty darned easy. You can define a JNDI datasource at the server level, or per webapp. The configuration is (roughly) the same; it just goes in a different place in your config files. The documentation has a one-liner about using JNDI to get DataSources, but I can't seem to find any examples. Getting the datasource (once it exists) is very easy. Where you used to call: getDataSource(request, dataSourceId) you'll now need to do something like this: import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(java:/comp/env/jdbc/your-datasource-name); return ds.getConnection(); Don't forget to handle null DataSources and NamingExceptions. I never use data sources in action code. I find this to be a bad practice, since I tend to think of my actions as being in the display logic layer, not in my data access layer. My data access layer is made up of a series of service classes which all inherit from a base class which defines a getConnection method which roughly does the above (and properly checks for null, NamingExceptions, etc.). Whatever do you, I would recommend against putting any JNDI-specific code into (all) your actions. If you have to keep data access in your actions, I would recommend putting a getConnection method in your actions' base class and then use that instead of Action.getDataSource(). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF+CeZ9CaO5/Lv0PARAibOAKCZ2ij442Vi5SFk/N8UvCcLwFrgegCeLiid H+2pTyelGuCOXP/fGdD45hg= =xQoE -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: {S2] Newbie: Sharing a POJO between two or more actions
If your actions occur in sequence, ( i.e. submit to an action - display action ), it's possible to use action chaining to share objects. http://struts.apache.org/2.x/docs/action-chaining.html Roger Varley wrote: Hi I need to share an object between two actions. As I'm familiar with servlet programming I reached for the SessionAware interface and share the object that way. And it works. However. the Javadoc for SessionAware discourages the use of this interface as it ties the actions to a servlet environment. What is the recommended Struts 2 way of doing this? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/%7BS2--Newbie%3A-Sharing-a-POJO-between-two-or-more-actions-tf3401421.html#a9478515 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.0.6 and Validation
--- Hardy Ferentschik wrote: Currently I get the following error: No result defined for action SearchAction and result input If validation fails the framework will try to bring you back to the input result. You don't appear to have one; this will cause a problem. validation on 'complex' datatypes as I am trying to do with SearchParam? Or do I need keywords and locations as simple String properties in the Action directly? You can do what you're doing. In this case I'm not sure what you're gaining by using the SearchParam object, but without knowing why you've chosen that way, it's hard to say. I also tried to apply the ExpressionValidator annotation directly on setSearchParam method, but then I got the following error message: caught OgnlException while setting property 'methodName' [...] methodName? I'm not sure why that's happening; the actual annotation you used might be helpful. d. Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation on java.util.List
I don't know if this helps, but when I validate a list or array , i use OGNL's selection/projection facility : i.e. : customers.{ ? #this.age gt 0 and #this.username neq null }.size() eq customers.size creates a list of all customers whose age is greater than zero and who have a username and checks that it is the same as the incoming array ( i.e. everyone has a username and an age ) For the second part, in your Object's -conversion.xml file declare the type information of the element, like so : Element_customers = my.Customer more info here : http://struts.apache.org/2.x/docs/type-conversion.html Alex Wibowo wrote: Hi all... I am using Struts 2.0. Has anyone ever done validation on individual item in java.util.List before? Say, I have a property ListCustomer customers in my Action, and Customer is defined as: public class Customer{ private String username;// must not be empty private int age;// must be 0 } In the JSP I have the following: c:forEach begin=0 end=10 var=i s:textfield key=customers[${i}].username / s:textfield key=customers[${i}].age / /c:forEach How can I enforce using struts validation (preferrably through annotation) so that: - both username and age are compulsory - age must be an integer Secondly, since age is of type int.. when user enter characters (numbers) in the textfield, they get converted to 0 (somehow). How can I prevent this? Thanks in advance! -- Best regards, WiB --- -- View this message in context: http://www.nabble.com/Validation-on-java.util.List-tf3398904.html#a9478828 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global messages.jsp file included in a SiteMesh decorator
2007/3/14, mraible [EMAIL PROTECTED]: What if you remove the filter-mapping for Struts' filter in your web.xml? ?? If I remove the Struts' filter nothing works anymore :-) I have a staticFilter in my application that forwards to static resources and doesn't hit the Struts FilterDispatcher when one is found. Maybe that's causing my problem? What if you remove it? -- Guillaume Carré - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.0.6 and Validation
--- Hardy Ferentschik wrote: @Validations( expressions = { @ExpressionValidator( expression = searchParam.keywords ne null and searchParam.location ne null message = Wrong search parameters) } Btw, I haven't tested this yet, but I suspect you wouldn't want 'null' anyway, because empty string params will come in as... well, empty strings, not null. @ExpressionValidator(expression=(searchParam.keywords != '') (searchParam.location != ''), message=Need keywords and location.) worked for me. I still wouldn't do it this way, as it's adding an action-level msg (rather than highlighting the particular field that's missing), but that's a matter of preference and/or requirements. d. Food fight? Enjoy some healthy debate in the Yahoo! Answers Food Drink QA. http://answers.yahoo.com/dir/?link=listsid=396545367 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Missing Message Key
Hi I am new to this forum and started using Struts 1.3.5. Am getting below exception while running my program. Missing message for key userRegistration.firstName in bundle (default bundle) Thanks in Advance. -- Original Message --- From: Guillaume Carré [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wed, 14 Mar 2007 18:06:41 +0100 Subject: Re: Global messages.jsp file included in a SiteMesh decorator 2007/3/14, mraible [EMAIL PROTECTED]: What if you remove the filter-mapping for Struts' filter in your web.xml? ?? If I remove the Struts' filter nothing works anymore :-) I have a staticFilter in my application that forwards to static resources and doesn't hit the Struts FilterDispatcher when one is found. Maybe that's causing my problem? What if you remove it? -- Guillaume Carré - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- End of Original Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DataSources
Chris, Thanks for the reply - this sounds like just what I need. For instance, Apache Tomcat makes this pretty darned easy. You can define a JNDI datasource at the server level, or per webapp. The configuration is (roughly) the same; it just goes in a different place in your config files. I'm using Tomcat 5.5.x. The documentation for this looks pretty good, now that I know where to look for it. Thanks! I never use data sources in action code. I find this to be a bad practice, since I tend to think of my actions as being in the display logic layer, not in my data access layer. My data access layer is made up of a series of service classes which all inherit from a base class which defines a getConnection method which roughly does the above (and properly checks for null, NamingExceptions, etc.). This sounds very similar to what I have. The main difference seems to be that I pass the DataSource in from the action layer, instead of allocating it here. Whatever do you, I would recommend against putting any JNDI-specific code into (all) your actions. If you have to keep data access in your actions, I would recommend putting a getConnection method in your actions' base class and then use that instead of Action.getDataSource(). This is what I'm doing currently, although it would probably be worthwhile moving it down into the class mentioned above, as you suggest. Thanks again! Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Going nuts with s:set
Hi I have this fragment of .jsp code s:iterator value=order.details status=status s:set name=indexValue value=#status.index scope=request/ s:text name=index/ s:property value=#status.index/ s:text name=variable/ s:property value=#indexValue/ !-- Other Stuff here -- /s:iterator When this runs I see the text Index and the value of #status.index followed by the text variable but the value of #indexValue is not displayed. What am I doing wrong? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s1] Filters: distinguishing between user-requests and redirects
2007/3/13, Michael Jouravlev [EMAIL PROTECTED]: On 3/13/07, Christopher Schultz [EMAIL PROTECTED] wrote: I am trying to implement a flood control mechanism to prevent robots requesting pages after pages at an inhuman rate. I know you've gotten lots of feedback already, but there's a super-simple way to do this: put a marker in the request attributes the first time your filter sees it. [...] You are confusing redirection with forwarding. Thank you guys! You really are a fantastic bunch! Echoing Christopher's comments, I indeed have received a lot of feedback and my ideas are much clearer on the matter. Let me just say that I found out an internal way to single out one request for each user-issued request, even when a redirect is involved. (It has to do with the presence or absence of parameters in the URI.) This might not be the most robust solution (our design could hypothetically change in the future). But, for the moment, it would do the job! But since I asked my question (which was about FloodControl through servlet Filters), I have had second thoughts. Wouldn't it be better to implement my FloodControl within the CHAIN OF COMMAND? (I have just upgraded to Struts 1.3.8.) I have never played with the Chain of command, so I would appreciate comments on my plan. PLAN: 1) Since the FloodControl has to do with the very fact that a request was made, I am tempted to ADD a command at the beginning of the process-action subchain, before the selectLocale command. 2) If the FloodControl command concludes that the current request is flooding, it throws a FloodException and stops the chain. (The FloodException is constructed with two properties: the URI and paramMap of the currently interrupted request.) 3) The exception is caught in a Struts global-exception handler, which forwards the user to a FloodControl warning page. This page allows the user to continue to his desired destination, once he clicks on a button. Is step 1) the right way to proceed? Instead of adding a command to the chain, should I instead extend one of the existing commands in the process-action subchain? Which one? AuthorizeAction??? Is throwing a FloodException the correct design, here?
RE: [S2] Result Type Dispatcher problem
This is how 1. One action class and multiple methods in it (insert, Doinsert, update, DoUpdate, list, search etc) 2. All the action mappings use this class and call the different methods based on what is required. 3. The action mappings have additional parameters defined such as DAO, Bean class etc that are used in the base action class to do the actual processing. That way we don't keep creating multiple action classes. We had to disable /actionName!input.action style since all our methods are in one action and the access control to these methods is done via the roles interceptor. Using input is possible and we use it elsewhere in the application, but there are some situations where I have to forward the error messages to a different action. Any reason why dispatch to an action wouldn't work? Thanks Anil -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 10:32 AM To: Struts Users Mailing List Subject: RE: [S2] Result Type Dispatcher problem --- Inamdar, Anil [EMAIL PROTECTED] wrote: Yes I tried with redirect-action and it works. But I don't want a redirect as I lose my messages and other data from the previous action Oh, I didn't notice that you said that in your original post. The default result type is redirect. I don't know as you can redirect to an action w/o specifying redirect-action. Once you redirect, of course you're going to lose request-scoped data. The way you have your actions defined isn't how I normally picture S2 flow working. Personally, I have a single action defined for a datatype (in general, anyway) and display the initial form via a /actionName!input.action link (or you could use wildcards, or whatever). If there's a validation issue, it goes back to !input by magic. If I have an error during execution (so my form submission action is either the default, or I put the method in the url like /actionName!update.action or whatever) I add a message and return INPUT which brings me back to my input (which in my case is a tile). That way I don't have to think about anything, it just works. Is there a particular reason you've set up your actions the way you have? d. Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games. http://games.yahoo.com/games/front - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSources
I think this is where Spring really shines e.g. ApplicationContext.xml ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.springframework.org/schema/beans/spring-beans-2.0.xsd; bean id=corporateEventDao class=com.example.JdbcCorporateEventDao property name=dataSource ref=dataSource/ /bean !-- the DataSource (parameterized for configuration via a PropertyPlaceHolderConfigurer) -- bean id=dataSource destroy-method=close class=org.apache.commons.dbcp.BasicDataSource property name=driverClassName value=${jdbc.driverClassName}/ property name=url value=${jdbc.url}/ property name=username value=${jdbc.username}/ property name=password value=${jdbc.password}/ /bean /beans and then to reference .. --- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. --- Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. - Original Message - From: Daniel Blumenthal [EMAIL PROTECTED] To: 'Struts Users Mailing List' user@struts.apache.org Sent: Wednesday, March 14, 2007 1:37 PM Subject: RE: DataSources Chris, Thanks for the reply - this sounds like just what I need. For instance, Apache Tomcat makes this pretty darned easy. You can define a JNDI datasource at the server level, or per webapp. The configuration is (roughly) the same; it just goes in a different place in your config files. I'm using Tomcat 5.5.x. The documentation for this looks pretty good, now that I know where to look for it. Thanks! I never use data sources in action code. I find this to be a bad practice, since I tend to think of my actions as being in the display logic layer, not in my data access layer. My data access layer is made up of a series of service classes which all inherit from a base class which defines a getConnection method which roughly does the above (and properly checks for null, NamingExceptions, etc.). This sounds very similar to what I have. The main difference seems to be that I pass the DataSource in from the action layer, instead of allocating it here. Whatever do you, I would recommend against putting any JNDI-specific code into (all) your actions. If you have to keep data access in your actions, I would recommend putting a getConnection method in your actions' base class and then use that instead of Action.getDataSource(). This is what I'm doing currently, although it would probably be worthwhile moving it down into the class mentioned above, as you suggest. Thanks again! Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSources
Hi Dansorry..forgot the codepublic class JdbcCorporateEventDao implements CorporateEventDao { private JdbcTemplate jdbcTemplate; public void setDataSource(DataSource dataSource) { this.jdbcTemplate = new JdbcTemplate(dataSource); } // JDBC-backed implementations of the methods on the CorporateEventDao follow... }Personally I like the fact that this Threadsafe config is setup once and then (re)used over and over to multiple DAOsHTHM- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. --- Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. - Original Message - From: Daniel Blumenthal [EMAIL PROTECTED] To: 'Struts Users Mailing List' user@struts.apache.org Sent: Wednesday, March 14, 2007 1:37 PM Subject: RE: DataSources Chris, Thanks for the reply - this sounds like just what I need. For instance, Apache Tomcat makes this pretty darned easy. You can define a JNDI datasource at the server level, or per webapp. The configuration is (roughly) the same; it just goes in a different place in your config files. I'm using Tomcat 5.5.x. The documentation for this looks pretty good, now that I know where to look for it. Thanks! I never use data sources in action code. I find this to be a bad practice, since I tend to think of my actions as being in the display logic layer, not in my data access layer. My data access layer is made up of a series of service classes which all inherit from a base class which defines a getConnection method which roughly does the above (and properly checks for null, NamingExceptions, etc.). This sounds very similar to what I have. The main difference seems to be that I pass the DataSource in from the action layer, instead of allocating it here. Whatever do you, I would recommend against putting any JNDI-specific code into (all) your actions. If you have to keep data access in your actions, I would recommend putting a getConnection method in your actions' base class and then use that instead of Action.getDataSource(). This is what I'm doing currently, although it would probably be worthwhile moving it down into the class mentioned above, as you suggest. Thanks again! Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LazyLists
Apologies for taking so long to post. I was side tracked with other stuff. It does mention in the Wiki: http://wiki.apache.org/struts/StrutsCatalogLazyList In a small line: If you define the following types of getter/setter methods for your indexed property, in JDK 1.3 you shouldn't have any problem, but in JDK 1.4 the getter/setter which use the java.util.List are ignored by Bean Utils. I wonder if it is possible to highlight this. There is also this bug: http://issues.apache.org/jira/browse/BEANUTILS-97 http://wiki.apache.org/struts/StrutsCatalogLazyList Which the developer community cannot determine when this fix will be available. - maestro
Re: Need more comprehensive AJAX Implementation Instructions
I'm using 2.0.6. Hopefully results aren't radically different between dot releases! On 3/12/07, Dave Newton [EMAIL PROTECTED] wrote: --- [EMAIL PROTECTED] wrote: As you can see, this DIV is not well-formed, and naturally does not rended correctly. Any help would be appreciated. What version of S2 are you using? I cut-and-pasted your supplied JSP, created a dummy action and user object, and get radically different results under S2 2.0.4 (and later) (like... my attributes have quotes, the DIV renders in the right spot, etc.) d. No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. http://mobile.yahoo.com/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Scott [EMAIL PROTECTED]
Re: Parsing error processing resource path
The issue is parsing. In my experience, this is due to using backslashes (\) where you should use two backslashes (\\) or a forward slash (/). To debug: It is not necessarily true that the file that defines the servlet action is the culprit. What you need to do is go through that file and verfiy you have correctly typed in all directories (locations on your computer). If they are correct (I suspect they might be), you need to find all files related to initializing the application. Config files, properties files, etc... look for any files that are used as initializers and parse through the parts where you specify directories. If at any point you come across a place where you use a different set of slashes, a red flag should go off. If you use one set of slashes the whole way through, remember that just because you are working on a Windows box does not mean you use backslashes. If this is what you've done, back-up your work, change all backslashes to forward slashes, and restart the server again. If you want, you may also get a nicer parser. Google is the way I would go about doing this. Your Case: I am not 100% sure you are experiencing a parsing issue that deals with slashes; however, I am pretty sure you are dealing with a parsing issue. If my debugging help doesn't work for you, I would try to remember back to any parts where you felt uncertain about what you were typing and look for things that the parser may not like. apetrelli wrote: Sandeep Gupta ha scritto: Hi I am using Struts 1.1 and Weblogic 8.1 SP1. The problem is while deploying my WAR (in the exploded form only) after modification of struts-config.xml. I have this project running for the past 6 years now. As soon as I add another form bean to the struts-config.xml file, I am getting the exception on deployment of the WAR in EXPLODED format: Oct 10, 2006 3:51:04 PM GMT+05:30 Error HTTP BEA-101216 Servlet: action failed to preload on startup in Web application: cdWeb. javax.servlet.UnavailableException: Parsing error processing resource path at org.apache.struts.action.ActionServlet.handleConfigException( ActionServlet.java:1035) at org.apache.struts.action.ActionServlet.parseModuleConfigFile( ActionServlet.java:1014) Can you post your ActionServlet configuration (servlet and servlet-mapping) in your web.xml and, if you have it, the part of struts-config.xml where you configure modules? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Parsing-error-processing-resource-path-tf2415845.html#a9481780 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
--- [EMAIL PROTECTED] wrote: I'm using 2.0.6. Hopefully results aren't radically different between dot releases! At some point things switched to FreeMarker; I don't recall when. It's a new project--things will change, although it seems to settle down. I'm not convinced you really want help; I think you want to complain about things that aren't real issues. I don't see *any* way the output you posted could be generated from the current default S2 tag templates. If you want help, post more details about your configuration, complete source, *something* that allows anybody that wants to help to actually help. Like I said, I used your JSP *verbatim* and could produce nothing like you described: everything worked fine. d. Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cross site scripting issue
Hi All, I am trying to find a best solution to prevent Cross site scripting attacks. I wrote a method to filter out all the bad characters. But my questions is where should I call this method? AT the form level, in setters method r action level or use a filter. I think filter is a good option but I am not sure how to implement that. Any help is appreciated! Thanks -- View this message in context: http://www.nabble.com/Cross-site-scripting-issue-tf3404408.html#a9482026 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSources
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel, Daniel Blumenthal wrote: I'm using Tomcat 5.5.x. The documentation for this looks pretty good, now that I know where to look for it. Thanks! Feel free to cruise on over to the Tomcat list if you have any questions about configuration. There's lots of stuff in the archives if something isn't working for you. This sounds very similar to what I have. The main difference seems to be that I pass the DataSource in from the action layer, instead of allocating it here. Aah, I see. Since Struts was providing your DataSource, you simply used that interface. If you have a ton of code, you have the option of writing some wrappers that can replace the expected DataSource from Struts with another one from JNDI. You could also implement your own getDataSource method in a base action to help with the transition. Or, you could change the interface of every data service that you have ;) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF+FH79CaO5/Lv0PARAhkEAJ9C3rIcglGM48JNn6CWrhD68uR94wCggXMA Ny7N++jUbMVdT1DghA5CIpw= =qYDc -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Passing a bean (out of an iteration) to an action
hi all, Wonder if you can help me on that one: I have an iteration over a collection of beans in my jsp site. I itererate on the list and generate a table with a row for each bean. The first attribute of the table is an index (its the primary key of the record in a database) now id like to do the following: I like to display the id as a link and if the user clicks on it i want to open a new site with all the beans information displayed. Is there a possibility to pass a certain bean with that link? I would like to prevent passing all the attributes over the url... Every help is very welcome:D Regards Balsi -- View this message in context: http://www.nabble.com/Passing-a-bean-%28out-of-an-iteration%29-to-an-action-tf3404493.html#a9482312 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
Hi Stanlick, I think I know whats going on here. Whatever %{zipUrl} in the DIV's href property is pointing to is generating the bad HTML. This part: LABEL class=label for=user_zip_cityCity:/LABEL/TD TDINPUT id=user_zip_city size=40 value=Edwardsville name=user.zip.city /TD/TRTRTD class=tdLabelLABEL class=label for=user_zip_stateState:/LABEL/TD TDINPUT id=user_zip_state size=2 value=IL name=user.zip.state /TD/TR Is what is being pulled in from your %{zipUrl}. [EMAIL PROTECTED] wrote: Hey Dave, how about *you* disregard this thread and allow someone else to respond. This issue is obviously not a good match for your skills. Now then, I'm interested in discovering why an S2 form is generating ill-formed HTML. I have tried each theme, and I get different results, but never reasonable output. Again, I am including my form and the resulting generated HTML: === s:url id=zipUrl value=http://localhost:8080/dsms/ZipCode.action; / s:form theme=xhtml action=register method=post id=registerForm s:textfield name=user.username value=%{user.username} label=%{getText('user.username')} size=40 labelposition=right / s:textfield name=user.password value=%{user.password} label=%{getText('user.password')} size=40 / s:textfield name=user.firstName value=%{user.firstName} label=%{getText('user.firstName')} size=40 / s:textfield name=user.middleName value=%{user.middleName} label=%{getText('user.middleName')} size=40 / s:textfield name=user.lastName value=%{user.lastName} label=%{getText('user.lastName')} size=40 / s:textfield name=user.zip.zip value=%{user.zip.zip} label=%{getText('user.zip')} size=10 onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') / s:div autoStart=false formId=registerForm theme=ajax id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} / s:submit value=%{getText('label.save')} / /s:form === HTML xmlns:v = urn:schemas-microsoft-com:vmlHEADTITLERegister/TITLE STYLEv\:* { BEHAVIOR: url(#default#VML) } /STYLE SCRIPT src=javascript:'dojo.html.createExternalElement=function(doc, tag){ return doc.createElement(tag); }'/SCRIPT STYLE type=text/css.dojoLayoutContainer { DISPLAY: block; POSITION: relative } BODY .dojoAlignTop { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignBottom { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignLeft { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignRight { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignClient { POSITION: absolute } .dojoAlignClient { OVERFLOW: auto } /STYLE /HEAD BODYLINK href=/dsms/struts/xhtml/styles.css type=text/css rel=stylesheet SCRIPT language=JavaScript type=text/javascript // Dojo configuration djConfig = { baseRelativePath: /dsms/struts/dojo, isDebug: true, bindEncoding: UTF-8, debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes }; /SCRIPT SCRIPT language=JavaScript src=/dsms/struts/dojo/dojo.js type=text/javascript/SCRIPT SCRIPT src=/dsms/struts/dojo/src/debug.js type=text/javascript/SCRIPT SCRIPT src=/dsms/struts/dojo/src/browser_debug.js type=text/javascript/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/simple/dojoRequire.js type=text/javascript/SCRIPT SCRIPT type=text/javascriptdojo.hostenv._global_omit_module_check = false;/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/ajax/dojoRequire.js type=text/javascript/SCRIPT TEXTAREA id=dojo.widget.RichText.savedContent style=DISPLAY: none; LEFT: -100px; OVERFLOW: hidden; WIDTH: 3px; POSITION: absolute; TOP: -100px; HEIGHT: 3px/TEXTAREA SCRIPT type=text/javascriptdojo.hostenv._global_omit_module_check = false;/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/CommonFunctions.js type=text/javascript/SCRIPT SCRIPT src=js/scripts.js type=text/javascript/SCRIPT TABLE width=100% border=0 TBODY TR TDIMG src=.\image\logo.jpg The User in Session: /TD TR TDFONT color=#808080 size=7Dynamic Skills Management System /FONT/TD TR TDA href=/dsms/login!input.actionLogon /Anbsp; A href=/dsms/course!input.actionCourses/Anbsp; A href=/dsms/register!input.actionRegister /A/TD/TR/TBODY/TABLE FORM id=registerForm name=register onsubmit=return true; action=/dsms/register.action method=post TABLE class=wwFormTable TBODY TR TD class=tdLabelLABEL class=label for=registerForm_user_usernameUser Name:/LABEL/TD TDINPUT id=registerForm_user_username size=40 name=user.username /TD/TR TR TD class=tdLabelLABEL class=label for=registerForm_user_passwordPassword:/LABEL/TD TDINPUT id=registerForm_user_password size=40 name=user.password /TD/TR TR TD class=tdLabelLABEL class=label for=registerForm_user_firstNameFirst Name:/LABEL/TD TDINPUT id=registerForm_user_firstName size=40 name=user.firstName /TD/TR TR TD class=tdLabelLABEL class=label for=registerForm_user_middleNameMiddle Name:/LABEL/TD TDINPUT id=registerForm_user_middleName size=40 name=user.middleName /TD/TR TR TD class=tdLabelLABEL class=label
Need Help -Urgent
Hi , i am using below snippet and i am getting the following error : TR TH class=tRightCP Description/TH TDhtml:textarea readonly=${isReadOnly} property=cpDesc *maxlength=** 2* //TD /TR Error: [3/14/07 14:57:52:094 EST] 715b61a9 WebGroup E SRVE0026E: [Servlet Error]-[/Pages/adjustReporting.jsp#40;139,8#41; *Attribute maxlength invalid according to the specified TLD]: org.apache.jasper.compiler.CompileException: /Pages/adjustReporting.jsp(139,8) Attribute maxlength invalid according to the specified TLD* please help me on this. -- Satheesh.C
RE: Cross site scripting issue
Check for a predefined pattern of characters in a filter,as you have suggested, (probably read from xml) and forward to an error page if you find any. -Original Message- From: rapsy [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 3:50 PM To: user@struts.apache.org Subject: Cross site scripting issue Hi All, I am trying to find a best solution to prevent Cross site scripting attacks. I wrote a method to filter out all the bad characters. But my questions is where should I call this method? AT the form level, in setters method r action level or use a filter. I think filter is a good option but I am not sure how to implement that. Any help is appreciated! Thanks -- View this message in context: http://www.nabble.com/Cross-site-scripting-issue-tf3404408.html#a9482026 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Help -Urgent
--- Sachin [EMAIL PROTECTED] wrote: html:textarea readonly=${isReadOnly} property=cpDesc *maxlength=** 2* //TD Textareas don't have a maxlength attribute. d. Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Help -Urgent
Textarea doesn't support the maxlength attribute: http://www.w3.org/TR/html4/interact/forms.html#h-17.7 On 3/14/07, Sachin [EMAIL PROTECTED] wrote: Hi , i am using below snippet and i am getting the following error : TR TH class=tRightCP Description/TH TDhtml:textarea readonly=${isReadOnly} property=cpDesc *maxlength=** 2* //TD /TR Error: [3/14/07 14:57:52:094 EST] 715b61a9 WebGroup E SRVE0026E: [Servlet Error]-[/Pages/adjustReporting.jsp#40;139,8#41; *Attribute maxlength invalid according to the specified TLD]: org.apache.jasper.compiler.CompileException: /Pages/adjustReporting.jsp(139,8) Attribute maxlength invalid according to the specified TLD* please help me on this. -- Satheesh.C - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
--- Adam Ruggles [EMAIL PROTECTED] wrote: I think I know whats going on here. Whatever %{zipUrl} in the DIV's href property is pointing to is generating the bad HTML. Possibly, but whether I use %{zipUrl} or %{#zipUrl} I still get correct HTML; my s:div... renders as: div dojoType=struts:BindDiv autoStart=false id=zipDiv formId=registerForm href=http://localhost:8080/s2samples/stan/stan1.action; listenTopics=zipEnteredTopicshowError=true /div The radical difference in the generated HTML (I'm running under 2.0.4 but am double-checking under 2.0.6) leads me to wonder about interceptors, filters, clients, and other weird things, because I have yet to see malformed HTML generated by the S2 tags. d. Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
Just as a followup, I am still not convinced that it's legal HTML to embed a div inside a table, between table rows. Which browser you're using to retrieve the generated source would also be useful information. d. --- Dave Newton [EMAIL PROTECTED] wrote: --- [EMAIL PROTECTED] wrote: This issue is obviously not a good match for your skills. The *issue* is a great match for my skills. *You* are not. Verbatim, although I added the surrounding HTML and taglib directive: s:url id=zipUrl value=http://localhost:8080/dsms/ZipCode.action; / s:form theme=xhtml action=register method=post id=registerForm s:textfield name=user.username value=%{user.username} label=%{getText('user.username')} size=40 labelposition=right / s:textfield name=user.password value=%{user.password} label=%{getText('user.password')} size=40 / s:textfield name=user.firstName value=%{user.firstName} label=%{getText('user.firstName')} size=40 / s:textfield name=user.middleName value=%{user.middleName} label=%{getText('user.middleName')} size=40 / s:textfield name=user.lastName value=%{user.lastName} label=%{getText('user.lastName')} size=40 / s:textfield name=user.zip.zip value=%{user.zip.zip} label=%{getText('user.zip')} size=10 onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') / s:div autoStart=false formId=registerForm theme=ajax id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} / s:submit value=%{getText('label.save')} / /s:form Generates: html body form id=registerForm onsubmit=return true; action=register method=post table class=wwFormTable tr td class=tdLabellabel for=registerForm_user_username class=labeluser.username:/label/td td input type=text name=user.username size=40 value= id=registerForm_user_username/ /td /tr tr td class=tdLabellabel for=registerForm_user_password class=labeluser.password:/label/td td input type=text name=user.password size=40 value= id=registerForm_user_password/ /td /tr tr td class=tdLabellabel for=registerForm_user_firstName class=labeluser.firstName:/label/td td input type=text name=user.firstName size=40 value= id=registerForm_user_firstName/ /td /tr tr td class=tdLabellabel for=registerForm_user_middleName class=labeluser.middleName:/label/td td input type=text name=user.middleName size=40 value= id=registerForm_user_middleName/ /td /tr tr td class=tdLabellabel for=registerForm_user_lastName class=labeluser.lastName:/label/td td input type=text name=user.lastName size=40 value= id=registerForm_user_lastName/ /td /tr tr td class=tdLabellabel for=registerForm_user_zip_zip class=labeluser.zip:/label/td td input type=text name=user.zip.zip size=10 value= id=registerForm_user_zip_zip onblur=javascript:dojo.event.topic.publish('zipEnteredTopic')/ /td /tr div dojoType=struts:BindDiv autoStart=false id=zipDiv formId=registerForm href=http://localhost:8080/s2samples/stan/stan1.action; listenTopics=zipEnteredTopic showError=true /div tr td colspan=2div align=rightinput type=submit id=registerForm_0 value=label.save/ /div/td /tr /table/form /body /html I *completely* fail to understand how your generated HTML doesn't have quotes around the attributes etc. Unless you provide more information I don't see how you think anyone *else* will be able to help you either. What container, what JDK, the normal stuff you'd want to report when faced with an issue like this. d. Food fight? Enjoy some healthy debate in the Yahoo! Answers Food Drink QA. http://answers.yahoo.com/dir/?link=listsid=396545367 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Help -Urgent
Thanks guys. But i need to limit text area content. Do i need to use rows ? On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Sachin [EMAIL PROTECTED] wrote: html:textarea readonly=${isReadOnly} property=cpDesc *maxlength=** 2* //TD Textareas don't have a maxlength attribute. d. Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Satheesh.C
Re: Need more comprehensive AJAX Implementation Instructions
d. Can you show me what your action mapping looks like for */stan1.action?* As far as the missing quotes go, the only way I can view generated source *and* have the content dynamically added to the DOM included, is to use the IE plug in that builds the HTML directly from the DOM tree. This is likely stripping the quotes. If I simply right-click and view source I get this, which does not reveal the ajax portion of the file but does have the quotes: html head titleRegister/title /head body link rel=stylesheet href=/dsms/struts/xhtml/styles.css type=text/css/ script language=JavaScript type=text/javascript // Dojo configuration djConfig = { baseRelativePath: /dsms/struts/dojo, isDebug: true, bindEncoding: UTF-8, debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes }; /script script language=JavaScript type=text/javascript src=/dsms/struts/dojo/dojo.js/script script language=JavaScript type=text/javascript src=/dsms/struts/simple/dojoRequire.js/script script language=JavaScript type=text/javascript src=/dsms/struts/ajax/dojoRequire.js/script script language=JavaScript type=text/javascript src=/dsms/struts/CommonFunctions.js/script script type=text/javascript src=js/scripts.js/script html body table width=100% border=0 tbody tr td img src=.\image\logo.jpg The User in Session: /td tr td font size=7 color=#808080 Dynamic Skills Management System /font /td tr td a href=/dsms/login!input.action Logon /anbsp a href=/dsms/course!input.actionCourses/anbsp a href=/dsms/register!input.action Register /a /td /tr /tbody /table /body /html form id=registerForm name=register onsubmit=return true; action=/dsms/register.action method=post table class=wwFormTable tr td class=tdLabellabel for=registerForm_user_username class=labelUser Name:/label/td td input type=text name=user.username size=40 value= id=registerForm_user_username/ /td /tr tr td class=tdLabellabel for=registerForm_user_password class=labelPassword:/label/td td input type=text name=user.password size=40 value= id=registerForm_user_password/ /td /tr tr td class=tdLabellabel for=registerForm_user_firstName class=labelFirst Name:/label/td td input type=text name=user.firstName size=40 value= id=registerForm_user_firstName/ /td /tr tr td class=tdLabellabel for=registerForm_user_middleName class=labelMiddle Name:/label/td td input type=text name=user.middleName size=40 value= id=registerForm_user_middleName/ /td /tr tr td class=tdLabellabel for=registerForm_user_lastName class=labelLast Name:/label/td td input type=text name=user.lastName size=40 value= id=registerForm_user_lastName/ /td /tr tr td class=tdLabellabel for=registerForm_user_zip_zip class=labelZip Code:/label/td td input type=text name=user.zip.zip size=10 value= id=registerForm_user_zip_zip onblur=javascript:dojo.event.topic.publish ('zipEnteredTopic')/ /td /tr div dojoType=struts:BindDiv autoStart=false id=zipDiv formId=registerForm href= http://localhost:8080/dsms/ZipCode.action; listenTopics=zipEnteredTopicshowError=true /div tr td colspan=2div align=rightinput type=submit id=registerForm_0 value=Save/ /div/td /tr /table/form html body p align=centerfont size=2 color=#808080Copyright copy;2003-2007 The DSMS Software Foundation./font/p /body /html /body /html On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- [EMAIL PROTECTED] wrote: This issue is obviously not a good match for your skills. The *issue* is a great match for my skills. *You* are not. Verbatim, although I added the surrounding HTML and taglib directive: s:url id=zipUrl value=http://localhost:8080/dsms/ZipCode.action; / s:form theme=xhtml action=register method=post id=registerForm s:textfield name=user.username value=%{user.username} label=%{getText('user.username')} size=40 labelposition=right / s:textfield name=user.password value=%{user.password} label=%{getText('user.password')} size=40 / s:textfield name=user.firstName value=%{user.firstName} label=%{getText('user.firstName')} size=40 / s:textfield name=user.middleName value=%{user.middleName} label=%{getText('user.middleName')} size=40 / s:textfield name=user.lastName value=%{user.lastName} label=%{getText('user.lastName')} size=40 / s:textfield name=user.zip.zip value=%{user.zip.zip} label=%{getText('user.zip')} size=10 onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') / s:div autoStart=false formId=registerForm theme=ajax id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} / s:submit value=%{getText('label.save')} / /s:form Generates: html body form id=registerForm onsubmit=return true; action=register method=post table class=wwFormTable tr td class=tdLabellabel
Re: Need Help -Urgent
--- Sachin [EMAIL PROTECTED] wrote: But i need to limit text area content. Do i need to use rows ? You'll probably need to use JavaScript; I don't know of a way to limit the number of characters in a textarea without it. d. Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cross site scripting issue
Jason Britain (author of Tomcat, the definitive guide) has a ready-to-run filter/valve solution for that. You could talk to him on the #tomcat channel on irc. Besides, best XSS prevention is imo not filtering the input, but the output. if you write everything out with bean:write ... filter=true you'll be fine. regards Leon On 3/14/07, rapsy [EMAIL PROTECTED] wrote: Hi All, I am trying to find a best solution to prevent Cross site scripting attacks. I wrote a method to filter out all the bad characters. But my questions is where should I call this method? AT the form level, in setters method r action level or use a filter. I think filter is a good option but I am not sure how to implement that. Any help is appreciated! Thanks -- View this message in context: http://www.nabble.com/Cross-site-scripting-issue-tf3404408.html#a9482026 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
Hey Adam! You might be onto something here! When a zip code is entered, the ajax portion %{zipUrl} is fetching the zip info from a database and populating the fields that the DIV is supposed to include in the form. I have programmed a bunch of JSP's using this technique with XmlHttpObject! Do you suppose S2 does not allow it? Thanks Scott On 3/14/07, Adam Ruggles [EMAIL PROTECTED] wrote: Hi Stanlick, I think I know whats going on here. Whatever %{zipUrl} in the DIV's href property is pointing to is generating the bad HTML. This part: LABEL class=label for=user_zip_cityCity:/LABEL/TD TDINPUT id=user_zip_city size=40 value=Edwardsville name=user.zip.city /TD/TRTRTD class=tdLabelLABEL class=label for=user_zip_stateState:/LABEL/TD TDINPUT id=user_zip_state size=2 value=IL name=user.zip.state /TD/TR Is what is being pulled in from your %{zipUrl}. [EMAIL PROTECTED] wrote: Hey Dave, how about *you* disregard this thread and allow someone else to respond. This issue is obviously not a good match for your skills. Now then, I'm interested in discovering why an S2 form is generating ill-formed HTML. I have tried each theme, and I get different results, but never reasonable output. Again, I am including my form and the resulting generated HTML: === s:url id=zipUrl value=http://localhost:8080/dsms/ZipCode.action; / s:form theme=xhtml action=register method=post id=registerForm s:textfield name=user.username value=%{user.username} label=%{getText('user.username')} size=40 labelposition=right / s:textfield name=user.password value=%{user.password} label=%{getText('user.password')} size=40 / s:textfield name=user.firstName value=%{user.firstName} label=%{getText('user.firstName')} size=40 / s:textfield name=user.middleName value=%{user.middleName} label=%{getText('user.middleName')} size=40 / s:textfield name=user.lastName value=%{user.lastName} label=%{getText('user.lastName')} size=40 / s:textfield name=user.zip.zip value=%{user.zip.zip} label=%{getText('user.zip')} size=10 onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') / s:div autoStart=false formId=registerForm theme=ajax id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} / s:submit value=%{getText('label.save')} / /s:form === HTML xmlns:v = urn:schemas-microsoft-com:vmlHEADTITLERegister/TITLE STYLEv\:* { BEHAVIOR: url(#default#VML) } /STYLE SCRIPT src=javascript:'dojo.html.createExternalElement=function(doc, tag){ return doc.createElement(tag); }'/SCRIPT STYLE type=text/css.dojoLayoutContainer { DISPLAY: block; POSITION: relative } BODY .dojoAlignTop { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignBottom { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignLeft { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignRight { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignClient { POSITION: absolute } .dojoAlignClient { OVERFLOW: auto } /STYLE /HEAD BODYLINK href=/dsms/struts/xhtml/styles.css type=text/css rel=stylesheet SCRIPT language=JavaScript type=text/javascript // Dojo configuration djConfig = { baseRelativePath: /dsms/struts/dojo, isDebug: true, bindEncoding: UTF-8, debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes }; /SCRIPT SCRIPT language=JavaScript src=/dsms/struts/dojo/dojo.js type=text/javascript/SCRIPT SCRIPT src=/dsms/struts/dojo/src/debug.js type=text/javascript/SCRIPT SCRIPT src=/dsms/struts/dojo/src/browser_debug.js type=text/javascript/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/simple/dojoRequire.js type=text/javascript/SCRIPT SCRIPT type=text/javascriptdojo.hostenv._global_omit_module_check = false;/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/ajax/dojoRequire.js type=text/javascript/SCRIPT TEXTAREA id=dojo.widget.RichText.savedContent style=DISPLAY: none; LEFT: -100px; OVERFLOW: hidden; WIDTH: 3px; POSITION: absolute; TOP: -100px; HEIGHT: 3px/TEXTAREA SCRIPT type=text/javascriptdojo.hostenv._global_omit_module_check = false;/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/CommonFunctions.js type=text/javascript/SCRIPT SCRIPT src=js/scripts.js type=text/javascript/SCRIPT TABLE width=100% border=0 TBODY TR TDIMG src=.\image\logo.jpg The User in Session: /TD TR TDFONT color=#808080 size=7Dynamic Skills Management System /FONT/TD TR TDA href=/dsms/login!input.actionLogon /Anbsp; A href=/dsms/course!input.actionCourses/Anbsp; A href=/dsms/register!input.actionRegister /A/TD/TR/TBODY/TABLE FORM id=registerForm name=register onsubmit=return true; action=/dsms/register.action method=post TABLE class=wwFormTable TBODY TR TD class=tdLabelLABEL class=label for=registerForm_user_usernameUser Name:/LABEL/TD TDINPUT id=registerForm_user_username size=40 name=user.username /TD/TR TR TD class=tdLabelLABEL class=label
Re: Need Help -Urgent
Currently i am using Tag Library 1.1 Will latest version of *struts-html.tld* help ? On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Sachin [EMAIL PROTECTED] wrote: But i need to limit text area content. Do i need to use rows ? You'll probably need to use JavaScript; I don't know of a way to limit the number of characters in a textarea without it. d. Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Satheesh.C
Re: Need more comprehensive AJAX Implementation Instructions
--- [EMAIL PROTECTED] wrote: This issue is obviously not a good match for your skills. The *issue* is a great match for my skills. *You* are not. Verbatim, although I added the surrounding HTML and taglib directive: s:url id=zipUrl value=http://localhost:8080/dsms/ZipCode.action; / s:form theme=xhtml action=register method=post id=registerForm s:textfield name=user.username value=%{user.username} label=%{getText('user.username')} size=40 labelposition=right / s:textfield name=user.password value=%{user.password} label=%{getText('user.password')} size=40 / s:textfield name=user.firstName value=%{user.firstName} label=%{getText('user.firstName')} size=40 / s:textfield name=user.middleName value=%{user.middleName} label=%{getText('user.middleName')} size=40 / s:textfield name=user.lastName value=%{user.lastName} label=%{getText('user.lastName')} size=40 / s:textfield name=user.zip.zip value=%{user.zip.zip} label=%{getText('user.zip')} size=10 onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') / s:div autoStart=false formId=registerForm theme=ajax id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} / s:submit value=%{getText('label.save')} / /s:form Generates: html body form id=registerForm onsubmit=return true; action=register method=post table class=wwFormTable tr td class=tdLabellabel for=registerForm_user_username class=labeluser.username:/label/td td input type=text name=user.username size=40 value= id=registerForm_user_username/ /td /tr tr td class=tdLabellabel for=registerForm_user_password class=labeluser.password:/label/td td input type=text name=user.password size=40 value= id=registerForm_user_password/ /td /tr tr td class=tdLabellabel for=registerForm_user_firstName class=labeluser.firstName:/label/td td input type=text name=user.firstName size=40 value= id=registerForm_user_firstName/ /td /tr tr td class=tdLabellabel for=registerForm_user_middleName class=labeluser.middleName:/label/td td input type=text name=user.middleName size=40 value= id=registerForm_user_middleName/ /td /tr tr td class=tdLabellabel for=registerForm_user_lastName class=labeluser.lastName:/label/td td input type=text name=user.lastName size=40 value= id=registerForm_user_lastName/ /td /tr tr td class=tdLabellabel for=registerForm_user_zip_zip class=labeluser.zip:/label/td td input type=text name=user.zip.zip size=10 value= id=registerForm_user_zip_zip onblur=javascript:dojo.event.topic.publish('zipEnteredTopic')/ /td /tr div dojoType=struts:BindDiv autoStart=false id=zipDiv formId=registerForm href=http://localhost:8080/s2samples/stan/stan1.action; listenTopics=zipEnteredTopicshowError=true /div tr td colspan=2div align=rightinput type=submit id=registerForm_0 value=label.save/ /div/td /tr /table/form /body /html I *completely* fail to understand how your generated HTML doesn't have quotes around the attributes etc. Unless you provide more information I don't see how you think anyone *else* will be able to help you either. What container, what JDK, the normal stuff you'd want to report when faced with an issue like this. d. Food fight? Enjoy some healthy debate in the Yahoo! Answers Food Drink QA. http://answers.yahoo.com/dir/?link=listsid=396545367 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
!-- %%% -- !-- AJAX Mappings -- !-- %%% -- action name=ZipCode class=zipAjaxAction result/pages/ajaxGoods.jsp/result /action === /pages/ajaxGoods.jsp source code s:textfield name=user.zip.city value=%{user.zip.city} label= %{getText('user.city')} size=40/ s:textfield name=user.zip.state value=%{user.zip.state} label= %{getText('user.state')} size=2/
Re: Need more comprehensive AJAX Implementation Instructions
--- [EMAIL PROTECTED] wrote: d. Can you show me what your action mapping looks like for */stan1.action?* package name=stan namespace=/stan extends=struts-default action name=stan1 class=stan.Stan1Action result/WEB-INF/jsp/stan/stan1.jsp/result /action /package As far as the missing quotes go, the only way I can view generated source *and* have the content dynamically added to the DOM included, is to use the IE plug in that builds the HTML directly from the DOM tree. Oooo. Which version of IE? For me under IE 7 it's being rendered correctly. Note that if I look at the *DOM* in FireFox the DIV is before the table rows of the form, which I suspect may be due to embedded DIVs between table rows being a no-no, but I'm *definitely* not sure about that. You might want to try putting the s:div.../ inside a tr.../tr (or whatever, depending on what the action is returning); I would be, say, 60-65% certain that will fix the problem. d. We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Help -Urgent
--- Sachin [EMAIL PROTECTED] wrote: Currently i am using Tag Library 1.1 Will latest version of *struts-html.tld* help ? No. Text areas don't have a maxlength, no matter what TLD you use. d. Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
I don't think there is anything about the XmlHttpObject that is not allowed by s2, however what you are expecting to happen might change. Based on your code snippet as soon as you load the page, the s2 div tag is going to request whatever %{zipUrl} is pointing to. It will render the complete page requested in the DIV. If you point your browser at the path that %{zipUrl} is pointing to and view source, everything in there will be inserted into the div. [EMAIL PROTECTED] wrote: Hey Adam! You might be onto something here! When a zip code is entered, the ajax portion %{zipUrl} is fetching the zip info from a database and populating the fields that the DIV is supposed to include in the form. I have programmed a bunch of JSP's using this technique with XmlHttpObject! Do you suppose S2 does not allow it? Thanks Scott On 3/14/07, Adam Ruggles [EMAIL PROTECTED] wrote: Hi Stanlick, I think I know whats going on here. Whatever %{zipUrl} in the DIV's href property is pointing to is generating the bad HTML. This part: LABEL class=label for=user_zip_cityCity:/LABEL/TD TDINPUT id=user_zip_city size=40 value=Edwardsville name=user.zip.city /TD/TRTRTD class=tdLabelLABEL class=label for=user_zip_stateState:/LABEL/TD TDINPUT id=user_zip_state size=2 value=IL name=user.zip.state /TD/TR Is what is being pulled in from your %{zipUrl}. [EMAIL PROTECTED] wrote: Hey Dave, how about *you* disregard this thread and allow someone else to respond. This issue is obviously not a good match for your skills. Now then, I'm interested in discovering why an S2 form is generating ill-formed HTML. I have tried each theme, and I get different results, but never reasonable output. Again, I am including my form and the resulting generated HTML: === s:url id=zipUrl value=http://localhost:8080/dsms/ZipCode.action; / s:form theme=xhtml action=register method=post id=registerForm s:textfield name=user.username value=%{user.username} label=%{getText('user.username')} size=40 labelposition=right / s:textfield name=user.password value=%{user.password} label=%{getText('user.password')} size=40 / s:textfield name=user.firstName value=%{user.firstName} label=%{getText('user.firstName')} size=40 / s:textfield name=user.middleName value=%{user.middleName} label=%{getText('user.middleName')} size=40 / s:textfield name=user.lastName value=%{user.lastName} label=%{getText('user.lastName')} size=40 / s:textfield name=user.zip.zip value=%{user.zip.zip} label=%{getText('user.zip')} size=10 onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') / s:div autoStart=false formId=registerForm theme=ajax id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} / s:submit value=%{getText('label.save')} / /s:form === HTML xmlns:v = urn:schemas-microsoft-com:vmlHEADTITLERegister/TITLE STYLEv\:* { BEHAVIOR: url(#default#VML) } /STYLE SCRIPT src=javascript:'dojo.html.createExternalElement=function(doc, tag){ return doc.createElement(tag); }'/SCRIPT STYLE type=text/css.dojoLayoutContainer { DISPLAY: block; POSITION: relative } BODY .dojoAlignTop { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignBottom { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignLeft { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignRight { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignClient { POSITION: absolute } .dojoAlignClient { OVERFLOW: auto } /STYLE /HEAD BODYLINK href=/dsms/struts/xhtml/styles.css type=text/css rel=stylesheet SCRIPT language=JavaScript type=text/javascript // Dojo configuration djConfig = { baseRelativePath: /dsms/struts/dojo, isDebug: true, bindEncoding: UTF-8, debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes }; /SCRIPT SCRIPT language=JavaScript src=/dsms/struts/dojo/dojo.js type=text/javascript/SCRIPT SCRIPT src=/dsms/struts/dojo/src/debug.js type=text/javascript/SCRIPT SCRIPT src=/dsms/struts/dojo/src/browser_debug.js type=text/javascript/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/simple/dojoRequire.js type=text/javascript/SCRIPT SCRIPT type=text/javascriptdojo.hostenv._global_omit_module_check = false;/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/ajax/dojoRequire.js type=text/javascript/SCRIPT TEXTAREA id=dojo.widget.RichText.savedContent style=DISPLAY: none; LEFT: -100px; OVERFLOW: hidden; WIDTH: 3px; POSITION: absolute; TOP: -100px; HEIGHT: 3px/TEXTAREA SCRIPT type=text/javascriptdojo.hostenv._global_omit_module_check = false;/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/CommonFunctions.js type=text/javascript/SCRIPT SCRIPT src=js/scripts.js type=text/javascript/SCRIPT TABLE width=100% border=0 TBODY TR TDIMG src=.\image\logo.jpg The User in Session: /TD TR TDFONT color=#808080 size=7Dynamic Skills Management System /FONT/TD TR
Re: Need more comprehensive AJAX Implementation Instructions
IE 6.0! It's my work laptop don't ask. Let me port this to my home desktop running the new FireFox and I'll let you know how it turns out! This is really going to suck if this has been the problem all along!!! Maybe Bruce Eckel is right? Scott On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- [EMAIL PROTECTED] wrote: d. Can you show me what your action mapping looks like for */stan1.action?* package name=stan namespace=/stan extends=struts-default action name=stan1 class=stan.Stan1Action result/WEB-INF/jsp/stan/stan1.jsp/result /action /package As far as the missing quotes go, the only way I can view generated source *and* have the content dynamically added to the DOM included, is to use the IE plug in that builds the HTML directly from the DOM tree. Oooo. Which version of IE? For me under IE 7 it's being rendered correctly. Note that if I look at the *DOM* in FireFox the DIV is before the table rows of the form, which I suspect may be due to embedded DIVs between table rows being a no-no, but I'm *definitely* not sure about that. You might want to try putting the s:div.../ inside a tr.../tr (or whatever, depending on what the action is returning); I would be, say, 60-65% certain that will fix the problem. d. We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Scott [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
I have requested %{zipUrl} directly: http://localhost:8080/dsms/ZipCode.action and the resulting response is EXACTLY what I'd like included in that DIV!!! On 3/14/07, Adam Ruggles [EMAIL PROTECTED] wrote: I don't think there is anything about the XmlHttpObject that is not allowed by s2, however what you are expecting to happen might change. Based on your code snippet as soon as you load the page, the s2 div tag is going to request whatever %{zipUrl} is pointing to. It will render the complete page requested in the DIV. If you point your browser at the path that %{zipUrl} is pointing to and view source, everything in there will be inserted into the div. [EMAIL PROTECTED] wrote: Hey Adam! You might be onto something here! When a zip code is entered, the ajax portion %{zipUrl} is fetching the zip info from a database and populating the fields that the DIV is supposed to include in the form. I have programmed a bunch of JSP's using this technique with XmlHttpObject! Do you suppose S2 does not allow it? Thanks Scott On 3/14/07, Adam Ruggles [EMAIL PROTECTED] wrote: Hi Stanlick, I think I know whats going on here. Whatever %{zipUrl} in the DIV's href property is pointing to is generating the bad HTML. This part: LABEL class=label for=user_zip_cityCity:/LABEL/TD TDINPUT id=user_zip_city size=40 value=Edwardsville name=user.zip.city /TD/TRTRTD class=tdLabelLABEL class=label for=user_zip_stateState:/LABEL/TD TDINPUT id=user_zip_state size=2 value=IL name=user.zip.state /TD/TR Is what is being pulled in from your %{zipUrl}. [EMAIL PROTECTED] wrote: Hey Dave, how about *you* disregard this thread and allow someone else to respond. This issue is obviously not a good match for your skills. Now then, I'm interested in discovering why an S2 form is generating ill-formed HTML. I have tried each theme, and I get different results, but never reasonable output. Again, I am including my form and the resulting generated HTML: === s:url id=zipUrl value=http://localhost:8080/dsms/ZipCode.action; / s:form theme=xhtml action=register method=post id=registerForm s:textfield name=user.username value=%{user.username} label=%{getText('user.username')} size=40 labelposition=right / s:textfield name=user.password value=%{user.password} label=%{getText('user.password')} size=40 / s:textfield name=user.firstName value=%{user.firstName} label=%{getText('user.firstName')} size=40 / s:textfield name=user.middleName value=%{user.middleName} label=%{getText('user.middleName')} size=40 / s:textfield name=user.lastName value=%{user.lastName} label=%{getText('user.lastName')} size=40 / s:textfield name=user.zip.zip value=%{user.zip.zip} label=%{getText('user.zip')} size=10 onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') / s:div autoStart=false formId=registerForm theme=ajax id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} / s:submit value=%{getText('label.save')} / /s:form === HTML xmlns:v = urn:schemas-microsoft-com:vmlHEADTITLERegister/TITLE STYLEv\:* { BEHAVIOR: url(#default#VML) } /STYLE SCRIPT src=javascript:'dojo.html.createExternalElement=function (doc, tag){ return doc.createElement(tag); }'/SCRIPT STYLE type=text/css.dojoLayoutContainer { DISPLAY: block; POSITION: relative } BODY .dojoAlignTop { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignBottom { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignLeft { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignRight { OVERFLOW: hidden; POSITION: absolute } BODY .dojoAlignClient { POSITION: absolute } .dojoAlignClient { OVERFLOW: auto } /STYLE /HEAD BODYLINK href=/dsms/struts/xhtml/styles.css type=text/css rel=stylesheet SCRIPT language=JavaScript type=text/javascript // Dojo configuration djConfig = { baseRelativePath: /dsms/struts/dojo, isDebug: true, bindEncoding: UTF-8, debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes }; /SCRIPT SCRIPT language=JavaScript src=/dsms/struts/dojo/dojo.js type=text/javascript/SCRIPT SCRIPT src=/dsms/struts/dojo/src/debug.js type=text/javascript/SCRIPT SCRIPT src=/dsms/struts/dojo/src/browser_debug.js type=text/javascript/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/simple/dojoRequire.js type=text/javascript/SCRIPT SCRIPT type=text/javascriptdojo.hostenv._global_omit_module_check = false;/SCRIPT SCRIPT language=JavaScript src=/dsms/struts/ajax/dojoRequire.js type=text/javascript/SCRIPT TEXTAREA id=dojo.widget.RichText.savedContent style=DISPLAY: none; LEFT: -100px; OVERFLOW: hidden; WIDTH: 3px; POSITION: absolute; TOP: -100px; HEIGHT: 3px/TEXTAREA SCRIPT type=text/javascriptdojo.hostenv._global_omit_module_check =
Re: Need Help -Urgent
Guys, Here is my problem description . I have a text area field in my application which has to allow only 2 chars.User may copy paste some content in to textarea field. I used the below code to construct the textfield html:textarea readonly=${isReadOnly} property=ab2Desc / I am able to limit the maximum size of the textarea using following javascript function as dave suggested. function checkChar(maxchars) { if(document.ourform.box.value.length maxchars) { return false; } else return true; } Data also stored successfully in data base as entered. but problem is when i click to edit, not able to place the content in to text area back the form in the edit page is not opening. Can you suggest me how to resolve this? On 3/14/07, Sachin [EMAIL PROTECTED] wrote: Currently i am using Tag Library 1.1 Will latest version of *struts-html.tld* help ? On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Sachin [EMAIL PROTECTED] wrote: But i need to limit text area content. Do i need to use rows ? You'll probably need to use JavaScript; I don't know of a way to limit the number of characters in a textarea without it. d. Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Satheesh.C -- Satheesh.C
Re: Need more comprehensive AJAX Implementation Instructions
Wait, now I've totally forgotten what the original problem was. If below is the generated HTML then what is rendering incorrectly? DIV id=zipDiv showError=true listenTopics=zipEnteredTopic href=http://localhost:8080/dsms/ZipCode.action; formId=registerForm autoStart=false dojoType=struts:BindDiv Is there no starting TR/TD? LABEL class=label for=user_zip_city City: /LABEL /TD TD INPUT id=user_zip_city size=40 value=Edwardsville name=user.zip.city /TD /TRTRTD class=tdLabelLABEL class=label for=user_zip_stateState:/LABEL/TD TDINPUT id=user_zip_state size=2 value=IL name=user.zip.state /TD/TR/DIV If that's the case then we'd need to see the JSP that the AJAX action is (attempting to, anyway) rendering. d. Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
This is what should be rendering *but* is not! Dave, you about had it when you said to wrap the DIV in trtd tags. When I do this, the ajax'd bits *do* show up, but not lined up with all the other columns! At least now I can see the blasted fields This generated HTML is whacky with a DIV in a FORM! However, I don't see any other way of using the ajax support to populate some of the form fields??? On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: Wait, now I've totally forgotten what the original problem was. If below is the generated HTML then what is rendering incorrectly? DIV id=zipDiv showError=true listenTopics=zipEnteredTopic href=http://localhost:8080/dsms/ZipCode.action; formId=registerForm autoStart=false dojoType=struts:BindDiv Is there no starting TR/TD? LABEL class=label for=user_zip_city City: /LABEL /TD TD INPUT id=user_zip_city size=40 value=Edwardsville name=user.zip.city /TD /TRTRTD class=tdLabelLABEL class=label for=user_zip_stateState:/LABEL/TD TDINPUT id=user_zip_state size=2 value=IL name=user.zip.state /TD/TR/DIV If that's the case then we'd need to see the JSP that the AJAX action is (attempting to, anyway) rendering. d. Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Scott [EMAIL PROTECTED]
initialize java form bean
is there a way to set a property of a java form bean from struts-config.xml? I try to use set-property and it is not working.
Lazy loading actions in Struts 2
Hi, Is there a way to prevent Struts 2 from instatiating all the actions defined in the action configuration file whe loading the application? I am using Spring for object factory. Thanks Marco -- View this message in context: http://www.nabble.com/Lazy-loading-actions-in-Struts-2-tf3404803.html#a9483355 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: initialize java form bean
Try action name=SomeAction class=com.some.path.to.youAction param name=nameOfAttributeValue you want/param Make sure your action has the method that match accessors for the attribute. In the case above, you need public String setNameOfAttribute(String va){ } Hope this helps. Harring On 3/14/07, Lim Hock-Chai [EMAIL PROTECTED] wrote: is there a way to set a property of a java form bean from struts-config.xml? I try to use set-property and it is not working. -- Sincerely, Harring Figueiredo Sr. Software Engineer Email: [EMAIL PROTECTED] Telephone: 941-256-0600 We never become truly spiritual by sitting down and wishing to become so. You must undertake something so great that you cannot accomplish it unaided.
Re: Need more comprehensive AJAX Implementation Instructions
--- [EMAIL PROTECTED] wrote: the ajax'd bits *do* show up, but not lined up with all the other columns! At least now I can see the blasted fields You may be able to tweak the JSP you are returning to make it do the right thing, say with theme=simple etc. Heck, making the s:div.../ into s:div.../s:div might even work--with IE it's pretty much a crap shoot what will work. However, I don't see any other way of using the ajax support to populate some of the form fields??? That I'd have to think about; so far the only thing I've come up with in my head is to use Dojo a bit more manually. d. 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Lazy loading actions in Struts 2
--- Marco from Balboa [EMAIL PROTECTED] wrote: Is there a way to prevent Struts 2 from instatiating all the actions defined in the action configuration file whe loading the application? I didn't know it did; I thought they were instantiated per-request. d. 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need more comprehensive AJAX Implementation Instructions
Thanks d! I hope I didn't come off as too much of a jerk. I really do appreciate your help. Scott On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- [EMAIL PROTECTED] wrote: the ajax'd bits *do* show up, but not lined up with all the other columns! At least now I can see the blasted fields You may be able to tweak the JSP you are returning to make it do the right thing, say with theme=simple etc. Heck, making the s:div.../ into s:div.../s:div might even work--with IE it's pretty much a crap shoot what will work. However, I don't see any other way of using the ajax support to populate some of the form fields??? That I'd have to think about; so far the only thing I've come up with in my head is to use Dojo a bit more manually. d. 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Scott [EMAIL PROTECTED]
Re: initialize java form bean
--- Lim Hock-Chai [EMAIL PROTECTED] wrote: is there a way to set a property of a java form bean from struts-config.xml? I try to use set-property and it is not working. Which version of Struts (I'm assuming Struts 1, but which version?) What did you try already? d. The fish are biting. Get more visitors on your site using Yahoo! Search Marketing. http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Help -Urgent
Hi, Sorry if i am disturbing you guys. Still i am facing the issue.i removed all extra characters using javscript, Now its allowing me to add/edit the information and stored in database as expected and forwarded to listing view jsp with entered value. But when i try to click the edit link for the particular record which is having 2 chars as a data, the edit link is getting disabled automatically. If that data length is less than 250 chars the edit link is working fine in the form. is there any specific for this edit link issue ? script language=JavaScript function checkChars(maxchars) { var fixChar= document.adjustReportingForm.cpDesc; if(fixChar.value.length maxchars) { fixChar.value=fixChar.value.substring(0,maxchars); } else return true; } /script *In Jsp:* html:textarea readonly=${isReadOnly} property=cpDesc onblur= checkChars(2)/ *Edit link in View Jsp :* html:link action=/adjustReporting.do?action=editviewType=${param.viewType }oldRprtCode=${current.rprtCode} name=paramsName scope=pageEdit/ html:link Please help me to resolve this . Thanks in advance, Satheesh.C On 3/14/07, Sachin [EMAIL PROTECTED] wrote: Guys, Here is my problem description . I have a text area field in my application which has to allow only 2 chars.User may copy paste some content in to textarea field. I used the below code to construct the textfield html:textarea readonly=${isReadOnly} property=ab2Desc / I am able to limit the maximum size of the textarea using following javascript function as dave suggested. function checkChar(maxchars) { if(document.ourform.box.value.length maxchars) { return false; } else return true; } Data also stored successfully in data base as entered. but problem is when i click to edit, not able to place the content in to text area back the form in the edit page is not opening. Can you suggest me how to resolve this? On 3/14/07, Sachin [EMAIL PROTECTED] wrote: Currently i am using Tag Library 1.1 Will latest version of *struts-html.tld* help ? On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Sachin [EMAIL PROTECTED] wrote: But i need to limit text area content. Do i need to use rows ? You'll probably need to use JavaScript; I don't know of a way to limit the number of characters in a textarea without it. d. Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Satheesh.C -- Satheesh.C -- Satheesh.C
Re: Need Help -Urgent
--- Sachin [EMAIL PROTECTED] wrote: But when i try to click the edit link for the particular record which is having 2 chars as a data, the edit link is getting disabled automatically. If that data length is less than 250 chars the edit link is working fine in the form. is there any specific for this edit link issue? html:link action=/adjustReporting.do?action=editviewType=${param.viewType }oldRprtCode=${current.rprtCode} name=paramsName scope=pageEdit/ html:link What does the generated link look like? If paramsName is a map containing all the form data and it's trying to put up to 2 characters into a URL you are going to have a problem. d. Food fight? Enjoy some healthy debate in the Yahoo! Answers Food Drink QA. http://answers.yahoo.com/dir/?link=listsid=396545367 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.0.6 portlets
Thank you, Any documentation around on this topic, Struts 2.0.6 portlets development.? (best practices etc). And things to be aware of? I would like to know things like for e.g? If I want a session variable should I put it to the HttpSession or Portlet session. What we really want is forget the application as a portlet and leverage the existing Struts Application development knowledge and at the same time be aware of the limitations. Let us know what are the AJAX limitations on the struts 2.0.6 portlets Thanks. --- Nils-Helge Garli [EMAIL PROTECTED] wrote: A couple of things you should be aware of is: - You cannot use result types that require full control of the response object (e.g. rendering PDFs, images, charts etc). To do that, you must dispatch a request to a servlet instead. - You should be aware of the lifecycle and the phases of a portlet, and how they apply to links and forms in a Struts 2 portlet to avoid weird state behaviour. - You should be aware of portlet modes, and how they are mapped to namespaces in the Struts 2 framework. - You can't create your own links. You should only create links using the form and url tags. - Ajax have some limitations. - You can't generate a complete HTML document, only what's between the body tags of what would have been a regular web app. Otherwise, you should be able to build it as a normal Struts 2 app. Nils-H On 3/14/07, tom tom [EMAIL PROTECTED] wrote: We were alble to successfully deploy the struts 2.06 portlet sample on our portal container which is uPortal. What we want to know is Can we write the portlet applications simillar to the Struts 2.0.6 web applications(not portlets). Does Struts 2.0.6 portlets got limitations compared to the normal struts 2.0.6 application. Are there any DOs and DONT'S Please us know before we beging the work. Thanks Never miss an email again! Yahoo! Toolbar alerts you the instant new Mail arrives. http://tools.search.yahoo.com/toolbar/features/mail/ - 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] Need Mail bonding? Go to the Yahoo! Mail QA for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=listsid=396546091 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]