RE: Re: Validation only occurs client side
Thanks Bill. Actually, I had tried that by overriding validate in my form, calling super.validate() and checking the return value. I found that validate in the parent class "ValidatorForm" returns an empty ActionErrors object. So, that means the form is passing the validation, which is really strange! Do you think the request processor might have something to do with that? -Original Message- From: Bill Siggelkow [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 4:30 AM To: user@struts.apache.org Subject: Re: Validation only occurs client side At first glance it looks okay -- I suggest you set a breakpoint in the ValidatorForm.validate() method (or you could override the method) to see if it gets called. If not, then I would look into your request processor (which I noticed was a custom one). -Bill Siggelkow On 2005-03-23 11:09:06 -0500, "tarek.nabil" <[EMAIL PROTECTED]> said: > Hi, > > I'm having a really weird problem. This is the first time I use the > Validator. I expected to have some problems with client side > validations, but what I found was client side validations are working > but server side validations aren't!! > > The fact that client-side validations work, I think, means that I've > done the configuration correctly. But why isn't it doing anything on > the server side?!!! > > I made sure that validate is set to true on my action tags. I double > checked everything else and I believe everything is done correctly. > Any ideas? > > validator-rules.xml --> the default > > validation.xml has only a single formset element > > > > >depends="required"> > >depends="required"> > > > > > struts-config.xml > > > type="ae.gov.dphq.traffic.eng.actions.ApplicantForm"/> > > > name="applicantForm" input="/tps/applicant.jsp" scope="request" > validate="true"> > > > > > > >processorClass="oracle.jbo.html.struts11.BC4JRequestProcessor" > contentType="text/html;charset=windows-1256"/> >parameter="ae.gov.dphq.traffic.eng.ApplicationResources"/> > > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > I don't have any validate methods in my ApplicantForm class which > extends ValidatorForm. > > Every help is appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to store application settings
On Fri, 25 Mar 2005 18:35:12 + (UTC), John Brayton <[EMAIL PROTECTED]> wrote: > Laurent free.fr> writes: > > I have a few settings in my webapp (address of the LDAP server, location > > of 2 or 3 files), which are in the source code at the moment. This makes > > it difficult to change them (and I have to recompile every time). > > I like to store settings that a system administrator will need to be able to > change in a configuration "properties"-style file, outside of the webapp > directory or ".war" file. XML-based configuration files may be appropriate > for > applications where the configuration options are more complex. Other options > include the WEB-INF/web.xml file or, as you said, resource files. > > My reasoning for storing them completely outside of the webapp or ".war" file > is: > > * I think it allows you to communicate what you consider application > "configurations" that a system administrator will need to update. Everything > else (Java code, JSP's, Struts and Tiles Config Files, etc.) is "code" and > part > of the application, and therefore not expected to be change once released to > system administrators. > > * When you release a webapp update, the system administrator can safely > overwrite the old webapp without losing configuration changes. Of course, you > will likely still need to merge new configuration parameters as part of many > webapp updates. > There's a third benefit to storing information like this outside of the war file -- you can take the same WAR and deploy it, unchanged, on a development server, a pre-production testbed, or a production server. This is the use case that JNDI environment variables were designed for in J2EE. Many of you are probably familiar with using JNDI data sources to configure JDBC data sources in a way that is totally external to your webapp. What is less commonly known is that you can do the same with configuration properties, using elements. As an example, lets say you wanted to store the URL of your LDAP server in some externally configurable spot. If you put an entry like this in your web.xml file: ldapURL java.lang.String then your initialization code can retrieve it easily: InitialContext context = new InitialContext(); String ldapURL = (String) context.lookup("java:comp/env/ldapURL"); and the actual value is configured using the admin tools (or configuration files) of your favorite server. For Tomcat, for instance, you put an entry in the server.xml file: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html#Environment%20Entries Craig > John > > > - > 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: PDF of User's Guide
Sadly not, unless there is one off-site somewhere :( -Ted. On Fri, 25 Mar 2005 14:07:47 -0600, Justin Morgan <[EMAIL PROTECTED]> wrote: > I apologize in advance if this is a trivial question... > > I poked around the Struts website, but I was unable to find a PDF > version of the User's Guide > (http://struts.apache.org/userGuide/index.html). Is there a PDF version > of this resource out there? > > Thanks, > -Justin > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- HTH, Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practice for "dynamic reloading" of a part of the JSP ?
Just read that... Yeah, all good points, but I think one makes all the difference: differentiating between a web APPLICATION and a web SITE. I have no problem agreeing that a web SITE probably shouldn't use this. I would even go so far as to say that relatively simple web APPLICATIONS shouldn't use it either. But where to draw the lines makes all the difference. Most of the apps I've developed over the last few years have been (a) Intranet-only, or extranet to clients, and (b) started with a single requirement at the top of the list: it should generally look, feel and function like a fat-client. Try doing that WITHOUT techniques like this! (Of course, one could logically ask why the apps weren't true fat-clients with that requirement, but that's another discussion! :) ) Frank Justin Morgan wrote: On a slightly tangential note, here's one opinion on XMLHttpRequest usability: http://www.baekdal.com/articles/Usability/XMLHttpRequest-guidelines/ I tend to agree with most, but not all of it. -Justin -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 3:48 PM To: Struts Users Mailing List Subject: Re: Best practice for "dynamic reloading" of a part of the JSP ? I'm not sure I follow Erik... I know I've only used this in Intranet-based applications because of the browser support... No sense locking out anyone using anything but the latest versions (although the version support seems to be better than I had thought frankly)... You can do basically this same thing with a hidden frame as I suggested earlier, so you wouldn't even need XMLHttpRequest, and honestly that's what I've done except for once or twice. That object certainly makes things more concise though. Frank Erik Weber wrote: Thanks for the example. I copied the source. I suppose you could write some JavaScript that would run on more browsers that would try to reload a combo box, but would submit the form if the reload failed? That way you wouldn't have to be as worried about browser support and could possibly work it in to some existing apps . . . Erik Frank W. Zammetti wrote: I'm sure what you've found on the net is sufficient, but in case it isn't, here's a quick example I just threw together: http://www.omnytex.com/XMLHTTPRequestExample.htm Note that if a URL you are trying to access isn't in the same domain, then at least on Firefox you will get an access denied exception. That example shows two things: retrieving a URL and displaying it in a table, and updating the options of a element. I think the later is probably quite applicable. Obviously you'll want to target some Action rather than an actual URL as I've done, but the process is identical. Also, I think it is very important to note that you *DO NOT* have to send back XML, contrary to the objects' name! In fact I've found for a great many things your life will be considerably simpler to not send back XML (such as updating a select like in the example). You need to make that determination of course depending on what you are doing. But, XML parsing on the client tends to be a bit on the slow side, so I wouldn't do it unless you have a reason for it being XML. Especially if you can't be sure you won't be returning a huge document. Then again, in a service-oriented world where "services" tends to be synonymous with "web service", which tends to be synonymous with XML, it's something to think about. Then again, no one said a Web Service has to be XML-based either! :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practice for "dynamic reloading" of a part of the JSP ?
Yeah, that would be cool... but then again you have to ask the question of whether there is a true benefit or if it's just for the sake of doing something cool, not that I'm against that :) I'm not sure I'd want to do this with an existing app, not sure it'd really be worth it (unless you have concerns about your page sizes and such, bandwidth concerns, etc.). -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com Erik Weber wrote: Ah I was just thinking about some web apps I have that basically just refresh combo boxes on POSTs using onchange, one at a time. It would be kind of cool to try to embed some new JavaScript like yours and put some new URLs on the app server to take advantage of this kind of thing, but without breaking anything that works now. So it would use XMLHttpRequest if it was available but not depend on it, to do the refreshing. I'm only thinking out loud so if I'm missing something obvious just ignore me. After all it's Friday. ;-) Erik Frank W. Zammetti wrote: I'm not sure I follow Erik... I know I've only used this in Intranet-based applications because of the browser support... No sense locking out anyone using anything but the latest versions (although the version support seems to be better than I had thought frankly)... You can do basically this same thing with a hidden frame as I suggested earlier, so you wouldn't even need XMLHttpRequest, and honestly that's what I've done except for once or twice. That object certainly makes things more concise though. Frank Erik Weber wrote: Thanks for the example. I copied the source. I suppose you could write some JavaScript that would run on more browsers that would try to reload a combo box, but would submit the form if the reload failed? That way you wouldn't have to be as worried about browser support and could possibly work it in to some existing apps . . . Erik Frank W. Zammetti wrote: I'm sure what you've found on the net is sufficient, but in case it isn't, here's a quick example I just threw together: http://www.omnytex.com/XMLHTTPRequestExample.htm Note that if a URL you are trying to access isn't in the same domain, then at least on Firefox you will get an access denied exception. That example shows two things: retrieving a URL and displaying it in a table, and updating the options of a element. I think the later is probably quite applicable. Obviously you'll want to target some Action rather than an actual URL as I've done, but the process is identical. Also, I think it is very important to note that you *DO NOT* have to send back XML, contrary to the objects' name! In fact I've found for a great many things your life will be considerably simpler to not send back XML (such as updating a select like in the example). You need to make that determination of course depending on what you are doing. But, XML parsing on the client tends to be a bit on the slow side, so I wouldn't do it unless you have a reason for it being XML. Especially if you can't be sure you won't be returning a huge document. Then again, in a service-oriented world where "services" tends to be synonymous with "web service", which tends to be synonymous with XML, it's something to think about. Then again, no one said a Web Service has to be XML-based either! :) - 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: Exceptions and ActionErrors
I can't remember personally running across this situation, and maybe that's because what I try to communicate changes between levels/tiers. In the business tier, I tend to log messages that would help me debug problems should any arise. Hopefully, I would log parameters and values calculated/discovered during method execution. On the Action class level, I usually don't log messages when the execption class is specific to my application. That is, if I catch MyException or any subclass, the method that threw that exception should've logged it already, so I don't need to log it. If I get something else, say, RemoteException or some other exception that my business tier didn't catch (or didn't cause), then I log it. This not only reduces code duplication, it also reduces the size of my log files. The error messages I show to the user is entirely different. In fact, they could be so different that the user wouldn't be able to tell the two messages were related (if the user ever saw the app logs). In your case, if you needed to log messages in the business tier, and you're using the same messages anyway, why not just log the message carried by the exception object you caught? If what you want to log in the Action is what's being shown to the user, there are methods you can use to have the message evaluated into a concrete String you can log. If they all really need to be the same, you can share resource files between the two tiers, then let the business tier access its messages from the resource file instead of hardcoding them. hth, Hubert On Fri, 25 Mar 2005 15:12:24 -0500, Matt Hughes <[EMAIL PROTECTED]> wrote: > In my current application, business logic is often scattered throughout > my Action classes. I am trying desperately to undo this 8th deadly sin, > and while I have, I've noticed how Exception(s) and ActionError(s) are > really being used with the exact same functionality. > > You might see something like this: > > > try { >user = session.dbGetUser(user_id); > }catch (SQLException sqlE) { >__logger.error("Could not find user with user_id: " + user_id); >errors.add(ActionErrors.GLOBAL_ERROR, new > ActionError("global.error.not_found.user", user_id); >return mapping.findForward(FAILURE); > } > > My first gripe looking at this is that I basically have to log the same > error as I am creating with the ActionError. Isn't there anyway to just > log the message of an ActionError when it is created without coupling > too much to the ActionError class? > > Ok now I rewrite the code to use a more suitable Exception and untie the > Action class from DB access and SQLExceptions: > > -UserDAO - > > public User getUser(int userId) throws ObjectNotFoundException { >try { > return dbGetUser(userId); >} catch (SQLException e) { > throw new ObjectNotFoundException("Could not find user with > userId: " + userId); >} > } > > Action class > > try { >user = session.getUser(user_id); > }catch (ObjectNotFoundException sqlE) { >__logger.error("Could not find user with user_id: " + user_id); >errors.add(ActionErrors.GLOBAL_ERROR, new > ActionError("global.error.not_found.user", user_id); >return mapping.findForward(FAILURE); > } > > > Now I am replicating the error message THREE times instead of TWO! > Notice that I passed in ObjectNotFoundException the relevant message. > So I guess my question is, if you are able to refactor your Actions so > they are only calling business logic classes and those business logic > classes throw well-messaged Exceptions, why not just have a super class > that combines these three messages in one place (assuming the Exception > is an exit condition, which is almost always is for me). > > public class SuperAction { >public ActionForward performAction(ActionMapping mapping, ActionForm > form, HttpServletRequest request, HttpServletResponse response){ > try { > //call perform method on subclasses > } catch (FddException fddE) { > //catch any fatal exceptions > __logger.error(fddE.getMessage(), fddE); > errors.add(ActionErrors.GLOBAL_ERROR, new > ActionError(fddE.getMessage)); > return mapping.findForward(FAILURE); >} >} > } > > If the Exception isn't fatal, than you catch it in the sub-Action and > handle it accordingly. But this way, every fatal method call in your > Actions will just be handled in one place no matter what the message. > Doing this in my code would reduce my Actions by 20-30 lines easily. > The only problem I see is that when the Exception is > being thrown, it isn't throwing a Localized message, but that should be > relatively easy to take care of. Any thoughts? > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > ---
RE: Use Indexed properties - Encounter IndexOutOfBound Exception
> I thought when the form is submitted, Strut will re-construct > the collection of objects with values from the input form. > Therefore, I don't have to specify the Collection/List size > in the form bean constructor. I can tell you from bitter experience that it does not work that way. The Struts controller gets the collection and assumes that it already contains enough members. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Use Indexed properties - Encounter IndexOutOfBound Exception
That's not it. I still get same error. I thought when the form is submitted, Strut will re-construct the collection of objects with values from the input form. Therefore, I don't have to specify the Collection/List size in the form bean constructor. -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 12:11 PM To: 'Struts Users Mailing List' Subject: RE: Use Indexed properties - Encounter IndexOutOfBound Exception > I'm trying to use Strut indexed tag but keep getting > java.lang.IndexOutOfBoundsException: Index: -9. It > displays with correct values but when the form is submitted, > I got the error. Below is a snip of my code. Do you know > what's wrong with it? When you submit your form, the Struts controller finds what form bean is associated with it and constructs an instance of that form. It then starts assigning values to it, using the accessor methods. For indexed properties, it uses an accessor to retrieve a collection of objects, then gets the object indicated by the index from the collection, then uses an accessor method in that object to assign a value. And there's your problem. If your form bean's constructor doesn't create a collection with enough items in it, the struts controller will try to access a non-existent member of the collection at this point. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: focussing on image in jsp
Another approach would be to have the image be an tag. Then you could add an "onload=document.form.element.focus()" to your tag. HTH, Greg -Original Message- From: Vilpesh Mistry [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 5:38 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: focussing on image in jsp hi why not have a anchor near or above image and focus or move to that anchor thanks --- Raghuveer Vellanki <[EMAIL PROTECTED]> wrote: > > can any one provide information on , > focussing on image in jsp when page loads. > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 - 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: Best practice for "dynamic reloading" of a part of the JSP ?
Ah I was just thinking about some web apps I have that basically just refresh combo boxes on POSTs using onchange, one at a time. It would be kind of cool to try to embed some new JavaScript like yours and put some new URLs on the app server to take advantage of this kind of thing, but without breaking anything that works now. So it would use XMLHttpRequest if it was available but not depend on it, to do the refreshing. I'm only thinking out loud so if I'm missing something obvious just ignore me. After all it's Friday. ;-) Erik Frank W. Zammetti wrote: I'm not sure I follow Erik... I know I've only used this in Intranet-based applications because of the browser support... No sense locking out anyone using anything but the latest versions (although the version support seems to be better than I had thought frankly)... You can do basically this same thing with a hidden frame as I suggested earlier, so you wouldn't even need XMLHttpRequest, and honestly that's what I've done except for once or twice. That object certainly makes things more concise though. Frank Erik Weber wrote: Thanks for the example. I copied the source. I suppose you could write some JavaScript that would run on more browsers that would try to reload a combo box, but would submit the form if the reload failed? That way you wouldn't have to be as worried about browser support and could possibly work it in to some existing apps . . . Erik Frank W. Zammetti wrote: I'm sure what you've found on the net is sufficient, but in case it isn't, here's a quick example I just threw together: http://www.omnytex.com/XMLHTTPRequestExample.htm Note that if a URL you are trying to access isn't in the same domain, then at least on Firefox you will get an access denied exception. That example shows two things: retrieving a URL and displaying it in a table, and updating the options of a element. I think the later is probably quite applicable. Obviously you'll want to target some Action rather than an actual URL as I've done, but the process is identical. Also, I think it is very important to note that you *DO NOT* have to send back XML, contrary to the objects' name! In fact I've found for a great many things your life will be considerably simpler to not send back XML (such as updating a select like in the example). You need to make that determination of course depending on what you are doing. But, XML parsing on the client tends to be a bit on the slow side, so I wouldn't do it unless you have a reason for it being XML. Especially if you can't be sure you won't be returning a huge document. Then again, in a service-oriented world where "services" tends to be synonymous with "web service", which tends to be synonymous with XML, it's something to think about. Then again, no one said a Web Service has to be XML-based either! :) - 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: Best practice for "dynamic reloading" of a part of the JSP ?
On a slightly tangential note, here's one opinion on XMLHttpRequest usability: http://www.baekdal.com/articles/Usability/XMLHttpRequest-guidelines/ I tend to agree with most, but not all of it. -Justin -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 3:48 PM To: Struts Users Mailing List Subject: Re: Best practice for "dynamic reloading" of a part of the JSP ? I'm not sure I follow Erik... I know I've only used this in Intranet-based applications because of the browser support... No sense locking out anyone using anything but the latest versions (although the version support seems to be better than I had thought frankly)... You can do basically this same thing with a hidden frame as I suggested earlier, so you wouldn't even need XMLHttpRequest, and honestly that's what I've done except for once or twice. That object certainly makes things more concise though. Frank Erik Weber wrote: > Thanks for the example. I copied the source. I suppose you could write > some JavaScript that would run on more browsers that would try to reload > a combo box, but would submit the form if the reload failed? That way > you wouldn't have to be as worried about browser support and could > possibly work it in to some existing apps . . . > > Erik > > > Frank W. Zammetti wrote: > >> I'm sure what you've found on the net is sufficient, but in case it >> isn't, here's a quick example I just threw together: >> >> http://www.omnytex.com/XMLHTTPRequestExample.htm >> >> Note that if a URL you are trying to access isn't in the same domain, >> then at least on Firefox you will get an access denied exception. >> >> That example shows two things: retrieving a URL and displaying it in a >> table, and updating the options of a element. I think the >> later is probably quite applicable. >> >> Obviously you'll want to target some Action rather than an actual URL >> as I've done, but the process is identical. >> >> Also, I think it is very important to note that you *DO NOT* have to >> send back XML, contrary to the objects' name! In fact I've found for >> a great many things your life will be considerably simpler to not send >> back XML (such as updating a select like in the example). You need to >> make that determination of course depending on what you are doing. >> But, XML parsing on the client tends to be a bit on the slow side, so >> I wouldn't do it unless you have a reason for it being XML. >> Especially if you can't be sure you won't be returning a huge document. >> >> Then again, in a service-oriented world where "services" tends to be >> synonymous with "web service", which tends to be synonymous with XML, >> it's something to think about. Then again, no one said a Web Service >> has to be XML-based either! :) >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.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: Best practice for "dynamic reloading" of a part of the JSP ?
I'm not sure I follow Erik... I know I've only used this in Intranet-based applications because of the browser support... No sense locking out anyone using anything but the latest versions (although the version support seems to be better than I had thought frankly)... You can do basically this same thing with a hidden frame as I suggested earlier, so you wouldn't even need XMLHttpRequest, and honestly that's what I've done except for once or twice. That object certainly makes things more concise though. Frank Erik Weber wrote: Thanks for the example. I copied the source. I suppose you could write some JavaScript that would run on more browsers that would try to reload a combo box, but would submit the form if the reload failed? That way you wouldn't have to be as worried about browser support and could possibly work it in to some existing apps . . . Erik Frank W. Zammetti wrote: I'm sure what you've found on the net is sufficient, but in case it isn't, here's a quick example I just threw together: http://www.omnytex.com/XMLHTTPRequestExample.htm Note that if a URL you are trying to access isn't in the same domain, then at least on Firefox you will get an access denied exception. That example shows two things: retrieving a URL and displaying it in a table, and updating the options of a element. I think the later is probably quite applicable. Obviously you'll want to target some Action rather than an actual URL as I've done, but the process is identical. Also, I think it is very important to note that you *DO NOT* have to send back XML, contrary to the objects' name! In fact I've found for a great many things your life will be considerably simpler to not send back XML (such as updating a select like in the example). You need to make that determination of course depending on what you are doing. But, XML parsing on the client tends to be a bit on the slow side, so I wouldn't do it unless you have a reason for it being XML. Especially if you can't be sure you won't be returning a huge document. Then again, in a service-oriented world where "services" tends to be synonymous with "web service", which tends to be synonymous with XML, it's something to think about. Then again, no one said a Web Service has to be XML-based either! :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practice for "dynamic reloading" of a part of the JSP ?
Thanks for the example. I copied the source. I suppose you could write some JavaScript that would run on more browsers that would try to reload a combo box, but would submit the form if the reload failed? That way you wouldn't have to be as worried about browser support and could possibly work it in to some existing apps . . . Erik Frank W. Zammetti wrote: I'm sure what you've found on the net is sufficient, but in case it isn't, here's a quick example I just threw together: http://www.omnytex.com/XMLHTTPRequestExample.htm Note that if a URL you are trying to access isn't in the same domain, then at least on Firefox you will get an access denied exception. That example shows two things: retrieving a URL and displaying it in a table, and updating the options of a element. I think the later is probably quite applicable. Obviously you'll want to target some Action rather than an actual URL as I've done, but the process is identical. Also, I think it is very important to note that you *DO NOT* have to send back XML, contrary to the objects' name! In fact I've found for a great many things your life will be considerably simpler to not send back XML (such as updating a select like in the example). You need to make that determination of course depending on what you are doing. But, XML parsing on the client tends to be a bit on the slow side, so I wouldn't do it unless you have a reason for it being XML. Especially if you can't be sure you won't be returning a huge document. Then again, in a service-oriented world where "services" tends to be synonymous with "web service", which tends to be synonymous with XML, it's something to think about. Then again, no one said a Web Service has to be XML-based either! :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using with Tiles and Struts
thank you.. I totally missed that.. Appreciated! -Original Message- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:57 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts Ah. Yes, that's the problem... The tag is the "rt" version (run time) which does not accept expressions. JSTL comes with 2 sets of tags. One el (expression-language) and the other rt (runtime), which allows scriplets to be entered into tags. Download them here: http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:50 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts I'm assuming you mean the jar? It's just the usual jstl.jar and the tld is fmt.tld hnm.. I just looked at the tld and I've got class names like : Maps key to localized message and performs parametric replacement message org.apache.taglibs.standard.tag.rt.fmt.MessageTag I'm assuming now that I somehow am using the wrong tld.. if I am, can you direct me to the correct one? -Original Message- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:43 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts Did you accidentally include the run-time version of fmt? -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:38 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts That was close to the first way I went about it. I did the following: and then I was able to access the key just fine ( I did a test of and got "home.title"), proving that the problem wasn't in the way I was using the tiles attribute. For some reason, when I plugged in : I got the usual ???${titleKey}??? message from the fmt:message tag Perhaps I'm doing something wrong somewhere. I even tried just doing the following as a test: and I got the following: ???${titleKey}??? Main Home Page -Original Message- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:27 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts Vince, You need to import the Tiles attribute before you reference it: Thanks, Paul -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:11 PM To: 'user@struts.apache.org' Subject: using with Tiles and Struts I am building a Struts Web application and I'm using Tiles for the first time. I have it all set up and working nicely. My problem comes in the fact that I want to use a standard messages.resources file for my page titles. For example home.title=Main Home Page info.title=Intro Page etc. I am used to setting the bundle at the top of the page like: and then directly accessing keys as follows: however I am now using tiles so what I had hoped was to use a tiles attribute to pass the key : and then use the key in the tile like: however, nothing I've tried has worked (including just trying the fmt:message tag w/o using Tiles like : ) . For some reason, the fmt:message tag refuses to accept expression values. Can anyone offer me a best practice on how to handle this? Or at least solve my problem? Vincent Fumo System Development Specialist ACS Municipal Services Government Systems 609-823-6587 AIM : neodem2001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., I
PDF of User's Guide
I apologize in advance if this is a trivial question... I poked around the Struts website, but I was unable to find a PDF version of the User's Guide (http://struts.apache.org/userGuide/index.html). Is there a PDF version of this resource out there? Thanks, -Justin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Exceptions and ActionErrors
In my current application, business logic is often scattered throughout my Action classes. I am trying desperately to undo this 8th deadly sin, and while I have, I've noticed how Exception(s) and ActionError(s) are really being used with the exact same functionality. You might see something like this: try { user = session.dbGetUser(user_id); }catch (SQLException sqlE) { __logger.error("Could not find user with user_id: " + user_id); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("global.error.not_found.user", user_id); return mapping.findForward(FAILURE); } My first gripe looking at this is that I basically have to log the same error as I am creating with the ActionError. Isn't there anyway to just log the message of an ActionError when it is created without coupling too much to the ActionError class? Ok now I rewrite the code to use a more suitable Exception and untie the Action class from DB access and SQLExceptions: -UserDAO - public User getUser(int userId) throws ObjectNotFoundException { try { return dbGetUser(userId); } catch (SQLException e) { throw new ObjectNotFoundException("Could not find user with userId: " + userId); } } Action class try { user = session.getUser(user_id); }catch (ObjectNotFoundException sqlE) { __logger.error("Could not find user with user_id: " + user_id); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("global.error.not_found.user", user_id); return mapping.findForward(FAILURE); } Now I am replicating the error message THREE times instead of TWO! Notice that I passed in ObjectNotFoundException the relevant message. So I guess my question is, if you are able to refactor your Actions so they are only calling business logic classes and those business logic classes throw well-messaged Exceptions, why not just have a super class that combines these three messages in one place (assuming the Exception is an exit condition, which is almost always is for me). public class SuperAction { public ActionForward performAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ try { //call perform method on subclasses } catch (FddException fddE) { //catch any fatal exceptions __logger.error(fddE.getMessage(), fddE); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(fddE.getMessage)); return mapping.findForward(FAILURE); } } } If the Exception isn't fatal, than you catch it in the sub-Action and handle it accordingly. But this way, every fatal method call in your Actions will just be handled in one place no matter what the message. Doing this in my code would reduce my Actions by 20-30 lines easily. The only problem I see is that when the Exception is being thrown, it isn't throwing a Localized message, but that should be relatively easy to take care of. Any thoughts? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practice for "dynamic reloading" of a part of the JSP ?
I'm sure what you've found on the net is sufficient, but in case it isn't, here's a quick example I just threw together: http://www.omnytex.com/XMLHTTPRequestExample.htm Note that if a URL you are trying to access isn't in the same domain, then at least on Firefox you will get an access denied exception. That example shows two things: retrieving a URL and displaying it in a table, and updating the options of a element. I think the later is probably quite applicable. Obviously you'll want to target some Action rather than an actual URL as I've done, but the process is identical. Also, I think it is very important to note that you *DO NOT* have to send back XML, contrary to the objects' name! In fact I've found for a great many things your life will be considerably simpler to not send back XML (such as updating a select like in the example). You need to make that determination of course depending on what you are doing. But, XML parsing on the client tends to be a bit on the slow side, so I wouldn't do it unless you have a reason for it being XML. Especially if you can't be sure you won't be returning a huge document. Then again, in a service-oriented world where "services" tends to be synonymous with "web service", which tends to be synonymous with XML, it's something to think about. Then again, no one said a Web Service has to be XML-based either! :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com StÃphane Zuckerman wrote: I would highly recommend using XmlHttpRequest (aka ajax), which is much more user-friendly, much quicker to use and more flexible than reloading the page each time the user clicks on something. This is a solution I wasn't aware of... And it would be a really great one, provided I could find a way to use it in my application. Would you happen to have some code examples I could use to understand better how ajax works ? I found some pretty useful stuff here : http://www.xml.com/pub/a/2005/02/09/xml-http-request.html and there are other papers available that I haven't had time to read, but none with a J2EE example (or even better, a Struts example)... Thanks anyway, that was really useful ! I might not be able to use this technology for this project, but I certainly will for another one ! StÃphane - 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: Use Indexed properties - Encounter IndexOutOfBound Exception
> I'm trying to use Strut indexed tag but keep getting > java.lang.IndexOutOfBoundsException: Index: -9. It > displays with correct values but when the form is submitted, > I got the error. Below is a snip of my code. Do you know > what's wrong with it? When you submit your form, the Struts controller finds what form bean is associated with it and constructs an instance of that form. It then starts assigning values to it, using the accessor methods. For indexed properties, it uses an accessor to retrieve a collection of objects, then gets the object indicated by the index from the collection, then uses an accessor method in that object to assign a value. And there's your problem. If your form bean's constructor doesn't create a collection with enough items in it, the struts controller will try to access a non-existent member of the collection at this point. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Use Indexed properties - Encounter IndexOutOfBound Exception
Hello, I'm trying to use Strut indexed tag but keep getting java.lang.IndexOutOfBoundsException: Index: -9. It displays with correct values but when the form is submitted, I got the error. Below is a snip of my code. Do you know hat's wrong with it? JSP code: Form Code: List pools = new ArrayList(); public List getPools() { return this.pools; } public Pool getPools(int i) { return (Pool) this.pools.get(i); } public void setPools(List v) { this.pools = v; } public void setPools(int i, Pool v) { this.pools.set(i, v); } -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using with Tiles and Struts
Ah. Yes, that's the problem... The tag is the "rt" version (run time) which does not accept expressions. JSTL comes with 2 sets of tags. One el (expression-language) and the other rt (runtime), which allows scriplets to be entered into tags. Download them here: http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:50 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts I'm assuming you mean the jar? It's just the usual jstl.jar and the tld is fmt.tld hnm.. I just looked at the tld and I've got class names like : Maps key to localized message and performs parametric replacement message org.apache.taglibs.standard.tag.rt.fmt.MessageTag I'm assuming now that I somehow am using the wrong tld.. if I am, can you direct me to the correct one? -Original Message- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:43 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts Did you accidentally include the run-time version of fmt? -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:38 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts That was close to the first way I went about it. I did the following: and then I was able to access the key just fine ( I did a test of and got "home.title"), proving that the problem wasn't in the way I was using the tiles attribute. For some reason, when I plugged in : I got the usual ???${titleKey}??? message from the fmt:message tag Perhaps I'm doing something wrong somewhere. I even tried just doing the following as a test: and I got the following: ???${titleKey}??? Main Home Page -Original Message- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:27 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts Vince, You need to import the Tiles attribute before you reference it: Thanks, Paul -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:11 PM To: 'user@struts.apache.org' Subject: using with Tiles and Struts I am building a Struts Web application and I'm using Tiles for the first time. I have it all set up and working nicely. My problem comes in the fact that I want to use a standard messages.resources file for my page titles. For example home.title=Main Home Page info.title=Intro Page etc. I am used to setting the bundle at the top of the page like: and then directly accessing keys as follows: however I am now using tiles so what I had hoped was to use a tiles attribute to pass the key : and then use the key in the tile like: however, nothing I've tried has worked (including just trying the fmt:message tag w/o using Tiles like : ) . For some reason, the fmt:message tag refuses to accept expression values. Can anyone offer me a best practice on how to handle this? Or at least solve my problem? Vincent Fumo System Development Specialist ACS Municipal Services Government Systems 609-823-6587 AIM : neodem2001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary
RE: using with Tiles and Struts
I'm assuming you mean the jar? It's just the usual jstl.jar and the tld is fmt.tld hnm.. I just looked at the tld and I've got class names like : Maps key to localized message and performs parametric replacement message org.apache.taglibs.standard.tag.rt.fmt.MessageTag I'm assuming now that I somehow am using the wrong tld.. if I am, can you direct me to the correct one? -Original Message- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:43 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts Did you accidentally include the run-time version of fmt? -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:38 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts That was close to the first way I went about it. I did the following: and then I was able to access the key just fine ( I did a test of and got "home.title"), proving that the problem wasn't in the way I was using the tiles attribute. For some reason, when I plugged in : I got the usual ???${titleKey}??? message from the fmt:message tag Perhaps I'm doing something wrong somewhere. I even tried just doing the following as a test: and I got the following: ???${titleKey}??? Main Home Page -Original Message- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:27 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts Vince, You need to import the Tiles attribute before you reference it: Thanks, Paul -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:11 PM To: 'user@struts.apache.org' Subject: using with Tiles and Struts I am building a Struts Web application and I'm using Tiles for the first time. I have it all set up and working nicely. My problem comes in the fact that I want to use a standard messages.resources file for my page titles. For example home.title=Main Home Page info.title=Intro Page etc. I am used to setting the bundle at the top of the page like: and then directly accessing keys as follows: however I am now using tiles so what I had hoped was to use a tiles attribute to pass the key : and then use the key in the tile like: however, nothing I've tried has worked (including just trying the fmt:message tag w/o using Tiles like : ) . For some reason, the fmt:message tag refuses to accept expression values. Can anyone offer me a best practice on how to handle this? Or at least solve my problem? Vincent Fumo System Development Specialist ACS Municipal Services Government Systems 609-823-6587 AIM : neodem2001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE
Re: Debugging struts application
That looks really nice, thanks! But will that tell me why Tomcat says that my action is unavailable? Venlig hilsen Martin Seebach John Hyun wrote: If you use eclipse you can get the tomcat-eclipse plugin and this will let you debug your web application (including tomcat and any supporting libraries, i.e. struts). The plugin is at: http://www.sysdeo.com/eclipse/tomcatPlugin.html You will need to download the source code of struts and/or tomcat of course to effectively step through them. -john --- Martin Seebach <[EMAIL PROTECTED]> wrote: Hi, I'm working on my first struts project, and I've got things working, little by little. One thing that I can't seem to resolve, is debugging information - currently an action fails with "Servlet action is currently unavailable", but I can't find out what I did på make it become unavailable. My log files in /var/log/tomcat4 are not any more helpful than the apache error-screen. Thank you in advance. -- Venlig hilsen Martin Seebach - 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: using with Tiles and Struts
Did you accidentally include the run-time version of fmt? -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:38 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts That was close to the first way I went about it. I did the following: and then I was able to access the key just fine ( I did a test of and got "home.title"), proving that the problem wasn't in the way I was using the tiles attribute. For some reason, when I plugged in : I got the usual ???${titleKey}??? message from the fmt:message tag Perhaps I'm doing something wrong somewhere. I even tried just doing the following as a test: and I got the following: ???${titleKey}??? Main Home Page -Original Message- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:27 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts Vince, You need to import the Tiles attribute before you reference it: Thanks, Paul -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:11 PM To: 'user@struts.apache.org' Subject: using with Tiles and Struts I am building a Struts Web application and I'm using Tiles for the first time. I have it all set up and working nicely. My problem comes in the fact that I want to use a standard messages.resources file for my page titles. For example home.title=Main Home Page info.title=Intro Page etc. I am used to setting the bundle at the top of the page like: and then directly accessing keys as follows: however I am now using tiles so what I had hoped was to use a tiles attribute to pass the key : and then use the key in the tile like: however, nothing I've tried has worked (including just trying the fmt:message tag w/o using Tiles like : ) . For some reason, the fmt:message tag refuses to accept expression values. Can anyone offer me a best practice on how to handle this? Or at least solve my problem? Vincent Fumo System Development Specialist ACS Municipal Services Government Systems 609-823-6587 AIM : neodem2001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Debugging struts application
If you use eclipse you can get the tomcat-eclipse plugin and this will let you debug your web application (including tomcat and any supporting libraries, i.e. struts). The plugin is at: http://www.sysdeo.com/eclipse/tomcatPlugin.html You will need to download the source code of struts and/or tomcat of course to effectively step through them. -john --- Martin Seebach <[EMAIL PROTECTED]> wrote: > Hi, > > I'm working on my first struts project, and I've got things working, > little by little. > > One thing that I can't seem to resolve, is debugging information - > currently an action fails with "Servlet action is currently > unavailable", but I can't find out what I did på make it become > unavailable. My log files in /var/log/tomcat4 are not any more > helpful > than the apache error-screen. > > Thank you in advance. > > -- > Venlig hilsen > Martin Seebach > > > - > 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: using with Tiles and Struts
That was close to the first way I went about it. I did the following: and then I was able to access the key just fine ( I did a test of and got "home.title"), proving that the problem wasn't in the way I was using the tiles attribute. For some reason, when I plugged in : I got the usual ???${titleKey}??? message from the fmt:message tag Perhaps I'm doing something wrong somewhere. I even tried just doing the following as a test: and I got the following: ???${titleKey}??? Main Home Page -Original Message- From: Benedict, Paul C [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:27 PM To: 'Struts Users Mailing List' Subject: RE: using with Tiles and Struts Vince, You need to import the Tiles attribute before you reference it: Thanks, Paul -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:11 PM To: 'user@struts.apache.org' Subject: using with Tiles and Struts I am building a Struts Web application and I'm using Tiles for the first time. I have it all set up and working nicely. My problem comes in the fact that I want to use a standard messages.resources file for my page titles. For example home.title=Main Home Page info.title=Intro Page etc. I am used to setting the bundle at the top of the page like: and then directly accessing keys as follows: however I am now using tiles so what I had hoped was to use a tiles attribute to pass the key : and then use the key in the tile like: however, nothing I've tried has worked (including just trying the fmt:message tag w/o using Tiles like : ) . For some reason, the fmt:message tag refuses to accept expression values. Can anyone offer me a best practice on how to handle this? Or at least solve my problem? Vincent Fumo System Development Specialist ACS Municipal Services Government Systems 609-823-6587 AIM : neodem2001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using with Tiles and Struts
Vince, You need to import the Tiles attribute before you reference it: Thanks, Paul -Original Message- From: Fumo, Vince [mailto:[EMAIL PROTECTED] Sent: Friday, March 25, 2005 2:11 PM To: 'user@struts.apache.org' Subject: using with Tiles and Struts I am building a Struts Web application and I'm using Tiles for the first time. I have it all set up and working nicely. My problem comes in the fact that I want to use a standard messages.resources file for my page titles. For example home.title=Main Home Page info.title=Intro Page etc. I am used to setting the bundle at the top of the page like: and then directly accessing keys as follows: however I am now using tiles so what I had hoped was to use a tiles attribute to pass the key : and then use the key in the tile like: however, nothing I've tried has worked (including just trying the fmt:message tag w/o using Tiles like : ) . For some reason, the fmt:message tag refuses to accept expression values. Can anyone offer me a best practice on how to handle this? Or at least solve my problem? Vincent Fumo System Development Specialist ACS Municipal Services Government Systems 609-823-6587 AIM : neodem2001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using with Tiles and Struts
I am building a Struts Web application and I'm using Tiles for the first time. I have it all set up and working nicely. My problem comes in the fact that I want to use a standard messages.resources file for my page titles. For example home.title=Main Home Page info.title=Intro Page etc. I am used to setting the bundle at the top of the page like: and then directly accessing keys as follows: however I am now using tiles so what I had hoped was to use a tiles attribute to pass the key : and then use the key in the tile like: however, nothing I've tried has worked (including just trying the fmt:message tag w/o using Tiles like : ) . For some reason, the fmt:message tag refuses to accept expression values. Can anyone offer me a best practice on how to handle this? Or at least solve my problem? Vincent Fumo System Development Specialist ACS Municipal Services Government Systems 609-823-6587 AIM : neodem2001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Debugging struts application
Hi, I'm working on my first struts project, and I've got things working, little by little. One thing that I can't seem to resolve, is debugging information - currently an action fails with "Servlet action is currently unavailable", but I can't find out what I did på make it become unavailable. My log files in /var/log/tomcat4 are not any more helpful than the apache error-screen. Thank you in advance. -- Venlig hilsen Martin Seebach - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to store application settings
Laurent free.fr> writes: > I have a few settings in my webapp (address of the LDAP server, location > of 2 or 3 files), which are in the source code at the moment. This makes > it difficult to change them (and I have to recompile every time). I like to store settings that a system administrator will need to be able to change in a configuration "properties"-style file, outside of the webapp directory or ".war" file. XML-based configuration files may be appropriate for applications where the configuration options are more complex. Other options include the WEB-INF/web.xml file or, as you said, resource files. My reasoning for storing them completely outside of the webapp or ".war" file is: * I think it allows you to communicate what you consider application "configurations" that a system administrator will need to update. Everything else (Java code, JSP's, Struts and Tiles Config Files, etc.) is "code" and part of the application, and therefore not expected to be change once released to system administrators. * When you release a webapp update, the system administrator can safely overwrite the old webapp without losing configuration changes. Of course, you will likely still need to merge new configuration parameters as part of many webapp updates. John - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practice for "dynamic reloading" of a part of the JSP ?
If you could write your state machine once as part of your server application, use full page reloads as a first implementation, and then later use the technique to segment your page reloads into partial page reloads, without having to redo any of the logic, then you'd have something . . . Erik StÃphane Zuckerman wrote: I would highly recommend using XmlHttpRequest (aka ajax), which is much more user-friendly, much quicker to use and more flexible than reloading the page each time the user clicks on something. This is a solution I wasn't aware of... And it would be a really great one, provided I could find a way to use it in my application. Would you happen to have some code examples I could use to understand better how ajax works ? I found some pretty useful stuff here : http://www.xml.com/pub/a/2005/02/09/xml-http-request.html and there are other papers available that I haven't had time to read, but none with a J2EE example (or even better, a Struts example)... Thanks anyway, that was really useful ! I might not be able to use this technology for this project, but I certainly will for another one ! StÃphane - 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: Best practice for "dynamic reloading" of a part of the JSP ?
I used this as a starting point: http://developer.apple.com/internet/webcontent/xmlhttpreq.html and I coded a Struts action to return my XML. Angie On Mar 25, 2005, at 9:36 AM, Stéphane Zuckerman wrote: I would highly recommend using XmlHttpRequest (aka ajax), which is much more user-friendly, much quicker to use and more flexible than reloading the page each time the user clicks on something. This is a solution I wasn't aware of... And it would be a really great one, provided I could find a way to use it in my application. Would you happen to have some code examples I could use to understand better how ajax works ? I found some pretty useful stuff here : http://www.xml.com/pub/a/2005/02/09/xml-http-request.html and there are other papers available that I haven't had time to read, but none with a J2EE example (or even better, a Struts example)... Thanks anyway, that was really useful ! I might not be able to use this technology for this project, but I certainly will for another one ! Stéphane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:42444b0f64001316535668! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Help html:text conditional arguments
OK, I found it and that works. George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 > -Original Message- > From: George Sexton [mailto:[EMAIL PROTECTED] > Sent: Friday, March 25, 2005 10:45 AM > To: 'Struts Users Mailing List' > Subject: RE: Newbie Help html:text conditional arguments > > OK, I found the EL stuff. I'll try it. > > George Sexton > MH Software, Inc. > http://www.mhsoftware.com/ > Voice: 303 438 9585 > > > > -Original Message- > > From: George Sexton [mailto:[EMAIL PROTECTED] > > Sent: Friday, March 25, 2005 10:38 AM > > To: 'Struts Users Mailing List'; 'Hubert Rabago' > > Subject: RE: Newbie Help html:text conditional arguments > > > > How would I do this? I upgraded all of the jars to 1.2.4 > > version of struts, > > and copied the TLDs and DTDs, but the READONLY attribute is > > still not set. > > > > George Sexton > > MH Software, Inc. > > http://www.mhsoftware.com/ > > Voice: 303 438 9585 > > > > > > > -Original Message- > > > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > > > Sent: Friday, March 25, 2005 9:45 AM > > > To: Struts Users Mailing List > > > Subject: Re: Newbie Help html:text conditional arguments > > > > > > It's possible you just need to update your taglib > > declarations to use > > > the EL version of the tags. > > > > > > Hubert > > > > > > > > > On Fri, 25 Mar 2005 11:41:41 -0500, Rick Reumann > > > <[EMAIL PROTECTED]> wrote: > > > > What is it doing wrong? Getting errors? What does the > > > resulting html src > > > > code look like? > > > > > > > > George Sexton wrote the following on 3/24/2005 10:45 PM: > > > > > I'm running into a problem with Struts, and I admit I'm a > > > newbie to it. > > > > > > > > > > I have a line in a JSP file: > > > > > > > > > > > > > > > > > > > > What I'd like to do is conditionally have readonly set: > > > > > <% > > > > > request.setAttribute("my_attr","true"); > > > > > %> > > > > > > > > > > > > > > > But it doesn't seem to work. I'm doing something > > similar with JSTL > > > > > FMT:MESSAGE. > > > > > > > > > > What is it I'm doing wrong? > > > > > > > > > > > > > > > George Sexton > > > > > > > > > - > > > 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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to store application settings
There must be a dozen possible answers to this one. I can tell you what we do and say it works for us. We use a combination of settings methods. Some web settings go in the web.xml in a element. Things that are non-web specific go into the Java System Preferences. I was initially skeptical of this one, but it's never given us trouble. We have an Ant task that loads these preferences and then any app can retrieve the values. An overriding goal is that configuration files that need to be changed to work on a given system (e.g. the file with local login/password info) should not be a file you check out from CVS and modify. Instead, a template lives in CVS that you copy to make your system local version. Having multiple places to set variables can present a challenge, especially if some values have to match. To address that, all of our configuration files have a -template form (e.g. web.xml-template) which has all important values defined as replaceable tokens (e.g. ${hostname}/${context-name}. Our Ant build takes care of the replacements and draws all the values from a single .properties file at build time. We have a default .properties file in CVS that has either safe default values or templates that users can copy and put into a local properties file that overrides anything in the default one. Overall, it has made configuration relatively simple for a new deployment. Here's the ant task to set up web.xml (package names have been changed to protect the guilty) description="Used to parse tokens in config files into their associated values in build.properties."> description="Used to parse tokens in config files into their associated values from build.properties.template."> tofile="${com.somecompany.basedir}/web/WEB-INF/web.xml"> K.C. Laurent wrote: Hi, I have a few settings in my webapp (address of the LDAP server, location of 2 or 3 files), which are in the source code at the moment. This makes it difficult to change them (and I have to recompile every time). Where is the best place to store these kinds of settings? I thought of using a RessourceBundle, what do you think? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Help html:text conditional arguments
OK, I found the EL stuff. I'll try it. George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 > -Original Message- > From: George Sexton [mailto:[EMAIL PROTECTED] > Sent: Friday, March 25, 2005 10:38 AM > To: 'Struts Users Mailing List'; 'Hubert Rabago' > Subject: RE: Newbie Help html:text conditional arguments > > How would I do this? I upgraded all of the jars to 1.2.4 > version of struts, > and copied the TLDs and DTDs, but the READONLY attribute is > still not set. > > George Sexton > MH Software, Inc. > http://www.mhsoftware.com/ > Voice: 303 438 9585 > > > > -Original Message- > > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > > Sent: Friday, March 25, 2005 9:45 AM > > To: Struts Users Mailing List > > Subject: Re: Newbie Help html:text conditional arguments > > > > It's possible you just need to update your taglib > declarations to use > > the EL version of the tags. > > > > Hubert > > > > > > On Fri, 25 Mar 2005 11:41:41 -0500, Rick Reumann > > <[EMAIL PROTECTED]> wrote: > > > What is it doing wrong? Getting errors? What does the > > resulting html src > > > code look like? > > > > > > George Sexton wrote the following on 3/24/2005 10:45 PM: > > > > I'm running into a problem with Struts, and I admit I'm a > > newbie to it. > > > > > > > > I have a line in a JSP file: > > > > > > > > > > > > > > > > What I'd like to do is conditionally have readonly set: > > > > <% > > > > request.setAttribute("my_attr","true"); > > > > %> > > > > > > > > > > > > But it doesn't seem to work. I'm doing something > similar with JSTL > > > > FMT:MESSAGE. > > > > > > > > What is it I'm doing wrong? > > > > > > > > > > > > George Sexton > > > > > - > > 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: [OT] i18n: fmt:message versus bean:message
Thanks for the link. Unfortunately, that appears to only talk about when your preferred locale isn't found at all (i.e. at the file level) and that's where JSTL and Struts diverge on finding the "next best match". My problem is that I do have a resource file for the preferred locale, but it's missing some keys (i.e. at an individual property level). Struts will still traverse its parent chain, but JSTL won't. Once JSTL finds a resource file matching the locale, it seems to stop there. I've read the JSR for JSTL at http://www.jcp.org/en/jsr/detail?id=52 and it leaves it sufficiently vague as to how missing keys within a resource should be handled. I suppose it's up to interpretation. I'm curious if different implementations handle this differently. For my situation, I'm using Resin 2.1.14. Angie On Mar 25, 2005, at 5:55 AM, David Suarez wrote: I haven't been using JSTL for i18n yet, just struts taglibs so I found the below very interesting when considering a move... I found this on the web: http://www.junlu.com/msg/30187.html The link suggests if you have a preferred approach, you can change the jstl resources configured to be used so they match what you expect. There's a code snippet in the link but I haven't tried it. I would guess you would configure the appropriate resources to use in a base action or filter as mentioned in the link so that your front-end code would never see it. Please write back what you find, I'm very interested in if you are able to change the i18n so it works as I'm accustomed to. Thanks!...djsuarez -Original Message- From: Angie Lin [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 7:34 PM To: user@struts.apache.org Subject: [OT] i18n: fmt:message versus bean:message This is off-topic, but in my Struts application, I've used all tags instead of tags and I'm encountering issues with my l10n. My questions: 1. Is it correct that JSTL fmt:message will NOT follow the parent chain of resources at an individual property level? 2. And is there anyway to force a parent chain? (read on if for my test case) I know that ResourceBundle establishes a parent chain by successively removing variant, country and language. Struts does the same thing though it doesn't actually use ResourceBundle - it has PropertyMessageResources. I know that JSTL doesn't follow the same lookup path. It instead only looks for specific locales (ServletRequest.getLocales() listed in order of preference) with a possible fallback locale (if configured in web.xml). However, I'm noticing that the fallback locale only appears to be used if the specific locale cannot be located at all. Here is my situation: ApplicationResources.properties: greeting=Hello there! goodbye=See ya! ApplicationResources_en.properties: greeting=Hello! goodbye=Bye! ApplicationResources_es.properties: greeting=Hola! Note that goodbye is missing from the spanish. EXAMPLE A: Assume my browser preferred locale is 'es'. And I have a fallbackLocale in web.xml set to 'en'. gives me Hola! See ya! Hola! ???goodbye??? The fallback is not even used. EXAMPLE B: Assume my browser preferred locale is 'fr'. And I have a fallbackLocale in web.xml set to 'en' gives me: Hello there! See ya! Hello! Bye! The struts tags used the parent chain to fall back to ApplicationResources.properties. But JSTL used the fallback of ApplicationResources_en.properties. Thanks, Angie !DSPAM:424417f638071794613381! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Help html:text conditional arguments
How would I do this? I upgraded all of the jars to 1.2.4 version of struts, and copied the TLDs and DTDs, but the READONLY attribute is still not set. George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Friday, March 25, 2005 9:45 AM > To: Struts Users Mailing List > Subject: Re: Newbie Help html:text conditional arguments > > It's possible you just need to update your taglib declarations to use > the EL version of the tags. > > Hubert > > > On Fri, 25 Mar 2005 11:41:41 -0500, Rick Reumann > <[EMAIL PROTECTED]> wrote: > > What is it doing wrong? Getting errors? What does the > resulting html src > > code look like? > > > > George Sexton wrote the following on 3/24/2005 10:45 PM: > > > I'm running into a problem with Struts, and I admit I'm a > newbie to it. > > > > > > I have a line in a JSP file: > > > > > > > > > > > > What I'd like to do is conditionally have readonly set: > > > <% > > > request.setAttribute("my_attr","true"); > > > %> > > > > > > > > > But it doesn't seem to work. I'm doing something similar with JSTL > > > FMT:MESSAGE. > > > > > > What is it I'm doing wrong? > > > > > > > > > George Sexton > > - > 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: Best practice for "dynamic reloading" of a part of the JSP ?
I would highly recommend using XmlHttpRequest (aka ajax), which is much more user-friendly, much quicker to use and more flexible than reloading the page each time the user clicks on something. This is a solution I wasn't aware of... And it would be a really great one, provided I could find a way to use it in my application. Would you happen to have some code examples I could use to understand better how ajax works ? I found some pretty useful stuff here : http://www.xml.com/pub/a/2005/02/09/xml-http-request.html and there are other papers available that I haven't had time to read, but none with a J2EE example (or even better, a Struts example)... Thanks anyway, that was really useful ! I might not be able to use this technology for this project, but I certainly will for another one ! StÃphane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Beginner question: No action instance for path /anzeigen could be created
From: <[EMAIL PROTECTED]> ... You forgot to extend "Action" class in your own action. Here is why you got a ClassCastException. Thanks a lot - that was it. 8-) Regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie Help html:text conditional arguments
The readonly attribute is not output. George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 > -Original Message- > From: Rick Reumann [mailto:[EMAIL PROTECTED] > Sent: Friday, March 25, 2005 9:42 AM > To: Struts Users Mailing List > Subject: Re: Newbie Help html:text conditional arguments > > What is it doing wrong? Getting errors? What does the > resulting html src > code look like? > > George Sexton wrote the following on 3/24/2005 10:45 PM: > > I'm running into a problem with Struts, and I admit I'm a > newbie to it. > > > > I have a line in a JSP file: > > > > > > > > What I'd like to do is conditionally have readonly set: > > <% > > request.setAttribute("my_attr","true"); > > %> > > > > > > But it doesn't seem to work. I'm doing something similar with JSTL > > FMT:MESSAGE. > > > > What is it I'm doing wrong? > > > > > > George Sexton > > MH Software, Inc. > > http://www.mhsoftware.com/ > > Voice: 303 438 9585 > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- > Rick > > - > 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: Newbie Help html:text conditional arguments
It's possible you just need to update your taglib declarations to use the EL version of the tags. Hubert On Fri, 25 Mar 2005 11:41:41 -0500, Rick Reumann <[EMAIL PROTECTED]> wrote: > What is it doing wrong? Getting errors? What does the resulting html src > code look like? > > George Sexton wrote the following on 3/24/2005 10:45 PM: > > I'm running into a problem with Struts, and I admit I'm a newbie to it. > > > > I have a line in a JSP file: > > > > > > > > What I'd like to do is conditionally have readonly set: > > <% > > request.setAttribute("my_attr","true"); > > %> > > > > > > But it doesn't seem to work. I'm doing something similar with JSTL > > FMT:MESSAGE. > > > > What is it I'm doing wrong? > > > > > > George Sexton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie Help html:text conditional arguments
What is it doing wrong? Getting errors? What does the resulting html src code look like? George Sexton wrote the following on 3/24/2005 10:45 PM: I'm running into a problem with Struts, and I admit I'm a newbie to it. I have a line in a JSP file: What I'd like to do is conditionally have readonly set: <% request.setAttribute("my_attr","true"); %> But it doesn't seem to work. I'm doing something similar with JSTL FMT:MESSAGE. What is it I'm doing wrong? George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practice for "dynamic reloading" of a part of the JSP ?
I agree with those who suggest inline updating use Javascript. I've written some code to handle paging of a table this way so that flipping to the next page of results doesn't result in a whole page refresh. What I would add is that it can be very simple because Javascript allows you to replace the innnerHTML for a given element. In the case of a table that allows you to design the table totally normally, as if you were going to be including it with a . Then, your javascript simply retrieves the table.jsp and stuffs it into the innerHTML for a or some other element. Might not be the best approach for or something that is less visual. K.C. Stéphane Zuckerman wrote: Hello, I am to write JSP pages with a form that has some items (lists, or checkboxes) that depend on previous choices from the same form. So here I have two choices basically : 1°) Load all the information that is possibly needed for a given page, hide it, and only show what is relevant with some javascript. For instance, If I select some "foo" option in a list, then below in the form, a second list is loaded with "bar1", "bar2", "bar3é ... options, which are related to the "foo" option. Drawback : if there are lots of possible options, lots of texts, and lots of users, this might be too heavy a solution. 2°) When I select "foo", then some javascript reloads the page (it does a post) with the "foo" argument, and the rest of the JSP is loaded. This is the way I'd like to take, since some informations mustn't be in the clear uselessly. My problem is that I don't really know where to start and how to do such a thing (do I use the same action through different stages ? Or do I put a lot of little actions that lead to a single big one ?) I hope I've been clear enough (I have difficulties finding the right phrases to express my problem), and that someone will be able to help me. Stéphane - 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]
Where to store application settings
Hi, I have a few settings in my webapp (address of the LDAP server, location of 2 or 3 files), which are in the source code at the moment. This makes it difficult to change them (and I have to recompile every time). Where is the best place to store these kinds of settings? I thought of using a RessourceBundle, what do you think? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practice for "dynamic reloading" of a part of the JSP ?
StÃphane Zuckerman wrote: > > 2Â) When I select "foo", then some javascript reloads the page (it does > a post) with the "foo" argument, and the rest of the JSP is loaded. This > is the way I'd like to take, since some informations mustn't be in the > clear uselessly. > > My problem is that I don't really know where to start and how to do such > a thing (do I use the same action through different stages ? Or do I put > a lot of little actions that lead to a single big one ?) I would highly recommend using XmlHttpRequest (aka ajax), which is much more user-friendly, much quicker to use and more flexible than reloading the page each time the user clicks on something. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practice for "dynamic reloading" of a part of the JSP ?
Thanks to both of you, Frank and Erik. I think I'll use a single action with states, as Erik suggested (I had this solution on my mind myself, but I wanted to check whether a better solution existed for my needs). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best practice for "dynamic reloading" of a part of the JSP ?
Stéphane Zuckerman wrote: Hello, I am to write JSP pages with a form that has some items (lists, or checkboxes) that depend on previous choices from the same form. So here I have two choices basically : 1°) Load all the information that is possibly needed for a given page, hide it, and only show what is relevant with some javascript. For instance, If I select some "foo" option in a list, then below in the form, a second list is loaded with "bar1", "bar2", "bar3é ... options, which are related to the "foo" option. Drawback : if there are lots of possible options, lots of texts, and lots of users, this might be too heavy a solution. If you are doing this type of thing, you should be using Swing, or some other thick client that you can actually program using an API. 2°) When I select "foo", then some javascript reloads the page (it does a post) with the "foo" argument, and the rest of the JSP is loaded. This is the way I'd like to take, since some informations mustn't be in the clear uselessly. My problem is that I don't really know where to start and how to do such a thing (do I use the same action through different stages ? Or do I put a lot of little actions that lead to a single big one ?) I would use the same action through different stages. I don't have a tool to recommend for this or anything. I am close to defining some coding patterns for it, but still I'm doing it slightly differently each time I do it, and I've not done it in a Struts app, but have a few times using my own request handlers. You are implementing a state machine, but that doesn't mean it has to be complicated. It involves 1) keeping track of the user's current command, and possibly his entire command stack (aka "wizard"), though often this can be implied by the current command, and 2) keeping track of any properties accumulated and modified during execution of each of those commands. You can do this tracking via embedded link/form parameters or HttpSession attributes or some combination of each (as always). For each post, I typically write to the cache until I reach the commit point, and then I write to the database and dump the cache. For each response I might read from the database or the cache or some combination of both. You have to remember with this approach to clean up session variables when the user "leaves" (finished or not) and to keep page loading times down (as always). Good luck, Erik I hope I've been clear enough (I have difficulties finding the right phrases to express my problem), and that someone will be able to help me. Stéphane - 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: Best practice for "dynamic reloading" of a part of the JSP ?
There are two solutions that I have used for years that I firmly believe to be better... (1) Simply use iFrames. The downside is that browser compatibility still leaves a little to be desired, but I *pretty* sure all the modern browsers support them. Also, depending on the way your security works you may find problems arise. (2) Use something of an AJAX approach. This is the one I usually go with. Google would seem to agree its a good idea since some of their coolest products are based on the concept (If only I had thought to file a patent five years ago when I first did it I'd be rich now! I didn't frankly think I had come up with anything unusual, now the world would seem to be indicating otherwise! But I digress...) The basic idea is that you have a hidden frame (set the size to 0 when defining the frameset). From this frame you do all your form submissions (or other form of messaging), and you use scripting based on what is returned to alter the "main" frame. The typical approach is to send and receive XML messages, but there is nothing to say you have to do this. Here is the usually given link to explain the AJAX concept: http://www.adaptivepath.com/publications/essays/archives/000385.php A slightly simpler way is to just have a form in the hidden frame that has all the possible fields you might need across your entire application. Then you submit the form and the response you get back has three things: first: the new content you will need to do something with in the visible frame, second: the form again of course and third: some scripting that knows what to do with the content and is executing onLoad. But remember, although the link provided lays out a relatively specific approach, the bottom line is the concept of a hidden frame to which messages sent and received and scripting to update the visible portion of the application. Beyond that (i.e., XML, XMLHttpRequest usage, etc.) is up to you. I think they actually say as much there. Here is one other link: http://www.fiftyfoureleven.com/resources/programming/xmlhttprequest/examples Although I haven't looked through all the references there, it seems to provide some working examples. Stéphane Zuckerman wrote: Hello, I am to write JSP pages with a form that has some items (lists, or checkboxes) that depend on previous choices from the same form. So here I have two choices basically : 1°) Load all the information that is possibly needed for a given page, hide it, and only show what is relevant with some javascript. For instance, If I select some "foo" option in a list, then below in the form, a second list is loaded with "bar1", "bar2", "bar3é ... options, which are related to the "foo" option. Drawback : if there are lots of possible options, lots of texts, and lots of users, this might be too heavy a solution. 2°) When I select "foo", then some javascript reloads the page (it does a post) with the "foo" argument, and the rest of the JSP is loaded. This is the way I'd like to take, since some informations mustn't be in the clear uselessly. My problem is that I don't really know where to start and how to do such a thing (do I use the same action through different stages ? Or do I put a lot of little actions that lead to a single big one ?) I hope I've been clear enough (I have difficulties finding the right phrases to express my problem), and that someone will be able to help me. Stéphane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] i18n: fmt:message versus bean:message
I haven't been using JSTL for i18n yet, just struts taglibs so I found the below very interesting when considering a move... I found this on the web: http://www.junlu.com/msg/30187.html The link suggests if you have a preferred approach, you can change the jstl resources configured to be used so they match what you expect. There's a code snippet in the link but I haven't tried it. I would guess you would configure the appropriate resources to use in a base action or filter as mentioned in the link so that your front-end code would never see it. Please write back what you find, I'm very interested in if you are able to change the i18n so it works as I'm accustomed to. Thanks!...djsuarez -Original Message- From: Angie Lin [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 7:34 PM To: user@struts.apache.org Subject: [OT] i18n: fmt:message versus bean:message This is off-topic, but in my Struts application, I've used all tags instead of tags and I'm encountering issues with my l10n. My questions: 1. Is it correct that JSTL fmt:message will NOT follow the parent chain of resources at an individual property level? 2. And is there anyway to force a parent chain? (read on if for my test case) I know that ResourceBundle establishes a parent chain by successively removing variant, country and language. Struts does the same thing though it doesn't actually use ResourceBundle - it has PropertyMessageResources. I know that JSTL doesn't follow the same lookup path. It instead only looks for specific locales (ServletRequest.getLocales() listed in order of preference) with a possible fallback locale (if configured in web.xml). However, I'm noticing that the fallback locale only appears to be used if the specific locale cannot be located at all. Here is my situation: ApplicationResources.properties: greeting=Hello there! goodbye=See ya! ApplicationResources_en.properties: greeting=Hello! goodbye=Bye! ApplicationResources_es.properties: greeting=Hola! Note that goodbye is missing from the spanish. EXAMPLE A: Assume my browser preferred locale is 'es'. And I have a fallbackLocale in web.xml set to 'en'. gives me Hola! See ya! Hola! ???goodbye??? The fallback is not even used. EXAMPLE B: Assume my browser preferred locale is 'fr'. And I have a fallbackLocale in web.xml set to 'en' gives me: Hello there! See ya! Hello! Bye! The struts tags used the parent chain to fall back to ApplicationResources.properties. But JSTL used the fallback of ApplicationResources_en.properties. Thanks, Angie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: focussing on image in jsp
hi why not have a anchor near or above image and focus or move to that anchor thanks --- Raghuveer Vellanki <[EMAIL PROTECTED]> wrote: > > can any one provide information on , > focussing on image in jsp when page loads. > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Best practice for "dynamic reloading" of a part of the JSP ?
Hello, I am to write JSP pages with a form that has some items (lists, or checkboxes) that depend on previous choices from the same form. So here I have two choices basically : 1°) Load all the information that is possibly needed for a given page, hide it, and only show what is relevant with some javascript. For instance, If I select some "foo" option in a list, then below in the form, a second list is loaded with "bar1", "bar2", "bar3é ... options, which are related to the "foo" option. Drawback : if there are lots of possible options, lots of texts, and lots of users, this might be too heavy a solution. 2°) When I select "foo", then some javascript reloads the page (it does a post) with the "foo" argument, and the rest of the JSP is loaded. This is the way I'd like to take, since some informations mustn't be in the clear uselessly. My problem is that I don't really know where to start and how to do such a thing (do I use the same action through different stages ? Or do I put a lot of little actions that lead to a single big one ?) I hope I've been clear enough (I have difficulties finding the right phrases to express my problem), and that someone will be able to help me. Stéphane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Password Validators
Are there any Struts Password validators that verify if the password is part of a "dictionary" ? Obviously building strong passwords needs web applications to check against a dictionary. Prashant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
focussing on image in jsp
can any one provide information on , focussing on image in jsp when page loads. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]