Re: dojo 1.1 in struts 2.0.11 portlets
tom tom wrote: Hi, In order to leverage the full capabilities of dojo 1.1 (latest) with the latest stable struts version. What exactlyt the best practice. The things we concerned are as followes 1) Will there be a conflict in the different dojo versions in struts 2.0.11 and dojo 1.1 Yes, the Struts2 ajax-theme tags will conflict with Dojo 1.1. Don't use tue struts2 ajax-themed tags. 2) Will it impact any struts tags behaviours etc. Yes, definitely as the Struts2 ajax tags are for Dojo 0.4.x. If there is a better way to explore the new features of dojo pls do let us know, or any other best practice Yes, use Dojo 1.1 directly within your JSP. Don't attempt to use the Struts 2 ajax tags (dojo 0.4) at the same time as Dojo 1.1. Juse use the css/xhtml themed struts tags and dojo's own markup and widgets. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Email Notifications and Struts
Jay Bose wrote: If you want the Action to return immediately, and have the emails sent asynchronously, then JMS is a definite option. Another option is the JDK's Timer functionality (http://java.sun.com/j2se/1.5.0/docs/api/java/util/TimerTask.html). I recommend you use Java 5's concurrency package that supersedes TimerTask.: http://java.sun.com/j2se/1.5.0/docs/guide/concurrency/overview.html Setup a ThreadPoolExecutor with a Queue. When you need to send an email, submit it to the executor as a task to be scheduled later. When executed, the task looks up the mail session via jndi and sends the email. The settings for the pool and queue control how many can be scheduled and/or executed at once. Excluding the code that sends the email, that's only about 10 lines; but they need to be understood. Compared to JMS, the disadvantage of this approach is that you have to manage the threads yourself (eg. shut them down when the container goes down), are responsible for all aspects of reliable delivery, you can't scale to multiple servers and you need to manage how the mail Session is available to your threads. But it's sufficient for many applications. Hope that helps, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Email Notifications and Struts
If you want the Action to return immediately, and have the emails sent asynchronously, then JMS is a definite option. Another option is the JDK's Timer functionality (http://java.sun.com/j2se/1.5.0/docs/api/java/util/TimerTask.html). --- jwynacht <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a Struts action that, when invoked, needs to send email to about 50 > people. From what I've read in this forum it seems I should use JMS for > this. Any suggestions on which route to take? I'm running Tomcat 5.5.20. Any > pointers? Is this overkill? Better solutions? > > Thanks, > > Jon > -- > View this message in context: > http://www.nabble.com/Email-Notifications-and-Struts-tp16992809p16992809.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts and OsGI
Spring MVC is taking a significantly different approach than Struts 2, as I understand it. Their OSGi support allows you to deploy a Spring MVC-based war into an OSGi container, while the Struts 2 plugin allows you to build part of your app as an OSGi bundle and deploy it in the embedded OSGi container. Therefore it goes like: Spring MVC: OSGi container -> Tomcat -> war -> Spring MVC -> user code Struts 2: App server -> war -> Struts 2 -> OSGi plugin with embedded container -> Struts 2 bundles The difference is that Struts 2 will allow you to deploy your war on any existing app server, whether it supports OSGi or not. This also means a smoother migration process as you can leave your traditional Actions and templates in WEB-INF/lib, but deploy new Actions as bundles. Don On Thu, May 1, 2008 at 2:33 AM, Frans Thamura <[EMAIL PROTECTED]> wrote: > there are several topic about OSGI > > will S2 or S3 have osgi support > > which now i can see SpringMVC support it > > F > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Email Notifications and Struts
Hi, I have a Struts action that, when invoked, needs to send email to about 50 people. From what I've read in this forum it seems I should use JMS for this. Any suggestions on which route to take? I'm running Tomcat 5.5.20. Any pointers? Is this overkill? Better solutions? Thanks, Jon -- View this message in context: http://www.nabble.com/Email-Notifications-and-Struts-tp16992809p16992809.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionValidatorManagerFactory
While I used WebWork-2, and the XWork associated with it, I was able to programmatically retrieve action validation using the ActionValidatorManagerFactory. Now, it seems this class was removed. Any suggestions on how to programmatically get a ValidatorFactory instance? Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dojo 1.1 in struts 2.0.11 portlets
Hi, In order to leverage the full capabilities of dojo 1.1 (latest) with the latest stable struts version. What exactlyt the best practice. The things we concerned are as followes 1) Will there be a conflict in the different dojo versions in struts 2.0.11 and dojo 1.1 2) Will it impact any struts tags behaviours etc. If there is a better way to explore the new features of dojo pls do let us know, or any other best practice Thanks Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts and OsGI
On Wed, Apr 30, 2008 at 11:45 PM, Musachy Barroso <[EMAIL PROTECTED]> wrote: > There is a plugin that provides OSGi support: > > http://cwiki.apache.org/S2PLUGINS/osgi-plugin.html > i just thinking about running Struts2 on Equinox. f
Re: java.lang.InstantiationException: org.apache.struts.action.ActionForm
--- Sandy143 <[EMAIL PROTECTED]> wrote: > Let me be clear then ... > > I am trying to migrate from struts1.2 to struts2. So you're using the S1 Plugin, correct? Do you understand you will have to re-write all your JSPs to use Struts 2 tags? > LoginActionForm is extending ValidatorActionForm. I defined an interceptor > for it in struts.xml. Validation is form based. You need to send a text-format message (not HTML) with your configuration file or use a service like pastebin.com, as I said before. The latter is preferable; it's nicely highlighted and you can paste all of the relevant code and configs. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.InstantiationException: org.apache.struts.action.ActionForm
Let me be clear then ... I am trying to migrate from struts1.2 to struts2. I did all the required configuration. I could get the login page. LoginActionForm is extending ValidatorActionForm. I defined an interceptor for it in struts.xml. Validation is form based. BUT when I enter username and password and click submit... it throws me this error : [Servlet Error]-[org.apache.struts.action.ActionForm]: java.lang.InstantiationException: org.apache.struts.action.ActionForm at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1263) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:154) . I have the required jars Please let me know how I can take care about the validations during migration. Thanks, -- View this message in context: http://www.nabble.com/java.lang.InstantiationException%3A-org.apache.struts.action.ActionForm-tp16986858p16992734.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pagination in Struts2
I want the results in google format.Any help would be appreciated. Thanks, Aarthy balart wrote: > > Hi Aarthy, > > you can use the displaytag to implement the pagination in struts2. > > kindly tell that, Pagination as in Google? how, you want the page no in > google format or result in google format. > > Regards,' > Bala > > Jaarthy wrote: >> >> Hi, >> >> How to implement pagination as in Google in Struts2?Any Help would be >> appreciated. >> >> Thanks, >> Aarthy >> > > -- View this message in context: http://www.nabble.com/Pagination-in-Struts2-tp15619264p16991738.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best way to access Session with regards to cluster
> The latter assuming you are implementing > StrutsStatics in the interceptor. or using Java 5's static imports :-) Brad Cupit Louisiana State University - UIS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.InstantiationException: org.apache.struts.action.ActionForm
--- Sandy143 <[EMAIL PROTECTED]> wrote: > Now I am migrating from struts1 to struts2. What were you doing before? Please note: your configuration files aren't getting to everybody properly (me, at least), so it's even more difficult to help. Consider configuring your email client to send text-only messages to the list or using a service such as pastebin.com. Thanks :) > > class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"> > > com.XXX.XXX.HomeActionForm > > homeActionForm > I'm not sure what all I'm not seeing here, so I can't really comment. > > > > > > > > > I would assume that an interceptor-stack can have the same name as an interceptor-ref, but as a matter of style I wouldn't do it; because it's confusing. >class="org.apache.struts2.s1.Struts1Action"> > > com.XXX.XXX.homeAction > > /home.jsp > Again, not sure what all we're missing. Just to be perfectly clear: you are attempting to use the S1 Plugin, so that your existing S1 actions etc. will be configured only in the Struts *2* configuration file (there will be *no* Struts 1 configuration file)? Note: According to the S1 Plugin documentation [1] you *cannot* use the S1 tags in your JSP pages, meaning you are forcing yourself to JSP rewrites. (The other option is running the two apps more or less indepedently, but still in the same webapp: no JSP rewrites, no plugin issues.) Sometimes it's easier to introduce a new framework and any associated costs (training, learning curve, etc.) on a greenfield project rather than attempt to shoehorn it into an existing ecosystem. Dave [1] http://struts.apache.org/2.x/docs/struts-1-plugin.html > Laurie Harper wrote: > > > > Sandy143 wrote: > >> Hello Everyone : > >> > >> [Servlet Error]-[org.apache.struts.action.ActionForm]: > >> java.lang.InstantiationException: org.apache.struts.action.ActionForm > >> > >> I get this error when I try to migrate from Struts 1.2.8 to Struts2. > >> > >> I have validations to the form. I am using interceptors for the same. > >> > >> Please let me know ... if I am missing something or need to add > >> something. > > > > Your question is far too vague. ActionFrom is a Struts1 type; > > interceptors are a Struts2 concept; saying 'I have validations' or 'I am > > using interceptors' tells us nothing about how you have these configured. > > > > Since you seem to be struggling with integrating S1 and S2 in the same > > app, I suggest you go back to basics and create a minimal, empty app > > using S1 and S2 together and use it as a starting point to explore each > > issue you find in isolation. That way you can post complete but concise > > examples of code and configuration that demonstrate the problem. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best way to access Session with regards to cluster
ActionInvocation.getInvocationContext().getSession() or final HttpServletRequest request = (HttpServletRequest) context.get(HTTP_REQUEST); HttpSession session = request.getSession(); will do it in an interceptor. The latter assuming you are implementing StrutsStatics in the interceptor. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications > From: Brad A Cupit <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List > Date: Wed, 30 Apr 2008 11:40:49 -0500 > To: Struts Users Mailing List > Subject: RE: Best way to access Session with regards to cluster > >> but I still have some confusion about the proper way to do >> this so that my session values will be available and >> replicated properly in a cluster environment. > > The Struts 2 session maps are actually just wrappers around the real > underlying session. The methods that return (or set) a > HttpServletRequest should provide the actual http session. > > Basically, once you have setup replicated sessions in your app server, > Struts 2 should work with it automatically, no matter which method you > choose to get the session. > > I believe implementing SessionAware is the recommended approach, as it > doesn't tie your actions to the servlet api (making them more portable > and easier to test). > > Not sure about getting the session in an interceptor though... > > Brad Cupit > Louisiana State University - UIS > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege. This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.
RE: Redirect-Action type result warns of caught exception when passing param
> I'm of the opinion that an exception in my > console means something is amiss though... you've stumbled upon a little wart in the code. First things first, the exception is harmless and can be safely ignored. A more detailed explanation can be found in a comment within ObjectFactory.buildResult(..), posted below (slightly reformatted): // ognl exceptions could be thrown and be ok if, for example, the result // uses parameters in ways other than as properties for the result object. // For example, the redirect result from Struts 2 allows any parameters // to be set on the result, which it appends to the redirecting url. // These parameters wouldn't have a corresponding setter on the result // object, so an OGNL exception could be thrown. Still, this is a misuse // of exceptions, so we should look at improving it. Basically, parameters for the result are first set via setters on the Result object itself. If they don't exist, an exception is thrown and ignored. ServletRedirectResult and ServletActionRedirectResult both use params to mean "query string/url parameters" as opposed to properties on the Result object, so when using params on ServletRedirectResult or ServletActionRedirectResult, the exception is expected and acceptable. Brad Cupit Louisiana State University - UIS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2 Annotation Validation Problem
Hi folks, I've run into a problem with Struts 2 validation annotations. In short -- I have a VisitorFieldValidator on an action POJO named ProductDetailAction. I have RequiredFieldValidator and RequiredStringValidator on one field within the "visited" object. Now -- ProductDetailAction did not (originally) inherit from ActionSupport. I could see validation errors cropping up in my log, but my save() method was still executing, because , as I understand it, without ActionSupport (or ValidationAware) there was no way for Struts to redirect my action back to my input() method when it found a validation error. If I change the hierarchy so that ProductDetailAction DOES inherit, indirectly, from ActionSupport, I can't even get to my input() method -- my productDetail JSP doesn't render. Instead I get the following exception: java.lang.IllegalArgumentException: The input() is not defined in action class $Proxy99 at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:412) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88) (...) I get the same exception if I simply implement ValidationAware in the same way that ActionSupport does. I'm including relevant snippets of ProductDetailAction, Product, and struts.xml below. Does anyone have any insight as to why this might be happening? I'm stumped, and so are my coworkers. Thanks. Jim - ProductDetailAction.java - @Validation public class ProductDetailAction extends FormularyDetailAction { // note: FormularyDetailAction extends ActionSupport // snippery @Override @SkipValidation public String input() throws Exception { if(id==null || id < 1) { this.product = new Product(); } else { this.product = formularyBso.fetchProduct(this.id); } return Action.INPUT; } @VisitorFieldValidator(message="") public Product getProduct() { return product; } // snippery } - Product.java - @Entity @Table(name="myrespironics.p_product_versions") @Validation public class Product extends FormularyProduct { //snip @RequiredFieldValidator(message="Please enter a value.") @RequiredStringValidator(message="Please enter a value.") public String getName() { return name; } //snip } - struts.xml - input,back,cancel input,back,cancel /error.jsp productList /WEB-INF/secure/formulary/productDetail.jsp subcategoryDetail true ${subcategoryId} -- Jim Kiley Technical Consultant | Summa [p] 412.258.3346 [m] 412.445.1729 http://www.summa-tech.com
Re: migration from struts 1 to 2
I guess there is some problem with upload: Please find it here http://struts.apache.org/dtds/struts-2.0.dtd";> com.xxx.LoginActionForm loginActionForm /org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation-rules.xml,/WEB-INF/validation.xml com.xxx.LoginAction /Login.jsp Sandy143 wrote: > > Hello ... > > I have started to migrate from S1 to S2 using the plugin link. > > I have a login page. I am able to start the app with no errors and see the > login page. > > The configuration I have done in struts.xml is being uploaded. > > When I enter username and password and click on submit I get this error: > > [4/30/08 13:47:08:151 CDT] 0023 WebAppE [Servlet > Error]-[org.apache.struts.action.ActionForm]: > java.lang.InstantiationException: org.apache.struts.action.ActionForm > at java.lang.Class.newInstanceImpl(Native Method) > at java.lang.Class.newInstance(Class.java:1263) > at > com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123) > at > com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:154) > at > com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143) > at > com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.resolveModel(ScopedModelDrivenInterceptor.java:93) > at > com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:122) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at > com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at > org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) > at > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) > at > org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) > at > com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190) > at > com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130) > at > com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87) > at > com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701) > at > com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646) > at > com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:628) > at > com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:145) > at > com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:595) > at > com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111) > at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129) > at > com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238) > at > com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811) > at > com.ibm.ws.wswebcontainer.WebContainer.handleR
Re: migration from struts 1 to 2
Hello ... I have started to migrate from S1 to S2 using the plugin link. I have a login page. I am able to start the app with no errors and see the login page. The configuration I have done in struts.xml is being uploaded. When I enter username and password and click on submit I get this error: [4/30/08 13:47:08:151 CDT] 0023 WebAppE [Servlet Error]-[org.apache.struts.action.ActionForm]: java.lang.InstantiationException: org.apache.struts.action.ActionForm at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1263) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:154) at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.resolveModel(ScopedModelDrivenInterceptor.java:93) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:122) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130) at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646) at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:628) at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:145) at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:595) at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811) at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213) at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510) http://www.nabble.com/file/p16989415/struts.txt struts.txt -- View this message in context: http://www.nabble.com/migration-from-struts-1-to-2-tp16819256p16989415.html Sent from the Struts - User mailing list archive at Nabble.com. ---
Re: java.lang.InstantiationException: org.apache.struts.action.ActionForm
Sorry ... This error is produced when I enter something in jsp and click on a button ... Thanks, Sandy Sandy143 wrote: > > Hi, > > Now I am migrating from struts1 to struts2. > > In struts1 I have a homeAction which extends dispatchAction and it uses > homeActionForm. > > I have configured it this way in struts.xml: > > > > class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"> > > com.XXX.XXX.HomeActionForm > > homeActionForm > > > class="org.apache.struts2.s1.ActionFormValidationInterceptor"> > > > > /org/apache/struts/validator/validator-rules.xml, > /WEB-INF/validation-rules.xml, /WEB-INF/Validation.xml > > > > > > > > > > > > > > >class="org.apache.struts2.s1.Struts1Action"> > > com.XXX.XXX.homeAction > > /home.jsp > > > > > > Laurie Harper wrote: >> >> Sandy143 wrote: >>> Hello Everyone : >>> >>> [Servlet Error]-[org.apache.struts.action.ActionForm]: >>> java.lang.InstantiationException: org.apache.struts.action.ActionForm >>> >>> I get this error when I try to migrate from Struts 1.2.8 to Struts2. >>> >>> I have validations to the form. I am using interceptors for the same. >>> >>> Please let me know ... if I am missing something or need to add >>> something. >> >> Your question is far too vague. ActionFrom is a Struts1 type; >> interceptors are a Struts2 concept; saying 'I have validations' or 'I am >> using interceptors' tells us nothing about how you have these configured. >> >> Since you seem to be struggling with integrating S1 and S2 in the same >> app, I suggest you go back to basics and create a minimal, empty app >> using S1 and S2 together and use it as a starting point to explore each >> issue you find in isolation. That way you can post complete but concise >> examples of code and configuration that demonstrate the problem. >> >> L. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/java.lang.InstantiationException%3A-org.apache.struts.action.ActionForm-tp16986858p16989209.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.InstantiationException: org.apache.struts.action.ActionForm
Hi, Now I am migrating from struts1 to struts2. In struts1 I have a homeAction which extends dispatchAction and it uses homeActionForm. I have configured it this way in struts.xml: com.XXX.XXX.HomeActionForm homeActionForm /org/apache/struts/validator/validator-rules.xml, /WEB-INF/validation-rules.xml, /WEB-INF/Validation.xml com.XXX.XXX.homeAction /home.jsp Laurie Harper wrote: > > Sandy143 wrote: >> Hello Everyone : >> >> [Servlet Error]-[org.apache.struts.action.ActionForm]: >> java.lang.InstantiationException: org.apache.struts.action.ActionForm >> >> I get this error when I try to migrate from Struts 1.2.8 to Struts2. >> >> I have validations to the form. I am using interceptors for the same. >> >> Please let me know ... if I am missing something or need to add >> something. > > Your question is far too vague. ActionFrom is a Struts1 type; > interceptors are a Struts2 concept; saying 'I have validations' or 'I am > using interceptors' tells us nothing about how you have these configured. > > Since you seem to be struggling with integrating S1 and S2 in the same > app, I suggest you go back to basics and create a minimal, empty app > using S1 and S2 together and use it as a starting point to explore each > issue you find in isolation. That way you can post complete but concise > examples of code and configuration that demonstrate the problem. > > L. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/java.lang.InstantiationException%3A-org.apache.struts.action.ActionForm-tp16986858p16988637.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts.xml (struts-default) and meaning of <%@ taglib prefix="s" uri="/struts-tags" %>
Vinay Nagrik wrote: [...] <%@ taglib prefix="s" uri="/struts-tags" %> What is the meaning of prefix and uri="/struts-tags" % and if I can look at this file/page. [...] If you aren't familiar with Servelts, Java Server Pages and Java web application development in general, I strongly recommend starting with a good tutorial on those topics before getting into Struts. The Struts documentation generally assumes you understand these technologies, at least the basics. Similarly in struts.xml file I came across And once again where can I find the configuration of struts-defautl package. As Jim said, you can find that in the struts-defaults.xml in the Struts jar. It is also included in the main documentation [1] under Configuration => struts-default.xml [2]. L. [1] http://struts.apache.org/2.0.11/docs/guides.html [2] http://struts.apache.org/2.0.11/docs/guides.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.InstantiationException: org.apache.struts.action.ActionForm
Sandy143 wrote: Hello Everyone : [Servlet Error]-[org.apache.struts.action.ActionForm]: java.lang.InstantiationException: org.apache.struts.action.ActionForm I get this error when I try to migrate from Struts 1.2.8 to Struts2. I have validations to the form. I am using interceptors for the same. Please let me know ... if I am missing something or need to add something. Your question is far too vague. ActionFrom is a Struts1 type; interceptors are a Struts2 concept; saying 'I have validations' or 'I am using interceptors' tells us nothing about how you have these configured. Since you seem to be struggling with integrating S1 and S2 in the same app, I suggest you go back to basics and create a minimal, empty app using S1 and S2 together and use it as a starting point to explore each issue you find in isolation. That way you can post complete but concise examples of code and configuration that demonstrate the problem. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best way to access Session with regards to cluster
My vote goes to option 3. On Wed, Apr 30, 2008 at 7:24 PM, mojoRising <[EMAIL PROTECTED]> wrote: > > Let me try to narrow the scope a little then: Which of the following is the > better way to get the session in an Interceptor: > > > 1. ActionContext.getContext().getSession(); > 2. ActionContext.getSession(); > 3. invocation.getInvocationContext().getSession(); > 4. ServletActionContext.getRequest().getSession() > 5. ServletActionContext.getSession() > > -- > View this message in context: > http://www.nabble.com/Best-way-to-access-Session-with-regards-to-cluster-tp16985836p16987714.html > > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: once again: validate() not called
Insert it where in your struts.xml? By default it shouldn't be necessary, since 'save' is not in the default exclude list, so the answer is that it probably doesn't make sense to insert that. Without seeing your action code, mapping and other related configuration, it's really not possible to advise further. You just haven't provided enough information to guess what's going wrong. L. [EMAIL PROTECTED] wrote: Hello Laurie, thanks for your answer. I don't know if that will help me, but I'll try it out. Does it make sense to insert save in my struts.xml ? Will validate() then be called ? Volker Volker Karlmeier wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello struts freaks, i have quite an interesting problem again. In my struts.xml i have defined a method to call for my action (method="save") Every time execute() is called in my action class, the method validate() is executed before. The same action class used with struts.xml-parameter method="save" is also executed as expected, but validate is never called before the method save. I think the intention of the interfaces Validatable/ValidationAware is that validate() should be called before the action is executed. This should work using execute() as well as any other method configured in struts.xml with the parameter method="". Perhaps you didn't see my previous reply requesting more information: http://www.nabble.com/Re%3A-Validation-on-methods-p16886534.html ~ save does not work. That's because it's the workflow interceptor, not the validation interceptor, which calls validate(). L. - 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]
Redirect-Action type result warns of caught exception when passing param
My relevant mapped action look like: /jsp/admin/internalOrders/viewLineItem.jsp GetLineItem /admin/internalOrders true ${id} The 'GetLineItem' action works correctly when given an 'id' parameter. No exception is shown. When forwarded to by the 'UpdateLineItem' action, however, it displays a warning of a caught OgnlException. The parameter IS set and the proper behavior DOES happen. I'm of the opinion that an exception in my console means something is amiss though... I see the following: Apr 30, 2008 1:27:16 PM com.opensymphony.xwork2.util.OgnlUtil internalSetProperty WARNING: Caught OgnlException while setting property 'id' on type 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. ognl.NoSuchPropertyException: org.apache.struts2.dispatcher.ServletActionRedirectResult.id at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132) at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlV alueStack.java:68) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656) at ognl.ASTProperty.setValueBody(ASTProperty.java:101) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186) at com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360) at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76) at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49) at org.apache.struts2.impl.StrutsObjectFactory.buildResult(StrutsObjectFactory. java:95) at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionIn vocation.java:195) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionI nvocation.java:342) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:253) at bpf.SessionInterceptor.intercept(SessionInterceptor.java:15) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack .java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:221) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(D efaultWorkflowInterceptor.java:221) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method FilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack .java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:221) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(Validati onInterceptor.java:150) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.do Intercept(AnnotationValidationInterceptor.java:48) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method FilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack .java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:221) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(Con versionErrorInterceptor.java:123) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack .java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati on.java:221) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Parame tersInterceptor.java:167) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method FilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionI nvocation.java:223)
Re: Best way to access Session with regards to cluster
Let me try to narrow the scope a little then: Which of the following is the better way to get the session in an Interceptor: 1. ActionContext.getContext().getSession(); 2. ActionContext.getSession(); 3. invocation.getInvocationContext().getSession(); 4. ServletActionContext.getRequest().getSession() 5. ServletActionContext.getSession() -- View this message in context: http://www.nabble.com/Best-way-to-access-Session-with-regards-to-cluster-tp16985836p16987714.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling form data
First, I should point out that an 'input' result of type 'chain' should work here. What makes you think it doesn't? You wont get a browser redirect with chaining, though, so if you want that the MessageStoreInterceptor can help with preserving error messages. You can configure which methods skip validation with the excludeMethods parameter for the workflow and validation interceptors. Which methods are skipped by default varies with the different stacks defined in struts-defaults.xml, but assuming you're using defaultStack, it's input,back,cancel,browse. I'd suggest looking at the example applications to see how these issues are handled there for more ideas. L. Brian Hawkins wrote: I've run into a situation that I would like to get others opinions on. The problem is with handling a form. Here is the scenario: I have a form called form.jsp, this form needs data from the database so it has an associated FormAction.java class. The struts.xml file looks like this: /form.jsp The form then posts the data to another action called postForm and the struts.xml looks like this: ... Now for the issues. The first issue is field validation. I can't just add an input result that points to /form.jsp because the form needs the data out of FormAction. If I redirect to myForm I loose the field validation and the same goes for chaining (I know I can hack out the errors from the stack but that is ugly). Using the session to save error info on is also ugly. My preference is to use just one action class and have two methods. I would use execute() to get the data to view the form and postData() for posting the data. This way if postData found a field errors it could call execute and then return an input status. This solution still has problems in terms of interceptor validators. The validator needs to check for required fields only when the postData() method is called and not when execute is called and if there is an error when calling postData() it needs to call execute before returning an input status. I would like to make a validator that is smart enough to know when to validate fields and when not to based on the method being called but I cannot find a way to get what method on the action is being called. Is there a best practices on how to handle form data in an elegant manner? Is there a way to know what method is being called? So many questions and so few answers :( thanks Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best way to access Session with regards to cluster
Clustering is the responsibility of the application server. Struts 2 has no role in that. Just follow the general guidelines of clustering of web applications. Nils-H On Wed, Apr 30, 2008 at 6:40 PM, Brad A Cupit <[EMAIL PROTECTED]> wrote: > > but I still have some confusion about the proper way to do > > this so that my session values will be available and > > replicated properly in a cluster environment. > > The Struts 2 session maps are actually just wrappers around the real > underlying session. The methods that return (or set) a > HttpServletRequest should provide the actual http session. > > Basically, once you have setup replicated sessions in your app server, > Struts 2 should work with it automatically, no matter which method you > choose to get the session. > > I believe implementing SessionAware is the recommended approach, as it > doesn't tie your actions to the servlet api (making them more portable > and easier to test). > > Not sure about getting the session in an interceptor though... > > Brad Cupit > Louisiana State University - UIS > > > > - > 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: struts.xml (struts-default) and meaning of <%@ taglib prefix="s" uri="/struts-tags" %>
struts-default.xml can be found in the struts2-core jar (mine is struts2-core-2.0.11.jar but YMMV). struts-tags.tld is in the same jar, under META-INF. On Wed, Apr 30, 2008 at 12:51 PM, Vinay Nagrik <[EMAIL PROTECTED]> wrote: > Hello Group, > > I was building my first HelloWorld web application and it is up and > running, > but out of curiosity I > wish to find out the meaing of > > <%@ taglib prefix="s" uri="/struts-tags" %> > > What is the meaning of prefix and uri="/struts-tags" % and if I can look > at > this file/page. > > Similarly in struts.xml file I came across > > > > And once again where can I find the configuration of struts-defautl > package. > > I unpacked the xwork.jar in the WEB-INF classes directory, but did not > find > these two files. > > Can someone throw somelight on it. > > -- > Thanks > > Nagrik > -- Jim Kiley Technical Consultant | Summa [p] 412.258.3346 [m] 412.445.1729 http://www.summa-tech.com
struts.xml (struts-default) and meaning of <%@ taglib prefix="s" uri="/struts-tags" %>
Hello Group, I was building my first HelloWorld web application and it is up and running, but out of curiosity I wish to find out the meaing of <%@ taglib prefix="s" uri="/struts-tags" %> What is the meaning of prefix and uri="/struts-tags" % and if I can look at this file/page. Similarly in struts.xml file I came across And once again where can I find the configuration of struts-defautl package. I unpacked the xwork.jar in the WEB-INF classes directory, but did not find these two files. Can someone throw somelight on it. -- Thanks Nagrik
Re: Struts and OsGI
There is a plugin that provides OSGi support: http://cwiki.apache.org/S2PLUGINS/osgi-plugin.html regards musachy On Wed, Apr 30, 2008 at 12:33 PM, Frans Thamura <[EMAIL PROTECTED]> wrote: > there are several topic about OSGI > > will S2 or S3 have osgi support > > which now i can see SpringMVC support it > > F > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best way to access Session with regards to cluster
> but I still have some confusion about the proper way to do > this so that my session values will be available and > replicated properly in a cluster environment. The Struts 2 session maps are actually just wrappers around the real underlying session. The methods that return (or set) a HttpServletRequest should provide the actual http session. Basically, once you have setup replicated sessions in your app server, Struts 2 should work with it automatically, no matter which method you choose to get the session. I believe implementing SessionAware is the recommended approach, as it doesn't tie your actions to the servlet api (making them more portable and easier to test). Not sure about getting the session in an interceptor though... Brad Cupit Louisiana State University - UIS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java.lang.InstantiationException: org.apache.struts.action.ActionForm
Hello Everyone : [Servlet Error]-[org.apache.struts.action.ActionForm]: java.lang.InstantiationException: org.apache.struts.action.ActionForm I get this error when I try to migrate from Struts 1.2.8 to Struts2. I have validations to the form. I am using interceptors for the same. Please let me know ... if I am missing something or need to add something. Thanks -- View this message in context: http://www.nabble.com/java.lang.InstantiationException%3A-org.apache.struts.action.ActionForm-tp16986858p16986858.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts2 & displayTag how to use checkBox; Problem: translating the fieldValue
Thanks Oscar, I did check on the displayTag (since yesterday)so, I understand that I need to have something like this: and the checkBox: but: '%{myid[current]}' doesn't work. this works: '%{myid[0]}' '%{myid[1]}' '%{myid[2]}' so in other words I just don't know how to loop through myid. any combination doesnt work. I looked at the displayTag docs and they use jsp <% %> or $. when I use them I get literally the string meaning the return value is '$' any thoughts? wild_oscar wrote: > > %{#attr.current.id} is OGNL, you should be able to use it. > > What do you mean by "the actual string"? > > xianwinwin wrote: >> >> but EL is not allowed in Struts tags. >> when I use # or $ I get the actual string (not the value). >> m...any idea? >> >> >> >> wild_oscar wrote: >>> >>> They are attributes of the displaytag. >>> current is the id you give to each line in the table: >>> >>> >>> >>> Check the displaytag's documentation for more info. >>> >>> >>> xianwinwin wrote: thank you Wild Oscar, this is a good starting point for me. what is the attr and current here? %{#attr.current.entityId}? I have this on the action: private String[] userCheck; private Long[] myid; which is a list of Longs {23,62,67,88,125} those reflects all the entitieIDs The list is Entity: (entityID, city...) it looks like this: entityID, State [x] 23 Japan [x] 62 USA [ ] 67 China so my question is this, given the list how do I fix this line with your suggestion? >>> fieldValue='%{entityId}' /> * I also tried %{myid} nothing :-( THANK YOU!!! wild_oscar wrote: > > Have you tried fieldValue="%{#attr.current.entityId}? > > If you're using the displayTag, you could also have a check at an > issue I have: > > http://www.nabble.com/No-result-defined-for-action-and-result-input-with-checkbox-to16966533.html > http://www.nabble.com/No-result-defined-for-action-and-result-input-with-checkbox-to16966533.html > > > Which basically happens when the action is executed without any > checkbox selected. > > > xianwinwin wrote: >> >> Hi all, >> >> I have a table with a list of buyers. Each buyer has a checkBox that >> the user can click and decide if he wants to work with them. >> >> I'm using displayTag and this is my code: >> >> > fieldValue='${entityId}'/> >> >> I wonder why I don't get the *value/content* of the userCheck. >> Instead, I get ${entityId} (this really very string) >> >> any idea how to get the entityId (the number)? >> >> thank you! >> > > >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/struts2---displayTag-how-to-use-checkBox--Problem%3A-translating-the-fieldValue-tp16945993p16986800.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts and OsGI
there are several topic about OSGI will S2 or S3 have osgi support which now i can see SpringMVC support it F
Re: struts2 & displayTag how to use checkBox; Problem: translating the fieldValue
Oh, I'm sorry, I'm using Struts 2.0.9 and I have no problem with EL in tags. Haven't used 2.0.11. Be sure to post the answer when you find it! xianwinwin wrote: > > but EL is not allowed in Struts tags. > when I use # or $ I get the actual string (not the value). > m...any idea? > > > > wild_oscar wrote: >> >> They are attributes of the displaytag. >> current is the id you give to each line in the table: >> >> >> >> Check the displaytag's documentation for more info. >> >> >> xianwinwin wrote: >>> >>> thank you Wild Oscar, >>> this is a good starting point for me. >>> what is the attr and current here? >>> >>> %{#attr.current.entityId}? >>> >>> I have this on the action: >>> private String[] userCheck; >>> private Long[] myid; which is a list of Longs {23,62,67,88,125} >>> those reflects all the entitieIDs >>> >>> The list is Entity: (entityID, city...) >>> >>> it looks like this: >>> entityID, State >>> [x] 23 Japan >>> [x] 62 USA >>> [ ] 67 China >>> >>> so my question is this, given the list how do I fix this line with your >>> suggestion? >>> >>> >> fieldValue='%{entityId}' /> >>> >>> >>> * I also tried %{myid} nothing :-( >>> >>> THANK YOU!!! >>> >>> >>> >>> >>> wild_oscar wrote: Have you tried fieldValue="%{#attr.current.entityId}? If you're using the displayTag, you could also have a check at an issue I have: http://www.nabble.com/No-result-defined-for-action-and-result-input-with-checkbox-to16966533.html http://www.nabble.com/No-result-defined-for-action-and-result-input-with-checkbox-to16966533.html Which basically happens when the action is executed without any checkbox selected. xianwinwin wrote: > > Hi all, > > I have a table with a list of buyers. Each buyer has a checkBox that > the user can click and decide if he wants to work with them. > > I'm using displayTag and this is my code: > > fieldValue='${entityId}'/> > > I wonder why I don't get the *value/content* of the userCheck. > Instead, I get ${entityId} (this really very string) > > any idea how to get the entityId (the number)? > > thank you! > >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/struts2---displayTag-how-to-use-checkBox--Problem%3A-translating-the-fieldValue-tp16945993p16986405.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts2 & displayTag how to use checkBox; Problem: translating the fieldValue
but EL is not allowed in Struts tags. when I use # or $ I get the actual string (not the value). m...any idea? wild_oscar wrote: > > They are attributes of the displaytag. > current is the id you give to each line in the table: > > > > Check the displaytag's documentation for more info. > > > xianwinwin wrote: >> >> thank you Wild Oscar, >> this is a good starting point for me. >> what is the attr and current here? >> >> %{#attr.current.entityId}? >> >> I have this on the action: >> private String[] userCheck; >> private Long[] myid; which is a list of Longs {23,62,67,88,125} >> those reflects all the entitieIDs >> >> The list is Entity: (entityID, city...) >> >> it looks like this: >> entityID, State >> [x] 23 Japan >> [x] 62 USA >> [ ] 67 China >> >> so my question is this, given the list how do I fix this line with your >> suggestion? >> >> > fieldValue='%{entityId}' /> >> >> >> * I also tried %{myid} nothing :-( >> >> THANK YOU!!! >> >> >> >> >> wild_oscar wrote: >>> >>> Have you tried fieldValue="%{#attr.current.entityId}? >>> >>> If you're using the displayTag, you could also have a check at an issue >>> I have: >>> >>> http://www.nabble.com/No-result-defined-for-action-and-result-input-with-checkbox-to16966533.html >>> http://www.nabble.com/No-result-defined-for-action-and-result-input-with-checkbox-to16966533.html >>> >>> >>> Which basically happens when the action is executed without any checkbox >>> selected. >>> >>> >>> xianwinwin wrote: Hi all, I have a table with a list of buyers. Each buyer has a checkBox that the user can click and decide if he wants to work with them. I'm using displayTag and this is my code: >>> fieldValue='${entityId}'/> I wonder why I don't get the *value/content* of the userCheck. Instead, I get ${entityId} (this really very string) any idea how to get the entityId (the number)? thank you! >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/struts2---displayTag-how-to-use-checkBox--Problem%3A-translating-the-fieldValue-tp16945993p16986185.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Best way to access Session with regards to cluster
I have read much about how to access the session from actions and interceptors, but I still have some confusion about the proper way to do this so that my session values will be available and replicated properly in a cluster environment. Specifically, if a user is logged in and making requests, and then the server they are on goes down, I want their next request to fail-over to the next server and have the session identically available to the framework. I definitely need access to the session in two key places: In my authentication Interceptor, which checks if the userObject is in the session, and in my action classes. I understand that I must get access to the session differently in an interceptor as opposed to an action. I have seen many ways to do it, including the documentation at: http://struts.apache.org/2.x/docs/how-do-we-get-access-to-the-session.html. I am most in need of knowing which method is correct, cluster fail-over proof - for my interceptor and my action. Can anyone clear this up for me? These are the methods I have seen so far: 1. ActionContext.getContext().getSession(); 2. ActionContext.getSession(); 3. invocation.getInvocationContext().getSession(); 4. ServletActionContext.getRequest().getSession() 5. ServletActionContext.getSession() 6. Implement SessionAware, then use the sessionMap 7. Implement ServletRequestAware: the get the request object, then call request.getSession() -- View this message in context: http://www.nabble.com/Best-way-to-access-Session-with-regards-to-cluster-tp16985836p16985836.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts1 and Struts2 in the same app
Hi, How would I define a dispatch action in struts1 ... in struts.xml while migrating? newton.dave wrote: > > --- Sandy143 <[EMAIL PROTECTED]> wrote: >> With this we will not have ... struts1 config file right >> >> struts-config.xml would be completely modified to struts.xml. Am I on the >> right path? > > Are you trying to use the plugin, or are you trying to run in parallel? > > The S1 plugin wraps S1 actions inside S2 actions. There wouldn't be an S1 > configuration file. > > If you're not using the plugin, then you configure S1 and S2 completely > separately from each other. > > Dave > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Struts1-and-Struts2-in-the-same-app-tp16851031p16985158.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Retrieving param values from s:include
oscar perez wrote: Hi Jeromy, thanks for your quick reply. This was actually my workaround (i.e. to use s:set to put the values into the value stack). I wanted to use s:param since nesting the params into the s:include keep things tidy. PS: s:action is dangerous, s:include makes things difficult to refactor, dojo plugin is outdated, What can we safely use? :) :) he he, that's one of the issues that pure volunteer projects seem to face. People generally work on problems that affect them directly or on new things that interest them. Less attention goes into improve existing code, especially after the original authors move on or if it gets 80% of the job done. Everyone develops their own way of doing things and learn what to avoid. I've had similar frustrations. Struts 2 is very flexible but sometimes that results in too many options or partial solutions. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem sending values to dao class
There is no RegistrationAction Code here. I think it mostly something wrong in Action. just print the username & password value in the Action, it's no relation with DAO. the following is some sample & demo for download. Wish it's useful for U http://www.learntechnology.net luck, Mead [EMAIL PROTECTED] # On Wed, Apr 30, 2008 at 6:53 PM, ramk.fmk <[EMAIL PROTECTED]> wrote: > > Hi, > > I am trying to build a simple login application using struts, spring and > hibernate. I have created a registration page. > When I submit the registration information (i.e. username and password), > Null values are sent for the username and password to the Dao. > > Please see below the details > > 1. Registration.jsp > > > > > > > > > > 2. struts.xml > > /Registration.jsp > /RegistrationSuccess.jsp > > > > 3. Spring configuration > class="test.registration.struts.RegistrationAction"> > > > > > Any help regarding this is highly appriciated. > > Thanks in advance, > Ram > > -- > View this message in context: > http://www.nabble.com/problem-sending-values-to-dao-class-tp16980002p16980002.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Retrieving action names configured in struts.xml
read the struts.xml files, and phrase it On Wed, Apr 30, 2008 at 5:50 AM, Volker Karlmeier <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hello struts freaks, > > i would like to implement a rights management for my application. Therefore > I need to retrieve a list of actions configured in struts.xml. > Does anyone of you have an idea how to get this information ? > I can get a list of action classes using > > ~List actions = new ArrayList(); > ~Dispatcher disp = Dispatcher.getInstance (); > ~PackageConfig actionMap = > ((PackageConfig)disp.getConfigurationManager().getConfiguration().getPackageConfigs().get(" name of actions package>")); > ~Map actionConfigs = > actionMap.getAllActionConfigs(); > ~Iterator actionIterator = actionConfigs.keySet().iterator(); > ~while (actionIterator.hasNext()) { > ~String key = (String) actionIterator.next(); > ~ActionConfig config = actionConfigs.get(key); > ~String value= > config.getClassName().substring(config.getClassName().lastIndexOf(".")+1); > ~actions.add((String)value); > ~} > ~return actions; > > But this is not exactly what i want. What i need is the names of the > actions. > Any ideas ? > > thanks in advance > > ~ Volker > > > - -- > - --- > > Volker Karlmeier > Friedrich-Freye-Str. 61 > 45481 Mülheim/Ruhr > > Tel. : (+49) 208-7785675 > Mobil: (+49) 176-21056587 > Mail : [EMAIL PROTECTED] > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.7 (GNU/Linux) > > iD8DBQFIF5guaEMQXBIqssERAqKuAJsHTPohbwctJd7crzUETpX7GNAcewCfcPvN > ORF3KDd2juDK2i5B40gpA9w= > =WJ/y > -END PGP SIGNATURE- > > > - > 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: Struts 2 StrutsTypeConverter
Asleson, Ryan wrote: Hello, I am new to Struts 2, so please bear with me. I am looking at implementing a custom StrutsTypeConverter. I want it to be a "global" converter (no just specific to an Action). If I'm understanding it correctly, to implement this I create an xwork-conversion.properties file, and the format of this file is like this: com.domain.SomeCustomType=com.domain.SomeCustomTypeConverter where SomeCustomTypeConverter implements StrutsTypeConverter. First question: Is this correct? Yes. I added some new notes to that page today stating exactly that: http://struts.apache.org/2.x/docs/type-conversion.html Next question: How well does this handle subclassing? Here's what I mean: Suppose I have an abstract com.domain.SomeAbstractClass type that has many subclasses, and it's these subclasses that I actually need to convert. I want to have an entry like this in xwork-conversion.properties: com.domain.SomeAbstractClass=com.domain.SomeAbstractClassConverter Where SomeAbstractClassConverter is smart enough to convert any instance of SomeAbstractClass. For this to happen, the Class that is sent to the convertFromString method must be the class of the actual SomeAbstractClass subclass, not the SomeAbstractClass. Is this what happens at runtime? Is the class that is sent to convertFromString the actual class that is being converted, or the class that is listed in the .properties file? Will Struts2 use the SomeAbstractClass converter for a subclass of SomeAbstractClass even if it's not explicity defined in the .properties file? Thank you!! Yes. From the javadoc: * Looks for converter mappings for the specified class, traversing up its class hierarchy and interfaces and adding * any additional mappings it may find. Mappings lower in the hierarchy have priority over those higher in the * hierarcy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling form data
This should help you http://struts.apache.org/2.0.11.1/docs/how-do-we-repopulate-controls-when-validation-fails.html FAQ:How do we repopulate controls when validation fails . You can use the Preparable interface to load the data from the database. Validation does not (by default config) run on result of "input". Brian Hawkins-3 wrote: > > I've run into a situation that I would like to get others opinions on. > > The problem is with handling a form. Here is the scenario: I have a form > called form.jsp, this form needs data from the database so it has an > associated FormAction.java class. The struts.xml file looks like this: > > > /form.jsp > > > The form then posts the data to another action called postForm and the > struts.xml looks like this: > > > ... > > > Now for the issues. The first issue is field validation. I can't just > add > an input result that points to /form.jsp because the form needs the data > out > of FormAction. If I redirect to myForm I loose the field validation and > the > same goes for chaining (I know I can hack out the errors from the stack > but > that is ugly). Using the session to save error info on is also ugly. > > My preference is to use just one action class and have two methods. I > would > use execute() to get the data to view the form and postData() for posting > the data. This way if postData found a field errors it could call execute > and then return an input status. This solution still has problems in > terms > of interceptor validators. The validator needs to check for required > fields > only when the postData() method is called and not when execute is called > and > if there is an error when calling postData() it needs to call execute > before > returning an input status. I would like to make a validator that is smart > enough to know when to validate fields and when not to based on the method > being called but I cannot find a way to get what method on the action is > being called. > > Is there a best practices on how to handle form data in an elegant manner? > Is there a way to know what method is being called? > So many questions and so few answers :( > > thanks > Brian > > -- View this message in context: http://www.nabble.com/Handling-form-data-tp16968494p16982984.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts2] Exception starting filter (Connection Timed Out)
Exception starting filter action2 2008/04/29 00:59:30 | at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles from upstair Infomtion, I think it's the problem of filter named "action2" Xml files couldn't be found by the filter. try 2 heck the struts.xml files location. On 4/29/08, Pierre Thibaudeau <[EMAIL PROTECTED]> wrote: > Just moving from Struts1 to Struts2.0.11. > > No problem on Tomcat 6.0.16. > However, I get the following exception on startup with Tomcat 6.0.14. > > Does anyone know a way round this? > (I've included excerpts from web.xml further down.) > > *** > EXCEPTION TRACE: > *** > > 2008/04/29 00:59:30 | Apr 29, 2008 12:59:30 AM > org.apache.catalina.core.StandardContext filterStart > 2008/04/29 00:59:30 | SEVERE: Exception starting filter action2 > 2008/04/29 00:59:30 | [unknown location] > 2008/04/29 00:59:30 | at > com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:835) > 2008/04/29 00:59:30 | at > com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131) > 2008/04/29 00:59:30 | at > com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100) > 2008/04/29 00:59:30 | at > com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130) > 2008/04/29 00:59:30 | at > com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52) > 2008/04/29 00:59:30 | at > org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395) > 2008/04/29 00:59:30 | at > org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452) > 2008/04/29 00:59:30 | at > org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3696) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.StandardContext.start(StandardContext.java:4343) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.StandardHost.start(StandardHost.java:719) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.StandardService.start(StandardService.java:516) > 2008/04/29 00:59:30 | at > org.apache.catalina.core.StandardServer.start(StandardServer.java:710) > 2008/04/29 00:59:30 | at > org.apache.catalina.startup.Catalina.start(Catalina.java:566) > 2008/04/29 00:59:30 | at > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > 2008/04/29 00:59:30 | at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > 2008/04/29 00:59:30 | at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > 2008/04/29 00:59:30 | at java.lang.reflect.Method.invoke(Method.java:597) > 2008/04/29 00:59:30 | at > org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) > 2008/04/29 00:59:30 | at > org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) > 2008/04/29 00:59:30 | at > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > 2008/04/29 00:59:30 | at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > 2008/04/29 00:59:30 | at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > 2008/04/29 00:59:30 | at java.lang.reflect.Method.invoke(Method.java:597) > 2008/04/29 00:59:30 | at > org.tanukisoftware.wrapper.WrapperStartStopApp.run(WrapperStartStopApp.java:238) > 2008/04/29 00:59:30 | at java.lang.Thread.run(Thread.java:619) > 2008/04/29 00:59:30 | Caused by: Connection timed out - [unknown location] > 2008/04/29 00:59:30 | at > com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123) > 2008/04/29 00:59:30 | at > com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830) > 2008/04/29 00:59:30 | ... 31 more > 2008/04/29 00:59:30 | Caused by: java.net.ConnectException: Connection timed > out > 2008/04/29 00:59:30 | at java.net.PlainSocketImpl.socketConnect(Native > Method) > 2008/04/29 00:59:
Re: No result defined for action and result input with checkbox
I had the same (or similar) problem, it's caused be the CheckboxInterceptor not properly handling arrays of checkboxes when none are selected. I submitted a patch for this issue https://issues.apache.org/struts/browse/WW-2339 WW-2339 but I don't think anyone has looked at it yet. wild_oscar wrote: > > I have a problem that can be stripped down to the following: a jsp with a > form: > > >value="false"> > value="false"> > > > > > The action has a > > private int[] formReturned; > > with getters and setters. > > If any of the two checkboxes are checked, formReturned will be a vector > with the fieldValue(s) of the checked box(es). > > However, if neither checkboxes are checked, it will be null and Struts > will send me to the Input (which is not configured). > > I even tried to set: > public void prepare() throws Exception { > if(formReturned==null) > { > log.warn("Miguel - warning, null value!"); > formReturned = new int[2]; > > } > } > To see if it was a problem of null formReturned value, but it is not. > Struts will set formReturned = new int[2], but it'll go to the error > (before running the action) anyway. > > The full stacktrace is http://pastebin.com/m43225ede > http://pastebin.com/m43225ede . > > How can I prevent struts from trying to return to the input? What sort of > validation is it failing (I don't have any validation on any field)? > > Thank you very much for any help! > -- View this message in context: http://www.nabble.com/No-result-defined-for-action-and-result-input-with-checkbox-tp16966533p16982793.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2 StrutsTypeConverter
Hello, I am new to Struts 2, so please bear with me. I am looking at implementing a custom StrutsTypeConverter. I want it to be a "global" converter (no just specific to an Action). If I'm understanding it correctly, to implement this I create an xwork-conversion.properties file, and the format of this file is like this: com.domain.SomeCustomType=com.domain.SomeCustomTypeConverter where SomeCustomTypeConverter implements StrutsTypeConverter. First question: Is this correct? Next question: How well does this handle subclassing? Here's what I mean: Suppose I have an abstract com.domain.SomeAbstractClass type that has many subclasses, and it's these subclasses that I actually need to convert. I want to have an entry like this in xwork-conversion.properties: com.domain.SomeAbstractClass=com.domain.SomeAbstractClassConverter Where SomeAbstractClassConverter is smart enough to convert any instance of SomeAbstractClass. For this to happen, the Class that is sent to the convertFromString method must be the class of the actual SomeAbstractClass subclass, not the SomeAbstractClass. Is this what happens at runtime? Is the class that is sent to convertFromString the actual class that is being converted, or the class that is listed in the .properties file? Will Struts2 use the SomeAbstractClass converter for a subclass of SomeAbstractClass even if it's not explicity defined in the .properties file? Thank you!! -Ryan This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you.
Re: Retrieving param values from s:include
Hi Jeromy, thanks for your quick reply. This was actually my workaround (i.e. to use s:set to put the values into the value stack). I wanted to use s:param since nesting the params into the s:include keep things tidy. PS: s:action is dangerous, s:include makes things difficult to refactor, dojo plugin is outdated, What can we safely use? :) :) On Wed, Apr 30, 2008 at 3:45 PM, Jeromy Evans < [EMAIL PROTECTED]> wrote: > oscar perez wrote: > > > Hi all, > > I've been struggling trying to get working the s:include with the nested > > s:params but I have to give up. It really puzzles me.. > > My problem is that I have no idea on how to access the parameters from > > the > > included file. > > There is a fine example in the struts 2 documentation ( > > http://struts.apache.org/2.0.11/docs/include.html) that tells you how to > > use > > the s:incude component; however I found no references on how to retrieve > > the > > parameters from the included file. > > I can access to it via JSTL ,e.g. ${params.xxx} but no success on > > getting > > the values from the value stack or via #request or #parameters. > > I figure this note on struts 2 documentation has something to do with my > > problem..: > > > > *Note: Any additional params supplied to the included page are not > > accessible within the rendered page through the tag! > > > > *However, I really don't get the full meaning of this statement. Does > > this > > mean I cannot access the parameters via the s:property tag or I cannot > > access the parameters via any s tag at all? > > Thank you in advance, > > Oscar > > > > > > > Hi Oscar, > > I see that page isn't very clear. Struts2 creates an context for your > action that includes some of the common objects (request map, session map > etc) and the ValueStack. See the diagram at [1]. Your included page can > access the same context, so to pass parameters in put it into an appropriate > part of the context using the s:set or s:push tags. > > The params of include tag are for the invocation as if they were request > parameters, but they are not placed in the request map. > > [1] See the diagram here: http://struts.apache.org/2.x/docs/ognl.html > > I'll also mention I never use s:include because the paths break too easily > as when refactor the website. I always use Tiles2 instead > (tiles:insertDefinition) as its easier, safer and more flexible to manage > your page fragments. Struts2 also includes a plugin in case you want to > return tiles as results, but that's just optional [2] > > [2] http://struts.apache.org/2.x/docs/tiles-plugin.html > > regards, > Jeromy Evans > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Install Struts.
Thank you for your response; The Bean is attached and what I invoke from a JSP, the way. Any help, thank *** Bean *** /* * Created on 12-ago-2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package com.trapsatur.web.comun.view; import java.sql.Timestamp; import java.util.Vector; import Pgenerales.bean.Aeropuerto; import radiales.HotelesRecogida; /** * @author insa1 * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class BeanResultado { public Vector codigo = new Vector(); public Vector descripcion = new Vector(); public Vector folleto = new Vector(); public Vector subfolleto = new Vector(); public Vector paginaEnFolleto = new Vector(); public Vector descTramo = new Vector(); public Vector vtipo = new Vector(); public Vector vfechaTope = new Vector(); public Vector vHoteles = new Vector(); public void add(String cod,String desc){ codigo.add(cod); descripcion.add(desc); } public void add(String cod,String desc,HotelesRecogida hotel){ codigo.add(cod); descripcion.add(desc); vHoteles.add(hotel); } public void add(int posicion,String cod,String desc,HotelesRecogida hotel){ codigo.add(posicion,cod); descripcion.add(posicion,desc); vHoteles.add(posicion,hotel); } public void add(String cod,String desc,String prd,String prd2){ codigo.add(cod); descripcion.add(desc); folleto.add(prd); subfolleto.add(prd2); } public void add(String cod,String desc,String prd,String prd2,String pag,String descTrm){ codigo.add(cod); descripcion.add(desc); folleto.add(prd); subfolleto.add(prd2); paginaEnFolleto.add(pag); descTramo.add(descTrm); } public void add(String cod,String desc,String prd,String prd2,String pag, String descTrm,String tipo,Timestamp fechaTope){ codigo.add(cod); descripcion.add(desc); folleto.add(prd); subfolleto.add(prd2); paginaEnFolleto.add(pag); descTramo.add(descTrm); vtipo.add(tipo); vfechaTope.add(fechaTope); } public void add(Timestamp fecha,String desc){ codigo.add(fecha); descripcion.add(desc); } public void add(Aeropuerto apto,String desc){ codigo.add(apto); descripcion.add(desc); } public String getCodigo(int i){ return (String)codigo.get(i); } public Timestamp getFecha(int i){ return (Timestamp)codigo.get(i); } public Aeropuerto getApto(int i){ return (Aeropuerto)codigo.get(i); } public String getFolleto(int i){ return (String)folleto.get(i); } public String getSubfolleto(int i){ return (String)subfolleto.get(i); } public String getDescripcion(int i){ return (String)descripcion.get(i); } public Timestamp getFechaTope(int i){ return (Timestamp)vfechaTope.get(i); } public String getTipo(int i){ return (String)vtipo.get(i); } public int getNumElementos(){ return codigo.size(); } public Vector getCodigo(){ return codigo; } public Vector getDescripcion(){ return descripcion; } public BeanResultado(){ add("-1","-- Seleccione --"); } public void borraSeleccione(){ codigo.remove("-1"); descripcion.remove("-- Seleccione --"); } public BeanResultado(String sin){ } public BeanResultado(int codigo){ switch(codigo){ //Estado case 0: add("0","Visible"); add("1","No visible"); break; //Estado case 1: add("-1
Install Struts.
Thank you for your response; The Bean is attached and what I invoke from a JSP, the way. Any help, thank -Mensaje original- De: news [mailto:[EMAIL PROTECTED] En nombre de Laurie Harper Enviado el: martes, 29 de abril de 2008 18:28 Para: user@struts.apache.org Asunto: Re: Install Struts. What is the bean under name beanSerie? Does it have a getCodigo() method? Is it public? Is the class public? Without more info it's impossible to diagnose definitively. L. Christian Villamizar wrote: > Hello and good day; > > I'm trying to migrate an application that is made in Struts and hosted "Tomcat/4.1.31" and works well. > Now I want to operate in a Tomcat 5 or 6 but when I try to make the migration are errors such as: > > - This error only appears in JSP with forms, whether it helps. > > [ServletException in:/tiles/pages/circuitos/mostrarCircuito.jsp] No getter method available for property codigo for bean > under name beanSerie' javax.servlet.ServletException: No getter method available for property codigo for bean under name > beanSerie at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCont extImpl.java:841) at > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:774) at > org.apache.jsp.tiles.pages.circuitos.mostrarCircuito_jsp._jspService(mos trarCircuito_jsp.java:1057) at > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:331) at > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:269) at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:188) at > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:679) at > org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp atcher.java:584) at > org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat cher.java:497) at > org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja va:965) at > org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:6 00) at > org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137) at - 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: Struts2, DateTimePicker gives 1970
Hi Jim, Thanx for your reply. Desired options could be: 1. leave entered value -> validation is done on server side 2. remove entered value -> validation is done on server side It seems weird that suddenly the field has value "01.01.1970" eventhough it makes sense for developers but it doesn't for non-technical users. br Inkwon Jim Kiley wrote: > > What would be the desired behavior when a non-date value is entered? > 1/1/1970 corresponds to a 'zero' value for dates. This seems like a > sensible response. > -- > Jim Kiley > Technical Consultant | Summa > [p] 412.258.3346 [m] 412.445.1729 > http://www.summa-tech.com > > -- View this message in context: http://www.nabble.com/Struts2%2C-DateTimePicker-gives-1970-tp16981446p16981930.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Retrieving param values from s:include
oscar perez wrote: Hi all, I've been struggling trying to get working the s:include with the nested s:params but I have to give up. It really puzzles me.. My problem is that I have no idea on how to access the parameters from the included file. There is a fine example in the struts 2 documentation ( http://struts.apache.org/2.0.11/docs/include.html) that tells you how to use the s:incude component; however I found no references on how to retrieve the parameters from the included file. I can access to it via JSTL ,e.g. ${params.xxx} but no success on getting the values from the value stack or via #request or #parameters. I figure this note on struts 2 documentation has something to do with my problem..: *Note: Any additional params supplied to the included page are not accessible within the rendered page through the tag! *However, I really don't get the full meaning of this statement. Does this mean I cannot access the parameters via the s:property tag or I cannot access the parameters via any s tag at all? Thank you in advance, Oscar Hi Oscar, I see that page isn't very clear. Struts2 creates an context for your action that includes some of the common objects (request map, session map etc) and the ValueStack. See the diagram at [1]. Your included page can access the same context, so to pass parameters in put it into an appropriate part of the context using the s:set or s:push tags. The params of include tag are for the invocation as if they were request parameters, but they are not placed in the request map. [1] See the diagram here: http://struts.apache.org/2.x/docs/ognl.html I'll also mention I never use s:include because the paths break too easily as when refactor the website. I always use Tiles2 instead (tiles:insertDefinition) as its easier, safer and more flexible to manage your page fragments. Struts2 also includes a plugin in case you want to return tiles as results, but that's just optional [2] [2] http://struts.apache.org/2.x/docs/tiles-plugin.html regards, Jeromy Evans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2, DateTimePicker gives 1970
What would be the desired behavior when a non-date value is entered? 1/1/1970 corresponds to a 'zero' value for dates. This seems like a sensible response. On Wed, Apr 30, 2008 at 8:36 AM, Inkwon Hwang <[EMAIL PROTECTED]> wrote: > > Environment > Java5 > Jboss 4.0.5 and WAS 6.1 Express > Struts 2.1.1 > Tiles 2.0.5 > > Code > added > > and > > > Issue > When I insert not-valid date value (i.e. "aaa") and set focus to other > textfield, I get "01.01.1970" to the textfield. > I have read about DateTimePicker issues from Struts2 issue tracker Jira > (https://issues.apache.org/struts/browse/WW-1997) and probably this is > known > issue. > > Questions > Could some tell me, when this will be fixed? > If not, do you know any work around for example there would be no value if > input is invalid? > > Example > my input > http://www.nabble.com/file/p16981446/input_DTPicker.png > > my result > http://www.nabble.com/file/p16981446/value_DTPicker.png > > -- > View this message in context: > http://www.nabble.com/Struts2%2C-DateTimePicker-gives-1970-tp16981446p16981446.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Jim Kiley Technical Consultant | Summa [p] 412.258.3346 [m] 412.445.1729 http://www.summa-tech.com
Struts2, DateTimePicker gives 1970
Environment Java5 Jboss 4.0.5 and WAS 6.1 Express Struts 2.1.1 Tiles 2.0.5 Code added and Issue When I insert not-valid date value (i.e. "aaa") and set focus to other textfield, I get "01.01.1970" to the textfield. I have read about DateTimePicker issues from Struts2 issue tracker Jira (https://issues.apache.org/struts/browse/WW-1997) and probably this is known issue. Questions Could some tell me, when this will be fixed? If not, do you know any work around for example there would be no value if input is invalid? Example my input http://www.nabble.com/file/p16981446/input_DTPicker.png my result http://www.nabble.com/file/p16981446/value_DTPicker.png -- View this message in context: http://www.nabble.com/Struts2%2C-DateTimePicker-gives-1970-tp16981446p16981446.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: StrutsTypeConverter 2 level nested expression
Jakub Milkiewicz wrote: Hi In my case i also noticed that convertToString method is not called... So now i have 2 problems: 1) convertFromString is called but convertToString is never called for datePeriodFilterParameters.dateTo property 2) none of convertFromString and convertToString is called for datePeriodFilterParameters.cos.dateFrom property What do you think of it? Sorry, I have no further ideas on this one. It's time to put a breakpoint in XWorkConverter to see what it does when it gets to your property. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Retrieving param values from s:include
Hi all, I've been struggling trying to get working the s:include with the nested s:params but I have to give up. It really puzzles me.. My problem is that I have no idea on how to access the parameters from the included file. There is a fine example in the struts 2 documentation ( http://struts.apache.org/2.0.11/docs/include.html) that tells you how to use the s:incude component; however I found no references on how to retrieve the parameters from the included file. I can access to it via JSTL ,e.g. ${params.xxx} but no success on getting the values from the value stack or via #request or #parameters. I figure this note on struts 2 documentation has something to do with my problem..: *Note: Any additional params supplied to the included page are not accessible within the rendered page through the tag! *However, I really don't get the full meaning of this statement. Does this mean I cannot access the parameters via the s:property tag or I cannot access the parameters via any s tag at all? Thank you in advance, Oscar
Re: StrutsTypeConverter 2 level nested expression
Hi In my case i also noticed that convertToString method is not called... So now i have 2 problems: 1) convertFromString is called but convertToString is never called for datePeriodFilterParameters.dateTo property 2) none of convertFromString and convertToString is called for datePeriodFilterParameters.cos.dateFrom property What do you think of it? 2008/4/30 Jakub Milkiewicz <[EMAIL PROTECTED]>: > Hi > > I ve checked all required getters and setters million times but still > nothing. > If i just remove following line from Action-conversion.properites > datePeriodFilterParameters.cos.dateFrom=MyConverter > and change datatype of dateFrom property to String binding is succesfull > and inside execute method of my action i can see > datePeriodFilterParameters.cos.dateFrom to string value i typed in in > form. > So if binding works with given expression: > datePeriodFilterParameters.cos.dateFrom why converion mechanism do not work > with it? > > > > > 2008/4/30 Jeromy Evans <[EMAIL PROTECTED]>: > > Jakub Milkiewicz wrote: > > > > > Hi > > > I am quite new to Struts 2 and have problems with StrutsTypeConverter > > > I have > > > created my custom converter but i can see it is not fired when my > > > Action-conversion.properites contains more than 2 level property > > > expression. > > > Example: > > > datePeriodFilterParameters.dateTo=MyConverter (works as exptected) > > > datePeriodFilterParameters.cos.dateFrom=MyConverter (not working :( ) > > > Can anyone knows what is going on?Is there any limit on nested > > > property > > > expressions? > > > I searched forum and found some posts about createing > > > dto-conversion.properites ... > > > > > > miluch > > > > > > > > > > > > > There's no limit on the depth of the property names. Are you certain > > you've got all the necessary getters, setters and constructors on cos and > > datePeriodFilterParameters? > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > >
problem sending values to dao class
Hi, I am trying to build a simple login application using struts, spring and hibernate. I have created a registration page. When I submit the registration information (i.e. username and password), Null values are sent for the username and password to the Dao. Please see below the details 1. Registration.jsp 2. struts.xml /Registration.jsp /RegistrationSuccess.jsp 3. Spring configuration Any help regarding this is highly appriciated. Thanks in advance, Ram -- View this message in context: http://www.nabble.com/problem-sending-values-to-dao-class-tp16980002p16980002.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: once again: validate() not called
Hello Laurie, thanks for your answer. I don't know if that will help me, but I'll try it out. Does it make sense to insert save in my struts.xml ? Will validate() then be called ? Volker Volker Karlmeier wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hello struts freaks, > > i have quite an interesting problem again. In my struts.xml i have > defined a method to call for my action (method="save") > > Every time execute() is called in my action class, the method validate() > is executed before. > The same action class used with struts.xml-parameter method="save" is > also executed as expected, > but validate is never called before the method save. > > I think the intention of the interfaces Validatable/ValidationAware is > that validate() should be called before the > action is executed. This should work using execute() as well as any > other method configured in struts.xml with the > parameter method="". Perhaps you didn't see my previous reply requesting more information: http://www.nabble.com/Re%3A-Validation-on-methods-p16886534.html > > ~ save > > does not work. That's because it's the workflow interceptor, not the validation interceptor, which calls validate(). L. - 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]