Re: Passing Parameters to ActionForward from Action
I'm with you. I don't like using substitute html tags. They never take into account that tags now a days can have expando properties that become part of the html DOM. Bryan LaPlante -- Original Message --- From: Michael Jouravlev <[EMAIL PROTECTED]> To: Struts Developers List Sent: Thu, 16 Feb 2006 12:32:48 -0800 Subject: Re: Passing Parameters to ActionForward from Action > On 2/16/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > > On 2/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > You know what would be cool for the javawebparts implementation. Make a > > > tag > > > called snippets or something, have it work like MessageResource where you > > > could store things such onclick and other events and then be able to mark > > > up > > > your HTML with something that feels like where > > > the > > > property name would be replaced with your ajax call necessary to process > > > the > > > event. Is this your implementation? Do you have a discussion form for it? > > > > http://www.jroller.com/page/javadujour?entry=prep_tag_as_a_view > > Ugh, now when I read Brian's idea again, mine is not exactly the same. > And it is not even about Ajax, it is about large solid tags, like, say > tag. I would prefer to use a regular HTML tag, > substituting some attributes with dynamic data generated by taglib. I > will try it for my project first, if it works out, I will try to > refactor Struts taglib, maybe it will be interesting for some. > > Michael. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --- End of Original Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing Parameters to ActionForward from Action
You know what would be cool for the javawebparts implementation. Make a tag called snippets or something, have it work like MessageResource where you could store things such onclick and other events and then be able to mark up your HTML with something that feels like where the property name would be replaced with your ajax call necessary to process the event. Is this your implementation? Do you have a discussion form for it? Bryan LaPlante -- Original Message --- From: "Frank W. Zammetti" <[EMAIL PROTECTED]> To: "Struts Developers List" Cc: "Struts Developers List" Sent: Thu, 16 Feb 2006 15:05:46 -0500 (EST) Subject: Re: Passing Parameters to ActionForward from Action > Woo-hoo, dueling AJAX toolkits! ;) LOL ... > > http://javawebparts.sourceforge.net/javadocs/javawebparts/taglib/ajaxtags/package-summary.html > > Pretty darned easy too :) > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > AIM: fzammetti > Yahoo: fzammetti > MSN: [EMAIL PROTECTED] > > On Thu, February 16, 2006 3:01 pm, [EMAIL PROTECTED] said: > > Another shameless plug: > > > > The easiest to use ajax implementation on earth. No tag logic to learn, no > > new > > JavaScript syntax to add to your own, just strait access to your plain old > > Java objects. There is video training and documentation available at > > http://www.xoscript.org . I am working on an ActionClass that will allow > > you > > to integrate Struts into the next version of xoscript (xml scripting > > objects), > > but it is not ready yet. > > > > Bryan LaPlante > > > > -- Original Message --- > > From: "Frank W. Zammetti" <[EMAIL PROTECTED]> > > To: dev@struts.apache.org > > Cc: dev@struts.apache.org > > Sent: Thu, 16 Feb 2006 09:59:29 -0500 (EST) > > Subject: Re: Passing Parameters to ActionForward from Action > > > >> Shameless self-promotion: > >> > >> http://www.omnytex.com/articles > >> > >> :) > >> > >> -- > >> Frank W. Zammetti > >> Founder and Chief Software Architect > >> Omnytex Technologies > >> http://www.omnytex.com > >> AIM: fzammetti > >> Yahoo: fzammetti > >> MSN: [EMAIL PROTECTED] > >> > >> On Thu, February 16, 2006 8:37 am, shiiva said: > >> > Bryan, > >> > > >> > I am totaly new to ajax. can u suggest me any get started kind of > >> > tutorial. > >> > > >> > Thanks, > >> > Siva > >> > --------- > >> > Posted via Jive Forums > >> > > > http://forums.opensymphony.com/thread.jspa?threadID=18280&messageID=36339#36339 > >> > > >> > > >> > ----- > >> > 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] > > --- End of Original Message --- > > > > > > - > > 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] --- End of Original Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing Parameters to ActionForward from Action
Another shameless plug: The easiest to use ajax implementation on earth. No tag logic to learn, no new JavaScript syntax to add to your own, just strait access to your plain old Java objects. There is video training and documentation available at http://www.xoscript.org . I am working on an ActionClass that will allow you to integrate Struts into the next version of xoscript (xml scripting objects), but it is not ready yet. Bryan LaPlante -- Original Message --- From: "Frank W. Zammetti" <[EMAIL PROTECTED]> To: dev@struts.apache.org Cc: dev@struts.apache.org Sent: Thu, 16 Feb 2006 09:59:29 -0500 (EST) Subject: Re: Passing Parameters to ActionForward from Action > Shameless self-promotion: > > http://www.omnytex.com/articles > > :) > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > AIM: fzammetti > Yahoo: fzammetti > MSN: [EMAIL PROTECTED] > > On Thu, February 16, 2006 8:37 am, shiiva said: > > Bryan, > > > > I am totaly new to ajax. can u suggest me any get started kind of > > tutorial. > > > > Thanks, > > Siva > > - > > Posted via Jive Forums > > http://forums.opensymphony.com/thread.jspa?threadID=18280&messageID=36339#36339 > > > > > > ----- > > 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] --- End of Original Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
is this the right place to ask this kind of question
Hi, I have a question about what happens to the request body when using an action form versus not using an action form. I am trying to read some xml from the request and when I associate a form with my action, I get an Unterminated string constant message from the Marshaller that I am using. Is the request reader somehow altered when using a form? Bryan LaPlante - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing Parameters to ActionForward from Action
The easiest way to pass param's to other actions is to give the action a name in struts-config and set it equal to a class that extends ActionFrom. To clarify what I am saying, build a class that extends ActionFrom, Declare it in struts config like so... Then in your action use the form name as the action name attribute like so.. In the action class where you will forward from, set your data on the form and return the forward. When the myaction action runs it will have access to that form and it's data. The form is also accessible through the struts tags in your jsp page. Here is the tag ref for that. http://struts.apache.org/struts-taglib/tagreference-struts-html.html Bryan LaPlante -- Original Message --- From: shiiva <[EMAIL PROTECTED]> To: dev@struts.apache.org Sent: Tue, 14 Feb 2006 00:21:18 CST Subject: Passing Parameters to ActionForward from Action > Hi, > > Can anyone please describe me how to pass parameters from an Action to corresponding ActionForward. > > Basically, I am having only the jsp name in forward in struts-config.xml. But, when action is processed, I want to send some parameters to the corresponding actionforward. > > Can some be help me in explaining how it can be achieved. > > Thanks, > Shiiva > - > Posted via Jive Forums > http://forums.opensymphony.com/thread.jspa?threadID=18280&messageID=35715#35715 > > ----- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --- End of Original Message --- ----- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: include result of another action in current action
if(o instanceof ActionForward){ RequestDispatcher rd = servlet.getServletContext(). getRequestDispatcher(((ActionForward) o).getPath()); HttpMetaRequestWraper req = metaData.getRequest(); HttpMetaResponseWraper res = metaData.getResponse(); rd.include(req,res); o = res.toString(); } ProxyObjectFactory.writeProxyObject(response.getWriter(), o); metaData = null; } catch (Exception e) { try { /* * In the event that an exception is thrown, the Throwable * is wrapped in a ProxyObject and writen back to the * browser. */ ProxyObjectFactory.writeProxyObject(response.getWriter(), e); if (log.isDebugEnabled()) { log.debug(e); } } catch (Exception e1) { if (log.isDebugEnabled()) { log.debug(e1); } } }finally{ XOServiceFactory.destroy(); } return forward; } } Bryan LaPlante ------ Original Message --- From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: "Struts Developers List" Sent: Thu, 2 Feb 2006 20:04:37 -0500 Subject: include result of another action in current action > Is it possible to include the result of another action from within your > executing action. Next question, can I control the request and response used > in the included action by passing wrappers to it? > > Bryan LaPlante > > ----- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --- End of Original Message --- ----- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
include result of another action in current action
Is it possible to include the result of another action from within your executing action. Next question, can I control the request and response used in the included action by passing wrappers to it? Bryan LaPlante - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ThrowableActionErrors
While sitting here talking with Frank Zammetti, I have been working in a struts app where the coders before me have used multiple try/catch blocks to handle the forwarding of actions. They used one generic exception page as a catch all. In two of the actions I need to return to the original page for error processing. Here is a class to make it more convenient to deal with the situation above. MyActionErrors extends ThrowableActionErrors{ MyActionErrors(ActionErrors e){ super(e); } } In your try block create your ActionErrors as normal and then if necessary throw them like so. try{ //some code here ActionErrors errors = new ActionErrors(); errors.add( ActionErrors.GLOBAL_ERROR, new ActionError("some.error")); throw new MyActionErrors(errors); }catch(MyActionErrors e){ //get your errors back out and save them. saveErrors(e.getActionErrors()); //you will also find a properties Hashtable for data you //want to carry forward. //do your forward stuff here } Here is the class if anyone would like to have it. /* * Created on Feb 1, 2006 * */ package org.apache.struts.action; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; /** * @author Bryan_LaPlante * * ThrowableActionErrors is intended to be extended for specific ActionError * types create by the coder to provide a convenient way of populating * ActionErrors for a specfic Exception. * */ public class ThrowableActionErrors extends Throwable { private ActionErrors errors = new ActionErrors(); private Hashtable properties = new Hashtable(); /** * */ public ThrowableActionErrors() { errors = new ActionErrors(); } /** * @param messages */ public ThrowableActionErrors(ActionErrors messages) { errors = new ActionErrors(messages); } /* (non-Javadoc) * @see org.apache.struts.action.ActionErrors#add(java.lang.String, org.apache.struts.action.ActionError) */ public void add(String property, ActionError error) { errors.add(property, error); } /** * @param message */ public ThrowableActionErrors(String message) { super(message); } /** * @param message * @param cause */ public ThrowableActionErrors(String message, Throwable cause) { super(message, cause); } /** * @param cause */ public ThrowableActionErrors(Throwable cause) { super(cause); } public ActionErrors getActionErrors(){ return errors; } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#add(org.apache.struts.action.ActionMessages) */ public void add(ActionMessages messages) { errors.add(messages); } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#add(java.lang.String, org.apache.struts.action.ActionMessage) */ public void add(String property, ActionMessage message) { errors.add(property, message); } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#clear() */ public void clear() { errors.clear(); } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#empty() */ public boolean empty() { return errors.empty(); } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#get() */ public Iterator get() { return errors.get(); } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#get(java.lang.String) */ public Iterator get(String property) { return errors.get(property); } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#isEmpty() */ public boolean isEmpty() { return errors.isEmpty(); } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#properties() */ public Iterator properties() { return errors.properties(); } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#size() */ public int size() { return errors.size(); } /* (non-Javadoc) * @see org.apache.struts.action.ActionMessages#size(java.lang.String) */ public int size(String property) { return errors.size(property); } public void addProperty(Object key, Object value){ properties.put(key,value); } public void setProperties(Map p){ properties.putAll(p); } public Object getProperty(Object key){ return properties.get(key); } } Bryan LaPlante - To unsubscribe, e-mail: [EMAIL PROT
Re: Help adding Struts to AJAX impl
the way my client side api would expect to see that data would be like so. Frank Zammetti $1,000,000,000,000.00 More than likely the user would simply return a lazy version of the accountHolders object in which case the would go on to describe the 's and so on as preparation for the next method call. My api is built on the concept that you are writing an application and not a web page, however using web pages as a struts application would be a really handy way of returning static html for forms and such. I'll think on that a while and see what I come up with. I appreciate the collaboration, you are an easy architect to understand. Bryan -- Original Message --- From: "Frank W. Zammetti" <[EMAIL PROTECTED]> To: "Struts Developers List" Cc: "Struts Developers List" Sent: Wed, 1 Feb 2006 15:43:57 -0500 (EST) Subject: Re: Help adding Struts to AJAX impl > On Wed, February 1, 2006 3:35 pm, [EMAIL PROTECTED] said: > > I would need to write an AJAXAction that could in turn be extended by the > > coder so that I could control the response back from the servlet. Ok I > > just > > thought of a gotcha for this approach. If the client is expecting a > > specific > > xml response I am not sure how I would allow the user to forward to other > > actions and still maintain control unless all actions were extended from > > AJAXAction and I really don't like that way that implies a re-write of an > > existing application. > > I would say that what is likely to be generating the data that forms your > XML response in a properly-architected application is not likely to be in > the Actions, and hence forwarding isn't a concern. > > As an example, and understand that I'm not familiar with your library so > I'm going to perhaps not a complete understanding... let's say I want the > response from the server to represent a list of account holders: > > > > Frank > Zammetti > $1,000,000,000,000.00 > > > > (Oh how I WISH!! LOL) > > Anyway... if things are written as is generally accepted as being best, > the data in there, which maybe comes from a database, is retrieved not > directly from the Action but from some business delegate. So, your > AJAXAction should not dispatch an incoming request to another Action that > just so happens to use that delegate, but it should instead call on the > business delegate directly. > > So, in my mind at least, a developer wouldn't have to extend AJAXAction > because only a single AJAXAction instance would be present in the app, and > it would be the target of all the incoming AJAX requests. Unless your > thinking is that the Action would be responsible for creating the XML, in > which case you might want to let the developer be in control of that, then > extending AJAXAction is probaly the right answer. In that case, I would > simply say that either (a) forwards are not allowed, which implies the XML > must be formed in the Action itself or (b) forwards to JSPs that render > the XML are all that are allowed (this is demonstrated in AjaxTags in Java > Web Parts by the way). > > It of course comes down to how your library works, and how you want it to > work. > > > Thoughts? > > Those above :) And that I'm getting hungry ;) > > > Bryan LaPlante > > Frank > > ----- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --- End of Original Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help adding Struts to AJAX impl
Using a custom action? Now that is a good idea. That would solve some problems on a couple of levels such as how to lightly couple the struts classes into mine such that a non-struts user would not be required to add the struts required jars to the classpath. Now just thinking out loud to take advantage of your knowledge while I have you. I could set the servleturl of my application tag shown here at the bottom of this url. http://www.xoscript.org/opencms/opencms/documentation/setupconfig.html I would need to write an AJAXAction that could in turn be extended by the coder so that I could control the response back from the servlet. Ok I just thought of a gotcha for this approach. If the client is expecting a specific xml response I am not sure how I would allow the user to forward to other actions and still maintain control unless all actions were extended from AJAXAction and I really don't like that way that implies a re-write of an existing application. Thoughts? Bryan LaPlante -- Original Message --- From: "Frank W. Zammetti" <[EMAIL PROTECTED]> To: "Struts Developers List" Cc: "Struts Developers List" Sent: Wed, 1 Feb 2006 14:46:34 -0500 (EST) Subject: Re: Help adding Struts to AJAX impl > Actually, that's another way to go, a Filter. However, I was actually > referring to the fact that Struts 1.3 uses a composable request processor > based around the CoR pattern. With that, you can modify the series of > steps (Commands) that get executed with each request. This is within the > context of ActionServlet though, so you get access to all the Struts > internals this way. It soundslike adding a Command or two to the > processing chain would allow you to do what you need. But, if you wanted > to support pre-1.3 as well (and I would think you would since 1.3 isn't > officially out yet) then you'd have to go the custom RP route (although, > there would be nothing to stop you from simply executing a chain from the > RP, so at least your Commands could theoretically be identical for both > versions). > > Question: is there any way to do what you require within an Action? I > just *very* briefly skimmed over the doc you referenced here, and it seems > like you might be able to get away with it. If you have a specific Action > that does what your servlet does, invokes the referenced class method and > all, would that suffice? That way you could avoid all the Struts > customization entirely. > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > AIM: fzammetti > Yahoo: fzammetti > MSN: [EMAIL PROTECTED] > > On Wed, February 1, 2006 2:35 pm, [EMAIL PROTECTED] said: > > Yes sir you are right on the money. So you are saying I should use a > > FilterChain to process calles to the ActionServlet and prepare the request > > per > > the needs of my ajax call before action servlet gets ahold of it. The only > > problem with that is that I have a specific xml struture explained here > > http://www.xoscript.org/opencms/opencms/documentation/howitworks.html that > > I > > need to rely on in the returned PrintWriter. I have a request and response > > wrapper that I can give to an RequestProcessor and offer it a dummy > > PrintWriter when it writes to response.getOut(). One I get the output back > > and > > can write it to the appropriate xml structure and hand it back to the > > client > > javascript that called the method. > > > > I guess I should ask if I am understanding your solution or am I off base. > > > > Bryan LaPlante > > > > -- Original Message --- > > From: "Frank W. Zammetti" <[EMAIL PROTECTED]> > > To: "Struts Developers List" > > Cc: "Struts Developers List" > > Sent: Wed, 1 Feb 2006 10:22:27 -0500 (EST) > > Subject: Re: Help adding Struts to AJAX impl > > > >> Hi Bryan, > >> > >> I'm not sure I'm clear on what your trying to do... it sounds like you > >> have a separate servlet running along side ActionServlet that receives > >> your AJAX requests, and this servlet you want to call Actions, is that > >> correct? > >> > >> If so, I would suggest perhaps a better approach is to modify the > >> request > >> processing chain (in 1.3) to recognize an AJAX request (perhaps some > >> specific parameter) and change the request accordingly. If you want to > >> support pre-1.3, your talking about a custom RequestProcessor... both of > >> these are done in my Struts Web Services project > >> (http://sourceforge.net/projects/strutsws).
Re: Help adding Struts to AJAX impl
Yes sir you are right on the money. So you are saying I should use a FilterChain to process calles to the ActionServlet and prepare the request per the needs of my ajax call before action servlet gets ahold of it. The only problem with that is that I have a specific xml struture explained here http://www.xoscript.org/opencms/opencms/documentation/howitworks.html that I need to rely on in the returned PrintWriter. I have a request and response wrapper that I can give to an RequestProcessor and offer it a dummy PrintWriter when it writes to response.getOut(). One I get the output back and can write it to the appropriate xml structure and hand it back to the client javascript that called the method. I guess I should ask if I am understanding your solution or am I off base. Bryan LaPlante -- Original Message --- From: "Frank W. Zammetti" <[EMAIL PROTECTED]> To: "Struts Developers List" Cc: "Struts Developers List" Sent: Wed, 1 Feb 2006 10:22:27 -0500 (EST) Subject: Re: Help adding Struts to AJAX impl > Hi Bryan, > > I'm not sure I'm clear on what your trying to do... it sounds like you > have a separate servlet running along side ActionServlet that receives > your AJAX requests, and this servlet you want to call Actions, is that > correct? > > If so, I would suggest perhaps a better approach is to modify the request > processing chain (in 1.3) to recognize an AJAX request (perhaps some > specific parameter) and change the request accordingly. If you want to > support pre-1.3, your talking about a custom RequestProcessor... both of > these are done in my Struts Web Services project > (http://sourceforge.net/projects/strutsws). > > Or am I off-base to begin with? :) > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > AIM: fzammetti > Yahoo: fzammetti > MSN: [EMAIL PROTECTED] > > On Wed, February 1, 2006 9:08 am, Bryan LaPlante said: > > I had a chance to look at this in more detail yesterday. It appears that I > > will need to write a class to load up all the resources the same way the > > init method in ActionServlet does. Am I in the right place to ask for help > > understanding the API? It has been roughly a week and no reply. > > > > - Original Message - > > From: <[EMAIL PROTECTED]> > > To: > > Sent: Friday, January 27, 2006 1:27 PM > > Subject: Help adding Struts to AJAX impl > > > > > >> Hello fellow developers, > >> > >> I am new to your list. I have enjoyed using Struts for about 3 years > >> now. > > I > >> have searched the dev archive concerning my current task and I am not > >> sure > > how > >> to word my query. I am coming up with a lot of results labeled as a > >> commit > > to > >> your code base. > >> > >> I have an AJAX implementation at http://www.xoscript.org/ and I want to > > build > >> support for Struts into the API. In a nutshell I need to find a factory > > class > >> in Struts that will allow me to obtain the current configuration so that > >> I > > can > >> allow my users to pass an appropriate ActionMapping at runtime. Below is > > the > >> basic layout of the process. For more details about how xoscript works > > visit > >> the getting started and how it works links from the site above. > >> > >> A UerDefinedClass calls a UerDefinedActionClass.execute passing request > > and > >> response obtained from the AJAX API. The user will also need to pass an > >> ActionMapping and an ActionForm to the execute method. I am trying to > >> find > > a > >> way to get to this line in ActionServlet but I can not violate the > >> getServletContext from one servlet to another. The over all concern is > > that I > >> am trying to keep my OutputStream from the response formatted in a > >> certain > > way > >> and I can not just forward the request to the ActionServlet. > >> > >> ModuleUtils.getInstance().selectModule(request, getServletContext()); > >>ModuleConfig config = getModuleConfig(request); > >> > >> Any help would be greatly appreciated. > >> > >> Bryan LaPlante > >> > >> > >> - > >> 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] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --- End of Original Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help adding Struts to AJAX impl
Hello fellow developers, I am new to your list. I have enjoyed using Struts for about 3 years now. I have searched the dev archive concerning my current task and I am not sure how to word my query. I am coming up with a lot of results labeled as a commit to your code base. I have an AJAX implementation at http://www.xoscript.org/ and I want to build support for Struts into the API. In a nutshell I need to find a factory class in Struts that will allow me to obtain the current configuration so that I can allow my users to pass an appropriate ActionMapping at runtime. Below is the basic layout of the process. For more details about how xoscript works visit the getting started and how it works links from the site above. A UerDefinedClass calls a UerDefinedActionClass.execute passing request and response obtained from the AJAX API. The user will also need to pass an ActionMapping and an ActionForm to the execute method. I am trying to find a way to get to this line in ActionServlet but I can not violate the getServletContext from one servlet to another. The over all concern is that I am trying to keep my OutputStream from the response formatted in a certain way and I can not just forward the request to the ActionServlet. ModuleUtils.getInstance().selectModule(request, getServletContext()); ModuleConfig config = getModuleConfig(request); Any help would be greatly appreciated. Bryan LaPlante - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DynaActionForm with a html:select multichoice
Hi all I try to use DynaActionForm with a html:select multichoice but in the Action I always get null.In struts-config I wrote as its property a String Array (String[]) but I get nul. Any ideas? Regards Libero ADSL: navighi gratis a 1.2 Mega, senza canone e costi di attivazione. Abbonati subito su http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator Plugin
> -Original Message- > From: Martin Cooper [mailto:[EMAIL PROTECTED] > > I agree that we should throw the exception. IMO, it should fail fast and > > loud at startup if you've misconfigured the validations. > > I know this change has been checked in already, but wanted to add my +1 > anyway. ;-) Thanks! > > -- > Martin Cooper > > > > > > David ----- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Fw: UrlValidator() takes options - but how?
> -Original Message- > From: Niall Pemberton [mailto:[EMAIL PROTECTED]> > I'll have a look a doing a patch. I'm probably being really stupid but how > do you mean group by powers of 2? You mean 1, 2, 4, 8, 16, 32, 64 etc. - Yes 1<<0 1<<1,1<<2, 1<<3,1<<4 but > how would it group? That's just my prefernce not a requirement. Maybe 1 <<(0-3) ie (1,2,4,8) for scheme errors 1 << (4-7) (16,32,64,128) for authority, etc... But since the validator stops at the first error in a URL/URI none of these errors could ever occur at the same time so reserving a unique bit for each isn't necessary. --------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL validation
The URLvalidator was actually designed to be a general URI validator. It's been a while since I used it but I believe it should be able to validate jdbc:oracle://localhost:3050/mydatabase ? I believe the scheme is optional. -Rob > -Original Message- > From: Richard Bywater [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 1, 2004 10:06 PM > To: 'Struts Developers List' > Subject: Re: URL validation > > If we're talking URLs aren't we looking at the wrong RFC? RFC1738 has > this section: > > 3.3. HTTP > >The HTTP URL scheme is used to designate Internet resources >accessible using HTTP (HyperText Transfer Protocol). > >The HTTP protocol is specified elsewhere. This specification only >describes the syntax of HTTP URLs. > >An HTTP URL takes the form: > > http://:/? > >where and are as described in Section 3.1. If : >is omitted, the port defaults to 80. No user name or password is >allowed. is an HTTP selector, and is a query >string. The is optional, as is the and its >preceding "?". If neither nor is present, the "/" >may also be omitted. > >Within the and components, "/", ";", "?" are >reserved. The "/" character may be used within HTTP to designate a >hierarchical structure. > > > It states that path is optional therefore it would appear to me that > http:///? is valid. > > If we're actually talking URIs my apologies :) > > Richard. > > Adam Hardy wrote: > > > > > I thought that a slash on the end of a web-address denoted that you > > were requesting the default resource at that URI. > > > > However I guess that is a very HTTP-centric point of view. > > > > So if the RFC leaves it open to interpretation, what does one do? > > Veer on the side of leniency? > > > > Adam > > > > > > On 04/01/2004 07:50 PM David Morris wrote: > > > >> Are you reading something into the spec? It seems like they are > >> referring to a part of the URL. If not, I am wondering why the RFC shows > >> examples in section E that do end in a slash. > >> > >> "In practice, URI are delimited in a variety of ways, but usually > >>within double-quotes "http://test.com/";, angle brackets > >><http://test.com/>, or just using whitespace > >> > >> http://test.com/ > >>These wrappers do not form part of the URI." > >> > >> David Morris > >> > > > > - > 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: Fw: UrlValidator() takes options - but how?
> I was thinking of openning a bugzilla and sticking a patch up - but I don't > want > to steal your thunder if you'd rather do it. I would encourage a bugzilla ticket, it sounds like there is almost agreement on the needed changes, and options. Before fileing do try to firm up those options. Since the commons validator already has the allow2slashes,noFragments and allowAllSchemes. These would be a good start. > > Niall > > > > > Adam > > > > On 04/01/2004 10:08 PM Niall Pemberton wrote: > > > Adam Hardy suggested "allow2slashes", "nofragments" and > "allowallschemes" > > > being either true/false > > > > > > I think rather than having "allowallschemes", have a "schemes" parameter > > > which can be either "all" (which sets the allow all schemes option) or a > > > comma delimited list of valid schemes. > > > > > > Alternatively you could have Adam's suggestion plus any that > starts > > > with "scheme" is taken to build an array of schemes. Something like: > > > > > > > > > allow2slashes > > > true > > > > > > nofragments > > > true > > > > > > allowallschemes > > > false > > > > > > scheme1 > > > http > > > > > > scheme2 > > > ftp > > > > > > scheme3 > > > telnet > > > > > > > > > > > > > > > Niall > > > > > > - Original Message - > > > From: "David Graham" <[EMAIL PROTECTED]> > > > To: "Struts Developers List" <[EMAIL PROTECTED]> > > > Sent: Thursday, April 01, 2004 8:17 PM > > > Subject: Re: Fw: UrlValidator() takes options - but how? > > > > > > > > > > > >>--- Niall Pemberton <[EMAIL PROTECTED]> wrote: > > >> > > >>>Sorry this went to the wrong list, but anyway > > >>> > > >>>Looking at CVS there is a validateUrl() method in the Struts > FieldChecks > > >>>class (added in version 1.15) - problem is it uses commons > > >>>GenericValidator > > >>>which has a static instance. > > >>> > > >>>What do you think about changing this to instantiate a UrlValidator if > > >>>any > > >>>configuration parameters have been enetered in validation.xml, > otherwise > > >>>use > > >>>the GenericValidator? > > >> > > >>Sounds ok to me but we need to define the variable names the method > > >>recognizes and will use in UrlValidator configuration. > > >> > > >>David > > > > -- > > struts 1.2 + tomcat 5.0.19 + java 1.4.2 > > Linux 2.4.20 Debian > > > > > > - > > 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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL validation
> -Original Message- > From: Adam Hardy [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 1, 2004 03:41 PM > To: 'Struts Developers List' > Subject: Re: URL validation > > On 03/15/2004 10:16 AM Adam Hardy wrote: > > On 03/13/2004 07:46 AM [EMAIL PROTECTED] wrote: > > > >>> From: Adam Hardy I provide URL validation on a page which saves links > >>> for > >>> users. > >>> > >>> I put together the latest build of commons-validator (1.1.2) and struts > >>> (1.2) to see what the URL validation is like. > >>> > >>> The class for server-side validation is in place, but the javascript > >>> doesn't exist. > >>> > >>> It works very strictly, too strictly for me. > >>> > >>> Most users will want to save links such as > >>> > >>> http://www.google.com > >>> http://jakarta.apache.org/ > >>> http://marc.theaimsgroup.com/?l=struts-user&m=105511005106573&w=2 > >> > >> > >> > >> > >> This is definately a bug and they should have passed, > >> I haven't run the unit tests against it in some time do they still > >> pass ? > >> My guess is that it might not be expecting the '/' after the domain > >> name. This would probably only require a small tweak > >> to the regular expression thats used. > >> > >> I would apply any patches that were submitted > > Just got around to looking at a glitch in UrlValidator and I've found > that the isValidPath() method explicitly fails when the path (after the > port number) is '/' - e.g. > > http://www.google.com:80/?action=view expected: but was: > > The code actually does the following: > > if (path.endsWith("/")) { > return false; > } > > Surely this should not be so? The way I read http://www.faqs.org/rfcs/rfc2396.html section 3.3 I don't believe the path segment can legally end with a '/'. Read the RFC and see what you think. So I don't believe http://www.google.com:80/?action=xyz strictly speaking is valid, should we optionally allow for it probably. http://www.google.com:80?action would be valid http://www.google.com:80/path?actionwould be valid > > > Adam > > > - > 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]