Static Access to MessageResources or Bundles?
Is there any way to statically access fields from resources defined in Struts? In other words, I would to be able to access terms stored in properties files without needing a ServletRequest. My application exists within a servlet container, and utilizes Struts. However, I have processes running that are independant of incoming requests. Any ideas? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Static Access to MessageResources or Bundles?
Is there any way to statically access fields from resources defined in Struts? Well, I have a solution. String bundle = "common" ; String key = "date" ; MessageResources.getMessageResources(bundle).getMessage(Locale.EN, key); This is very straightforward. So why does Struts prefer to store and access the resources through the ServletContext? Is this faster? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Referencing the Local DTD rather than the http:// one
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" Yours do not include the version number. If the ID above is used, the In this case, the URL specified for the DTD should be completely ignored. Fantastic. Thanks Joe. The following works. Lukas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Referencing the Local DTD rather than the http:// one
What I find particularly annoying about this problem is references to local Struts Configuration files work correctly, which in turn load the Tiles Definitions. /WEB-INF/struts-config.xml /WEB-INF/tiles-defs.xml /WEB-INF/dtd/(all here) An example of my Struts Config definition, that works correctly: Which loads Tiles definitions: Which will not parse correctly with any of the following: As Tim stated in his post, absolute path references work correctly. However, this becomes tedious when migrating lots of configuration files between local filesystems and production ones. Any help appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please HELP with HARD problem: STRUTS-tags VS Proxy, Weblogic loadbalancing, and BASE tag
Hi List, I'm badly stuck with a STRUTS web-app that runs fine on Tomcat, but refuses to bahave nicely in production, where a Netscape Proxy on port 80 maps to a Netscape Webserver on port 8080, which in turn, with Weblogic plugin, does loadbalancing to 2 Weblogic machines on port 7001. As I don't have a lot of STRUTS experience, I stuck closely to the struts-blank application and tuto, and used the struts-html tags as advertised, including the tag and the tag. Accessed through the proxy, the RequestUtils.getActionMappingURL() that (it appears) does the real work inside those tags produces wrong servername / port combinations (correct would be the Proxy's name on port 80). What compounds the problem is that the web-app is a frameset. Unusual, granted, but works just fine in Tomcat (inter-frame communication with event-model using javascript). The wrong resolution of leads to multiple user-sessions within the frameset (Bad Thing) (one session per frame). Without success, we've tried several strategies to get around the problem: - use or just the regular html tag, hard setting server to proper value -> still gets multiple sessions, also can't get the port right. - get rid of tag in all incarnations, only use relative links from / level, works just fine on tomcat but still fails in production, presumably because the tag still resolves wrong? .. could also be because I still use RequestUtils.getActionMappingURL() to get the URL for the frame src definitions in the frameset. I had trouble getting the frames any other way in the absence of the base tag. I'm now wondering if I can safely do completely without RequestUtils and use simple html instead of struts ?? Does the core functionality of Actions, ActionForms and mappings still work if I replace the struts tag with just ?? Or is there another way around this? Any pointers much appreciated ! Lukas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please HELP with HARD problem: STRUTS-tags VS Proxy, Weblogic loadbalancing, and BASE tag
Hi List, Sent this yesterday, but it seemed to not get through to the list. My apologies if it's come through already. : I'm badly stuck with a STRUTS web-app that runs fine on Tomcat, but refuses to bahave nicely in production, where a Netscape Proxy on port 80 maps to a Netscape Webserver on port 8080, which in turn, with Weblogic plugin, does loadbalancing to 2 Weblogic machines on port 7001. As I don't have a lot of STRUTS experience, I stuck closely to the struts-blank application and tuto, and used the struts-html tags as advertised, including the tag and the tag. Accessed through the proxy, the RequestUtils.getActionMappingURL() that (it appears) does the real work inside those tags produces wrong servername / port combinations (correct would be the Proxy's name on port 80). What compounds the problem is that the web-app is a frameset. Unusual, granted, but works just fine in Tomcat (inter-frame communication with event-model using javascript). The wrong resolution of leads to multiple user-sessions within the frameset (Bad Thing) (one session per frame). Without success, we've tried several strategies to get around the problem: - use or just the regular html tag, hard setting server to proper value -> still gets multiple sessions, also can't get the port right. - get rid of tag in all incarnations, only use relative links from / level, works just fine on tomcat but still fails in production, presumably because the tag still resolves wrong? .. could also be because I still use RequestUtils.getActionMappingURL() to get the URL for the frame src definitions in the frameset. I had trouble getting the frames any other way in the absence of the base tag. I'm now wondering if I can safely do completely without RequestUtils and use simple html instead of struts ?? Does the core functionality of Actions, ActionForms and mappings still work if I replace the struts tag with just ?? Or is there another way around this? Any pointers much appreciated ! Lukas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: initialize Collection for html-tags options tag - HOW?
An update: My attempt to forward from action to action failed. These are the mappings for the actions involved. I tried to replace with but somehow the MultiFindNameAction's execute method is apparently called with the ActionForm param set to null: "No getter method available for property layerId for bean under name null" This seems to indicate that that's not proper way to do initialization--which is OK, as it's the Action's job to handle user input, not to preprocess the Form bean. So, back to square one: what's the proper way to get init values from a Model object that's held in the session into an ActionForm? -- NEU : GMX Internet.FreeDSL Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/dsl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
initialize Collection for html-tags options tag - HOW?
Hi list I'm trying to use the options tag and am stuck with this problem: I hold all 'Model' information in a single model object in the HttpSession. Initialization for the Collection used by the , held in an ActionForm, must come from there (first time the view that uses that form is displayed). I'd have loved populate the Collection in the ActionForm, like so: if(this.getSearches() == null){ ArrayList al = new ArrayList(); Search[] ss = model.getSearches(); for( int i=0; ihttp://www.gmx.net/dsl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Maintaining form data across pages...
Ayoub, This was an issue that came across a little while ago, and I was surprised by the lack of existing solutions. What we did was to implement a little process engine wherein you could setup a single action (subclass of the process action) and setup within the action the steps (step1, step2, step3) etc. We then mapped inputs to the steps, so you would define a forward for each step which pointed to the view (jsp page) for that view. Another thing we did in our approach was to implement a pre-form mechanism which you can use to prepare information for each step view. I found the way struts deals (or doesn't) with view preparation a bit vague. Lukas -Original Message- From: Ayoub, Ashraf A [mailto:[EMAIL PROTECTED] Sent: Sunday, 16 May 2004 9:58 p.m. To: Struts Users Mailing List Subject: Maintaining form data across pages... Dears, I am trying to setup a series of jsp pages (requestForm, confrimation jsp). I set the scope of my requestForm to "session" as to maintain the data across the various jsps, but I get it as if reset is called, after the confirmation page submits. What is the best way to maintain the request data across several jsp pages, speically I have lots of pages as step 1, step 2, step 3 before submiting the action, with different form beans. Thanks, best regards Ashraf Fouad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Maintaining form data across pages...
Ayoub, This was an issue that came across a little while ago, and I was surprised by the lack of existing solutions. What we did was to implement a little process engine wherein you could setup a single action (subclass of the process action) and setup within the action the steps (step1, step2, step3) etc. We then mapped inputs to the steps, so you would define a forward for each step which pointed to the view (jsp page) for that view. Another thing we did in our approach was to implement a pre-form mechanism which you can use to prepare information for each step view. I found the way struts deals (or doesn't) with view preparation a bit vague. Lukas -Original Message- From: Ayoub, Ashraf A [mailto:[EMAIL PROTECTED] Sent: Sunday, 16 May 2004 9:58 p.m. To: Struts Users Mailing List Subject: Maintaining form data across pages... Dears, I am trying to setup a series of jsp pages (requestForm, confrimation jsp). I set the scope of my requestForm to "session" as to maintain the data across the various jsps, but I get it as if reset is called, after the confirmation page submits. What is the best way to maintain the request data across several jsp pages, speically I have lots of pages as step 1, step 2, step 3 before submiting the action, with different form beans. Thanks, best regards Ashraf Fouad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Getting the form bean on a page for use in a core tag
Niall, Sorry if I was unclear, I understand that the form is placed in the request as the form name, but what we were doing was putting it under a constant key, so regardless of what you actually called the form in your action element it would always be available in the request under a constant key. I believe struts already does this also, but it uses a rather long string, from memory 'org.apache.struts.taglib.html.BEAN', but I don't believe that this would play nicely with EL expressions and its too long to be convenient. Lukas -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Thursday, 22 April 2004 1:41 p.m. To: Struts Users Mailing List Subject: Re: Getting the form bean on a page for use in a core tag Struts already does this, it stores the form under the name you specified in your action mapping. So if you have: To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Sent: Thursday, April 22, 2004 2:26 AM Subject: RE: Getting the form bean on a page for use in a core tag > Bill, > > Thanks for your help here. We actually ended up working down a > different path for this particular issue but I am now using this > technique in other code. > > One thing we did to make the core tag code more generic was to store a > reference to the form bean in the request attributes under a short, > constant value ('formBean'). This way our el can look like > ${formBean.map.txtFullLegalName}, much like the way the html tags pick > up the form bean by default. We were able to do this (setting the form > bean) consistently because we are running thru a little process type > action which is subclassed for each process. > > Lukas > > -Original Message- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow > Sent: Wednesday, 21 April 2004 1:53 p.m. > To: [EMAIL PROTECTED] > Subject: Re: Getting the form bean on a page for use in a core tag > > > Ahh! Bach! The wrinkle here is the DynaValidatorForm and not a > regular ActionForm ... > > Try this ... > > > do something > > > For complete details ... > > http://jakarta.apache.org/struts/api/org/apache/struts/action/DynaActi > on > Form.html#getMap() > > Bill Siggelkow > > Lukas wrote: > > > Daniel, > > > > What i'm trying to achieve is to use the tag to > > conditionally show some content based on a value of the form bean. > > > > Something along the lines.. > > > > > > do something > > > > > > where 'studentDetailsBasicForm' is the name of my form for the > > action of which this jsp page is a view (a forward) and age is a > > property of that form. In this case the form is a > > DynaValidatorActionForm. > > > > I'm not in the office at the moment so the code is just from memory, > > but it gives you the idea. > > > > I guess i could use the bean:define to copy out each attribute of > > the bean, but it doesn't seem very tidy. > > > > Lukas > > > > > >>-Original Message- > >>From: Daniel Henrique Alves Lima > >>[mailto:[EMAIL PROTECTED] > >>Sent: Tuesday, 20 April 2004 10:52 p.m. > >>To: Struts Users Mailing List > >>Subject: Re: Getting the form bean on a page for use in a core tag > >> > >>Lukas, i don't know if i understand your question, but: Can you > >>use to "access and rename" your bean so you can use it > >>in a el expression ? > >> > >>Lukas Hazlehurst wrote: > >> > >> > >>>Hello, > >>> > >>>I apologise if I've missed something obvious somewhere, but > >> > >>I'm trying > >> > >>>to use a property of my form bean in a core tag, and I'm > >> > >>just missing > >> > >>>how to refer to the form bean easily, since the constant > >> > >>name has full > >> > >>>stops in it which I presume will muck up the el expression. > >>> > >>>I've been looking thru my list archives and I can't seem to find > >>>any reference to the problem which probably means I'm missing the > >>>point somewhere, but any help would be appreciated. > >>> > >>>Lukas > >>> > >>> > >>>--- > >>>-- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail
RE: Getting the form bean on a page for use in a core tag
Bill, Thanks for your help here. We actually ended up working down a different path for this particular issue but I am now using this technique in other code. One thing we did to make the core tag code more generic was to store a reference to the form bean in the request attributes under a short, constant value ('formBean'). This way our el can look like ${formBean.map.txtFullLegalName}, much like the way the html tags pick up the form bean by default. We were able to do this (setting the form bean) consistently because we are running thru a little process type action which is subclassed for each process. Lukas -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow Sent: Wednesday, 21 April 2004 1:53 p.m. To: [EMAIL PROTECTED] Subject: Re: Getting the form bean on a page for use in a core tag Ahh! Bach! The wrinkle here is the DynaValidatorForm and not a regular ActionForm ... Try this ... do something For complete details ... http://jakarta.apache.org/struts/api/org/apache/struts/action/DynaAction Form.html#getMap() Bill Siggelkow Lukas wrote: > Daniel, > > What i'm trying to achieve is to use the tag to > conditionally show some content based on a value of the form bean. > > Something along the lines.. > > > do something > > > where 'studentDetailsBasicForm' is the name of my form for the action > of which this jsp page is a view (a forward) and age is a property of > that form. In this case the form is a DynaValidatorActionForm. > > I'm not in the office at the moment so the code is just from memory, > but it gives you the idea. > > I guess i could use the bean:define to copy out each attribute of the > bean, but it doesn't seem very tidy. > > Lukas > > >>-Original Message- >>From: Daniel Henrique Alves Lima [mailto:[EMAIL PROTECTED] >>Sent: Tuesday, 20 April 2004 10:52 p.m. >>To: Struts Users Mailing List >>Subject: Re: Getting the form bean on a page for use in a core tag >> >>Lukas, i don't know if i understand your question, but: Can you >>use to "access and rename" your bean so you can use it >>in a el expression ? >> >>Lukas Hazlehurst wrote: >> >> >>>Hello, >>> >>>I apologise if I've missed something obvious somewhere, but >> >>I'm trying >> >>>to use a property of my form bean in a core tag, and I'm >> >>just missing >> >>>how to refer to the form bean easily, since the constant >> >>name has full >> >>>stops in it which I presume will muck up the el expression. >>> >>>I've been looking thru my list archives and I can't seem to find any >>>reference to the problem which probably means I'm missing the point >>>somewhere, but any help would be appreciated. >>> >>>Lukas >>> >>> >>>- >>>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] >> >> >>--- >>Incoming mail is certified Virus Free. >>Checked by AVG anti-virus system (http://www.grisoft.com). >>Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 >> >> > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 - 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: Getting the form bean on a page for use in a core tag
Daniel, What i'm trying to achieve is to use the tag to conditionally show some content based on a value of the form bean. Something along the lines.. do something where 'studentDetailsBasicForm' is the name of my form for the action of which this jsp page is a view (a forward) and age is a property of that form. In this case the form is a DynaValidatorActionForm. I'm not in the office at the moment so the code is just from memory, but it gives you the idea. I guess i could use the bean:define to copy out each attribute of the bean, but it doesn't seem very tidy. Lukas > -Original Message- > From: Daniel Henrique Alves Lima [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 20 April 2004 10:52 p.m. > To: Struts Users Mailing List > Subject: Re: Getting the form bean on a page for use in a core tag > > Lukas, i don't know if i understand your question, but: > Can you use to "access and rename" your bean so you can > use it in a el expression ? > > Lukas Hazlehurst wrote: > > >Hello, > > > >I apologise if I've missed something obvious somewhere, but > I'm trying > >to use a property of my form bean in a core tag, and I'm > just missing > >how to refer to the form bean easily, since the constant > name has full > >stops in it which I presume will muck up the el expression. > > > >I've been looking thru my list archives and I can't seem to find any > >reference to the problem which probably means I'm missing the point > >somewhere, but any help would be appreciated. > > > >Lukas > > > > > >- > >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] > > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Getting the form bean on a page for use in a core tag
Hello, I apologise if I've missed something obvious somewhere, but I'm trying to use a property of my form bean in a core tag, and I'm just missing how to refer to the form bean easily, since the constant name has full stops in it which I presume will muck up the el expression. I've been looking thru my list archives and I can't seem to find any reference to the problem which probably means I'm missing the point somewhere, but any help would be appreciated. Lukas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]