[Validator] indexed property validation
Can Validator validate indexed properties. For example: html:text property=element[0].value value=1/ html:text property=element[1].value value=bar/ html:text property=element[2].value value=foobar/ How could I make sure that element[0].value validates to an integer and then validate element[1].value and make sure it contains an alpha-based entry. So, in other words... Can I validate different indexes of a property with different Validation rules? Can I even validate an indexed property? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to use two combo-box which depend one on the other ?
We are using javascript for this purpose! On Thursday 30 January 2003 19:37, Heligon Sandra wrote: I search example of code that allow to display/manage two combox box dependent one on the other. For example I have two collections: - a first collection of Formation object The formation object has the following properties: - subject ( C++, Java, human resources) - duration ( 1day, 2 days) - a second collection of Employee object The employee object has the following properties: - function (manager, developer, ) In my Struts-JSP page I would like to use two combo-box to display these collections and if the user select the function developer I want to only list the software formations in the second combo box. Do I have to ask the web server each time the user select a new function, or is it possible to do this logic on the client side (with JavaScript probably ???). Thanks a lot in advance - 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: [List Of Struts SubProjects ]RE: Jboss and Struts Menu
I found one at http://jakarta.apache.org/struts/doc-1.0.2/userGuide/resources.html . Is there more? Thanks. -Original Message- From: Alireza Fattahi [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 01, 2003 11:03 AM To: 'Struts Users Mailing List' Subject: [List Of Struts SubProjects ]RE: Jboss and Struts Menu Struts Menu! Unfortunately, I have not heard about it. It makes me feel bad because I would use it in my previous project if I knew it :( Well it has passed but is there a list of these projects? May be a there are lot more out there. To Will_Etson: Sorry for no help! -Original Message- From: Will Etson [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 01, 2003 1:22 AM To: [EMAIL PROTECTED] Subject: Jboss and Struts Menu Is anyone using Jboss and StrutsMenu together? I trying to get the sample app to deploy, without much luck. I even recompiled the library with struts 1.1b3. No luck. Under tomcat 4.1.12 LE, every thing is fine. I've even tried some of the other fixes for JBoss ClassLoader/Struts problems. The struts-validator.war and the struts-example.war load just fine in Jboss. The exception I get: 17:54:43,950 ERROR [STDERR] java.lang.ClassNotFoundException: No ClassLoaders found for: com.fgm.web.menu.displayer.MenuDisplayerMapping 17:54:43,960 ERROR [STDERR] at org.apache.commons.digester.Digester.createSAXException(Digester.java:2383) 17:54:43,960 ERROR [STDERR] at org.apache.commons.digester.Digester.createSAXException(Digester.java:2409) 17:54:43,970 ERROR [STDERR] at org.apache.commons.digester.Digester.startElement(Digester.java:1271) . . . A full trace is attached --Versions Struts 1.1b3 StrutsMenu 1.2 Jboss 3.0.4 (embedded tomcat 4.1.12) Windows XP SP1 thanks, Will Etson P.S. I had similar issues with stxx... - 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]
How can I redirect a user to the previous page ?
Hi, I have a struts action to change the language. A link to this action is in the mainmenu of the webapplication. This link is always visible in the browser (while in my webapp). How can I redirect to the page the user was and display it in the selected language ? Is there a way to get the url where to user was previously ? Thanks for any hints. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
scope of a tool
hi again, Before i have said about scope of a tool and seem that nobody undestood me (my question), but now i have a text about this: the scope of the tool (as specified in your toolbox.xml) determines when your tool is created and what data is passed to the init() method (if an instance of ViewTool). a. if the scope is request, then a new instance of the tool is created for each request (and lives only that long). it will be instantiated with the current ViewContext (which is a ChainedContext when using the provided servlets). b. if the scope is session, then the tool is created and initialized only once for session. if a ViewTool, then init() will be passed the ViewContext that is current for the request on which the session tools are first made. you should also note that since session tools are kept in a HashMap within the session object, it is recommended (but not necessary) that they be serializable. c. application scoped tools are instantiated when the toolbox manager is first loaded (at servlet init time). if these implement the ViewTool interface, then the init() method will be passed the ServletContext to give access to application resources. so, the my question is: is right the code below? toolbox tool keyrequer/key classRequerTool/class /tool tool scope=session keyuser/key classUserTool/class /tool tool scope=application keyapp/key classAplicationTool/class /tool /toolbox _ Voce quer um iGMail protegido contra vírus e spams? Clique aqui: http://www.igmailseguro.ig.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Custom ActionServlet
ashokd wrote: Hi, To implement session expire, I written Custom ActionServlet, which extends the ActionServlet. --- References: [EMAIL PROTECTED] [EMAIL PROTECTED] 001f01c2c5b2$44e2a5b0$02c0@singlarc01 [EMAIL PROTECTED] 006701c2c5b6$5401d080$02c0@singlarc01 [EMAIL PROTECTED] Subject: Problem with Custom ActionServlet Date: Fri, 25 Jan 2002 01:32:48 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Friday the 25th January 2002 ! -- Peter Pilgrim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: [OT] Obscure Computer Languages
Maybe you should take a look at Haskell (http://www.haskell.org/) ... # -Ursprungliche Nachricht- # Von: Eric Rizzo [mailto:[EMAIL PROTECTED]] # Gesendet: Mittwoch, 29. Januar 2003 17:56 # An: Struts Users Mailing List # Betreff: Re: [OT] Obscure Computer Languages # # # David Bolsover wrote: # Smalltalk was (is) gr8! oop at its best. # Sadly never really took off. # # +1. It actually was the fastest growing language right before # and right # after the launch of Java. As much as I like Java, I do blame it's # marketing blitz and C-familiar syntax for the decline of Smalltalk # popularity. # # Still, Smalltalk is the most enjoyable, productive language I've ever # worked in. # # Eric # -- # Eric Rizzo # Software Architect # Jibe, Inc. # http://www.jibeinc.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: How can I redirect a user to the previous page ?
You might look at my LanguageSelectTag I posted in bugzilla: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12648 Struts will handle the different language as long as you set the Locale in the user's session. David From: Claude Glauser [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: How can I redirect a user to the previous page ? Date: Sat, 1 Feb 2003 13:05:15 +0100 Hi, I have a struts action to change the language. A link to this action is in the mainmenu of the webapplication. This link is always visible in the browser (while in my webapp). How can I redirect to the page the user was and display it in the selected language ? Is there a way to get the url where to user was previously ? Thanks for any hints. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I redirect a user to the previous page ?
Save the url in session against some key and use that to forward to when done on the second page. This way you can send the user to any page he/she came from. Affan - Original Message - From: Claude Glauser [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Saturday, February 01, 2003 5:05 PM Subject: How can I redirect a user to the previous page ? Hi, I have a struts action to change the language. A link to this action is in the mainmenu of the webapplication. This link is always visible in the browser (while in my webapp). How can I redirect to the page the user was and display it in the selected language ? Is there a way to get the url where to user was previously ? Thanks for any hints. - 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]
Multi-Select List Box
If I use a collection to create a multi-select html:select, how do I get the selected items back to my action class? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multi-Select List Box
Define a String[] in your form bean with the same name as your select box. David From: Cohan, Sean [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts (E-mail) [EMAIL PROTECTED] Subject: Multi-Select List Box Date: Sat, 1 Feb 2003 11:39:40 -0500 If I use a collection to create a multi-select html:select, how do I get the selected items back to my action class? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HTTP to HTTPS
Hi. I am trying to redirect/forward a user from a page that is served over HTTP to another page which uses HTTPS. The user will be on say this url http://www.mysite.com/MyApp/index.jsp. If the user comes to this page without being logged in I want to redirect him to https://www.mysite.com/AnotherApp/ASubcontext/login.jsp. When I use the forward tag, it only redirects the user to pages with http. How can I make the forward work with https? I would appreciate any help on this. Haytham - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multi-Select List Box
Thanks. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 01, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: Re: Multi-Select List Box Define a String[] in your form bean with the same name as your select box. David From: Cohan, Sean [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts (E-mail) [EMAIL PROTECTED] Subject: Multi-Select List Box Date: Sat, 1 Feb 2003 11:39:40 -0500 If I use a collection to create a multi-select html:select, how do I get the selected items back to my action class? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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: Is there a List navigater Tag to use with struts ? (fwd)
I'm in the process of pulling the source for this tag into it's own project. Once I extract it from the larger project that it's a part of, I'll post a link to the source for it. The code is written using the MVC pattern, which is quite differnt from the structure of Ed Hill's table tag, so hopefully this structure will allow future extension fairly easily. John On Fri, 31 Jan 2003, mahesh kagitha wrote: Hi, I would like to implement pagenation and sorting in my application(struts). Could you please direct me to get the desired by using your source code...Appreciate your help . Thanks mahesh! John York [EMAIL PROTECTED] wrote: Hi, I just noticed this message about paging tags posted on the archive for struts-user. I was using Ed Hill's display taglib for doing this sort of thing in the past, but it wasn't flexible enough for me, so I ended up completely rewriting it. I've been in the process of putting a proposal together for it to submit to Jakarta Taglibs, but I thought I'd mention it here. For a very simple test, check this out: http://www.johnyork.com/table/test.jsp For the jar and tld file, download here: http://www.johnyork.com/table/table.tar.gz I added many features to the list that Ed Hill had including exporting options and CSV download. You can logic taglibs within this tag so that you can optionally display certains columns. You can also easily add links within the columns by just specifying content in the body of the tags. The code is written fairly flexibly and should allow very easy extension to most common tasks. I would like to get this submitted to Jakarta. Can anyone guide me along the right path? If anyone is interesting in the source code, I can send you a link to it. Just let me know. Thanks, John - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now -- John York Software Engineer CareerSite Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multi-Select List Box
Can anyone post a sample? I don't know how to set the indexed properties. If I do: public void setSelectBox(int index, String item) { selectBox[index] = item; } i can get a NullPointerException or an ArrayIndexOutOfBoundsExceptions because I don't know selectBox array size... What is the best practice to do it?? 1. Using a Collection (is not allowed in JavaBeans specification) 2. Increasing dynamically the array size in the setSelectBox method (maybe too tricky ?). Thank you very much. David Graham wrote: Define a String[] in your form bean with the same name as your select box. David Guido Garcia Bernardo [EMAIL PROTECTED] [EMAIL PROTECTED] stat rosa pristina nomine, nomina nuda tenemus. http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [List Of Struts SubProjects ]RE: Jboss and Struts Menu
On Sat, 1 Feb 2003, Alireza Fattahi wrote: I found one at http://jakarta.apache.org/struts/doc-1.0.2/userGuide/resources.html . Is there more? The up-to-date version of the Struts Resources pages is online at: http://jakarta.apache.org/struts/resources/ Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multi-Select List Box
Guido == Guido [EMAIL PROTECTED] writes: Guido Can anyone post a sample? I don't know how to set the indexed properties. Guido If I do: Guido public void setSelectBox(int index, String item) { GuidoselectBox[index] = item; Guido } Guido i can get a NullPointerException or an ArrayIndexOutOfBoundsExceptions Guido because I don't know selectBox array size... Guido What is the best practice to do it?? Guido 1. Using a Collection (is not allowed in JavaBeans specification) Guido 2. Increasing dynamically the array size in the setSelectBox method (maybe Guido too tricky ?). If you don't know for sure what the size will be, then don't use an array, use an ArrayList. I believe the ensureCapacity() method would be used to increase the size of the collection if the given index is larger than the current size (-1). -- === David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] ; SCJP; SCWCD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multi-Select List Box
It should look like this: private String[] selectBox = null; public void setSelectBox(String[] selectBox){ this.selectBox = selectBox; } public String[] getSelectBox(){ return this.selectBox; } David From: Guido [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Multi-Select List Box Date: Sat, 1 Feb 2003 18:58:45 +0100 (MET) Can anyone post a sample? I don't know how to set the indexed properties. If I do: public void setSelectBox(int index, String item) { selectBox[index] = item; } i can get a NullPointerException or an ArrayIndexOutOfBoundsExceptions because I don't know selectBox array size... What is the best practice to do it?? 1. Using a Collection (is not allowed in JavaBeans specification) 2. Increasing dynamically the array size in the setSelectBox method (maybe too tricky ?). Thank you very much. David Graham wrote: Define a String[] in your form bean with the same name as your select box. David Guido Garcia Bernardo [EMAIL PROTECTED] [EMAIL PROTECTED] stat rosa pristina nomine, nomina nuda tenemus. http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Where to put ApplicationResources when deploying app as a jar
So far I have placed the ApplicationResources in the class' structure at the same level as the web components using struts. But I now want to deploy the application as a .jar and I cant find out where to put the language files. I hope that placing them in the jar file is mandatory. Thanks in advance. Med venlig hilsen / Best regards Søren Dalby
Re: Where to put ApplicationResources when deploying app as a jar
Placing them in the jar is not mandatory although probably a good idea. I named mine com.corp.app.ApplicationResources.properties so it's placed in the same directory as the class files in the com.corp.app package. David From: Soeren Dalby [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Where to put ApplicationResources when deploying app as a jar Date: Sat, 1 Feb 2003 21:44:53 +0100 So far I have placed the ApplicationResources in the class' structure at the same level as the web components using struts. But I now want to deploy the application as a .jar and I cant find out where to put the language files. I hope that placing them in the jar file is mandatory. Thanks in advance. Med venlig hilsen / Best regards Søren Dalby _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator and business rule
Hello, Why Struts-validator is so highly coupled with ActionForms? I think that is a good idea to use struts-validator to do some work in my business classes. How can I do that? Thanks, Regis Melo
Re: Validator and business rule
You can use the generic commons-validator in your business logic if you want. The Struts version and the commons version can use the same xml config file for the validation rules. David From: Regis Melo [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Validator and business rule Date: Sat, 1 Feb 2003 18:23:00 -0300 Hello, Why Struts-validator is so highly coupled with ActionForms? I think that is a good idea to use struts-validator to do some work in my business classes. How can I do that? Thanks, Regis Melo _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to put ApplicationResources when deploying app as a jar
Putting them in a jar file is not mandatory, and I cannot tell why you would like that requirement. You can though. The jar versus non-jar issue is not the issue about where to put them. You put them the same place in a jar as you would outside the jar. You can put them anywhere inside classes (they have to be reached on a classpath is the essential point) you want. The bottom line is that the where to put them is not relevant to the jar issue. Same inside as outside a jar. There is a structure inside a jar. Maybe I don't get what you are saying. My experience is that when I reply to messages like this and try to help the questioner inevitably flames me big time. I hope this is the exception. At 09:44 PM 2/1/03 +0100, you wrote: So far I have placed the ApplicationResources in the class' structure at the same level as the web components using struts. But I now want to deploy the application as a .jar and I cant find out where to put the language files. I hope that placing them in the jar file is mandatory. Thanks in advance. Med venlig hilsen / Best regards Søren Dalby LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Running a heartbeat program in struts.
I am planning on putting a small heartbeat program as part of my Struts application. The heartbeat program will request HTTP headers from an external web server every 5 minutes or so, and if the response is not a 200,will send email to 3 people. I plan on using a java class that starts a thread in the init method of the controller servlet. This thread will sleep for 5 minutes between sending requests to the external web server. It in turn will call a custom mail-sending class if the response is not 200. First, does anyone have any code like this, before I start coding, Second, any comments on my approach, Third, is there a better way (in Java of course). Thanks for any comments you have Ron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running a heartbeat program in struts.
Keep this in mind. What do you do if the http connection is down for longer than 5,10,15 minutes? Receiving lots of email with the same message can be very anoying. -D - Original Message - From: Ron Day [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Saturday, February 01, 2003 9:46 PM Subject: Running a heartbeat program in struts. I am planning on putting a small heartbeat program as part of my Struts application. The heartbeat program will request HTTP headers from an external web server every 5 minutes or so, and if the response is not a 200,will send email to 3 people. I plan on using a java class that starts a thread in the init method of the controller servlet. This thread will sleep for 5 minutes between sending requests to the external web server. It in turn will call a custom mail-sending class if the response is not 200. First, does anyone have any code like this, before I start coding, Second, any comments on my approach, Third, is there a better way (in Java of course). Thanks for any comments you have Ron - 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: Running a heartbeat program in struts.
Take a look at java.util.Timer and java.util.TimerTask. More specifically Timer.scheduleAtFixedRate(). It will greatly simplify your background process. robert -Original Message- From: Ron Day [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 02, 2003 12:47 AM To: Struts Users Mailing List Subject: Running a heartbeat program in struts. I am planning on putting a small heartbeat program as part of my Struts application. The heartbeat program will request HTTP headers from an external web server every 5 minutes or so, and if the response is not a 200,will send email to 3 people. I plan on using a java class that starts a thread in the init method of the controller servlet. This thread will sleep for 5 minutes between sending requests to the external web server. It in turn will call a custom mail-sending class if the response is not 200. First, does anyone have any code like this, before I start coding, Second, any comments on my approach, Third, is there a better way (in Java of course). Thanks for any comments you have Ron - 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: Running a heartbeat program in struts.
Why do you need Struts to do this? David From: Ron Day [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Running a heartbeat program in struts. Date: Sat, 1 Feb 2003 23:46:58 -0600 I am planning on putting a small heartbeat program as part of my Struts application. The heartbeat program will request HTTP headers from an external web server every 5 minutes or so, and if the response is not a 200,will send email to 3 people. I plan on using a java class that starts a thread in the init method of the controller servlet. This thread will sleep for 5 minutes between sending requests to the external web server. It in turn will call a custom mail-sending class if the response is not 200. First, does anyone have any code like this, before I start coding, Second, any comments on my approach, Third, is there a better way (in Java of course). Thanks for any comments you have Ron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Running a heartbeat program in struts.
I don't, I have a big Struts application already that needs to use this functionalitiy. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 01, 2003 6:14 PM To: [EMAIL PROTECTED] Subject: Re: Running a heartbeat program in struts. Why do you need Struts to do this? David From: Ron Day [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Running a heartbeat program in struts. Date: Sat, 1 Feb 2003 23:46:58 -0600 I am planning on putting a small heartbeat program as part of my Struts application. The heartbeat program will request HTTP headers from an external web server every 5 minutes or so, and if the response is not a 200,will send email to 3 people. I plan on using a java class that starts a thread in the init method of the controller servlet. This thread will sleep for 5 minutes between sending requests to the external web server. It in turn will call a custom mail-sending class if the response is not 200. First, does anyone have any code like this, before I start coding, Second, any comments on my approach, Third, is there a better way (in Java of course). Thanks for any comments you have Ron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - 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: Running a heartbeat program in struts.
It will only send email once, and set a flag. Flag will be reset when http connection comes up again. But thanks for the comment. R -Original Message- From: Dan Tran [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 01, 2003 6:00 PM To: Struts Users Mailing List Subject: Re: Running a heartbeat program in struts. Keep this in mind. What do you do if the http connection is down for longer than 5,10,15 minutes? Receiving lots of email with the same message can be very anoying. -D - Original Message - From: Ron Day [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Saturday, February 01, 2003 9:46 PM Subject: Running a heartbeat program in struts. I am planning on putting a small heartbeat program as part of my Struts application. The heartbeat program will request HTTP headers from an external web server every 5 minutes or so, and if the response is not a 200,will send email to 3 people. I plan on using a java class that starts a thread in the init method of the controller servlet. This thread will sleep for 5 minutes between sending requests to the external web server. It in turn will call a custom mail-sending class if the response is not 200. First, does anyone have any code like this, before I start coding, Second, any comments on my approach, Third, is there a better way (in Java of course). Thanks for any comments you have Ron - 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: Running a heartbeat program in struts.
Thanks for tip. R -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 01, 2003 6:03 PM To: Struts Users Mailing List Subject: RE: Running a heartbeat program in struts. Take a look at java.util.Timer and java.util.TimerTask. More specifically Timer.scheduleAtFixedRate(). It will greatly simplify your background process. robert -Original Message- From: Ron Day [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 02, 2003 12:47 AM To: Struts Users Mailing List Subject: Running a heartbeat program in struts. I am planning on putting a small heartbeat program as part of my Struts application. The heartbeat program will request HTTP headers from an external web server every 5 minutes or so, and if the response is not a 200,will send email to 3 people. I plan on using a java class that starts a thread in the init method of the controller servlet. This thread will sleep for 5 minutes between sending requests to the external web server. It in turn will call a custom mail-sending class if the response is not 200. First, does anyone have any code like this, before I start coding, Second, any comments on my approach, Third, is there a better way (in Java of course). Thanks for any comments you have Ron - 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: Running a heartbeat program in struts.
This is the BEST open source cron like timer that I have seen. It is very robust and extendable. I have used it in several webapps (in a virtual hosting environment running several webapps) doing exactly what you are doing. Check this link out. I think it will provide you with what you need. http://www.part.net/quartz.html Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Ron Day [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 01, 2003 11:38 PM To: Struts Users Mailing List Subject: RE: Running a heartbeat program in struts. Thanks for tip. R -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 01, 2003 6:03 PM To: Struts Users Mailing List Subject: RE: Running a heartbeat program in struts. Take a look at java.util.Timer and java.util.TimerTask. More specifically Timer.scheduleAtFixedRate(). It will greatly simplify your background process. robert -Original Message- From: Ron Day [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 02, 2003 12:47 AM To: Struts Users Mailing List Subject: Running a heartbeat program in struts. I am planning on putting a small heartbeat program as part of my Struts application. The heartbeat program will request HTTP headers from an external web server every 5 minutes or so, and if the response is not a 200,will send email to 3 people. I plan on using a java class that starts a thread in the init method of the controller servlet. This thread will sleep for 5 minutes between sending requests to the external web server. It in turn will call a custom mail-sending class if the response is not 200. First, does anyone have any code like this, before I start coding, Second, any comments on my approach, Third, is there a better way (in Java of course). Thanks for any comments you have Ron - 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: HTTP to HTTPS
See http://struts.ditlinger.com/ -Original Message- From: Haytham Samad [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 01, 2003 8:33 PM To: Struts User List Subject: HTTP to HTTPS Hi. I am trying to redirect/forward a user from a page that is served over HTTP to another page which uses HTTPS. The user will be on say this url http://www.mysite.com/MyApp/index.jsp. If the user comes to this page without being logged in I want to redirect him to https://www.mysite.com/AnotherApp/ASubcontext/login.jsp. When I use the forward tag, it only redirects the user to pages with http. How can I make the forward work with https? I would appreciate any help on this. Haytham - 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]
what's the right syntax for logic:iterate
Hi, I have a variable type which I'd like to use like so logic:iterate id=element collection=%= myVector % li html:link page=/action%= type %.do bean:write name=element / /html:link/li /logic:iterate But no matter what I try I don't seem to be able to get the link to do the right thing.. Ideas? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:text tag indexed attribute
Thanks David. That worked for the value attribute: logic:iterate name=aForm property=stringArray id=aString html:text indexed=true property=aString value='%= aString.toString() %' / /logic:iterate BUT, this resolves to an HTML text tag of: input type=text name=org.apache.struts.taglib.html.BEAN[0].aString value=somevalue This is my larger question --- what I'm trying to get is input type=text name=aString[0] value=somevalue Using the Struts html:text tag with indexed=true, I am iterating over a collection of String objects, NOT a collection of bean objects with properties. Therefore, instead of using the bean name for the name attribute and the bean property for the property attribute, like all of the examples I have seen, I do not know what to put for the name and property attributes, because this is a collection of Strings, not beans, and the String objects do NOT have a property. Please help ! I've been trying to get this to work for 2 days now. Thanks, Charlie On Friday 31 January 2003 07:43 pm, you wrote: Charlie Toohey [EMAIL PROTECTED] writes: Thanks David. I tried your suggestion although I still have no idea what to use for the value of property --- any way, I can't get it work. I can not get my .jsp to compile using your suggested scriptlet for the value attribute. Here is what I have got: logic:iterate name=aForm property=stringArray id=aString .. html:text indexed=true property=aString value='%= aString %' Charlie / .. /logic:iterate This gives me the following exception: cannot resolve symbol symbol : method setValue (java.lang.Object) location: class org.apache.struts.taglib.html.TextTag _jspx_th_html_text_0.setValue(aString ); Change '%= aString %' to '%= aString.toString() %', then see how far you get. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Controller
Hi, I have read some information about controller tag which is used in strusts_config.xml but I did not get the idea. WHERE this controller could be usefull? What I have read is: from theserverside.com The controller element is new to version 1.1. Prior to version 1.1, the ActionServlet contained the controller functionality and you had to extend that class to override the functionality. In version 1.1 however, Struts has moved most of the controller functionality to the new RequestProcessor class. The ActionServlet still receives the requests, but then delegates the request handling to an instance of the RequestProcessor class that has been installed. This allows you to declaratively assign the processor class and modify its functionality. Alireza. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:text tag indexed attribute
Charlie == Charlie Toohey [EMAIL PROTECTED] writes: Charlie Thanks David. That worked for the value attribute: Charlie logic:iterate name=aForm property=stringArray id=aString Charliehtml:text indexed=true property=aString value='%= aString.toString() Charlie %' / Charlie /logic:iterate Charlie BUT, this resolves to an HTML text tag of: Charlie input type=text name=org.apache.struts.taglib.html.BEAN[0].aString Charlie value=somevalue Charlie This is my larger question --- what I'm trying to get is Charlie input type=text name=aString[0] value=somevalue Charlie Using the Struts html:text tag with indexed=true, I am iterating over a Charlie collection of String objects, NOT a collection of bean objects with Charlie properties. Therefore, instead of using the bean name for the name Charlie attribute and the bean property for the property attribute, like all of the Charlie examples I have seen, I do not know what to put for the name and property Charlie attributes, because this is a collection of Strings, not beans, and the Charlie String objects do NOT have a property. Charlie Please help ! I've been trying to get this to work for 2 days now. This is where it gets a little tricky to visualize, and I'm not sure I'm going to get this right, but I'll give it a try. First of all, you should change aString to something that doesn't have a capital in the first two characters of the property name. I believe that triggers some funny behavior in the JavaBeans spec. If you just change it to astring or someString, that would work fine. Now, try adding a name parameter to your html:text tag. I don't know what to call it yet, but let's call it stringObj. Now, add an indexed getter (may not need the getter) and setter to your form bean, for the stringObj property. The value parameter will be a String. That may work. Personally, I find indexed tags confusing, but I haven't tried to use them very much. It seems to me that it's more understandable to build the array reference expression manually, and this is easier to do if you use Struts-EL, as the EL expressions are more concise than scriptlet expressions. -- === David M. Karr ; Java/J2EE/XML/Unix/C++ [EMAIL PROTECTED] ; SCJP; SCWCD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Controller
On Sun, 2 Feb 2003, Alireza Fattahi wrote: Date: Sun, 2 Feb 2003 09:58:07 +0330 From: Alireza Fattahi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: Struts Controller Hi, I have read some information about controller tag which is used in strusts_config.xml but I did not get the idea. WHERE this controller could be usefull? The controller element in struts-config.xml does not define an object per se. Instead, it defines a set of configuration parameters that modify how the org.apache.struts.action.RequestProcessor class will perform its work. For example, if you do *not* want the RequestProcessor to automatically create a Locale object (from the user's browser configuration for language preference), and store it in the session, you would say: controller ... locale=false .../ in your struts-config.xml file. By default, Struts does this for you (because most people want it), but it's your option to turn the feature off if you don't need it. In Struts 1.0.2, everything in the controller element was set via initialization parameters to the controller servlet itself. That does not work for Struts 1.1, because you can have different settings for different application modules. Thus, we had to move the settings into the struts-config.xml file instead. What I have read is: from theserverside.com The controller element is new to version 1.1. Prior to version 1.1, the ActionServlet contained the controller functionality and you had to extend that class to override the functionality. In version 1.1 however, Struts has moved most of the controller functionality to the new RequestProcessor class. The ActionServlet still receives the requests, but then delegates the request handling to an instance of the RequestProcessor class that has been installed. This allows you to declaratively assign the processor class and modify its functionality. You can, in fact, have your own separate RequestProcessor subclass per application module, if you want. However, the most common use for the controller element is to configure things like create a Locale object automatically on a per-module basis, instead of having to make one global decision for all modules. Alireza. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]