Re: Editing a database record best practice?
OTT, as in amazing dull to code up yet another value object... I've got value objects coming out of my ears :) Jonathan Message History From: Adam Hardy [EMAIL PROTECTED] on 12/02/2002 09:49 PST Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: Editing a database record best practice? On Tue, 12 February 2002, Jonathan Gibbons wrote: I guess the really OTT answer is: User/GUI = Form Object, all strings Mid Tier = Value object holding equivalent fields for each form field, but in native data type, but no struts code. DB = EJB, local interfaces. OTT as in the case of an app which you know you're going to deploy on a webfarm? In which case the DB will probably be on a seperate server, the webservers on another, possibly with EJB on board, possibly EJBs on their own server? The technical issue is whether you can realistically pass a form object from a performance point of view from one server to another. Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: App Design
Is there a good argument for using frames? It needs to be good, they obviously are problematic to use. Beware the page linked to below is dated Dec. 1996 - most of what's in it is obsolete! --- stf [EMAIL PROTECTED] wrote: frames suck: I don't think it's a good idea to separate your page-flow onto two different layers, one being the javscript/frame-constellation, the other the struts config-files. What exactly are you trying to achive? If you just want to reuse your navigation, then go for some kind of template-engine(e.g. tiles, even simple, maybe parametrized includes will be better than frames..) - if you have a designer, who insists, that frames are more usable or just look better, have him read this: http://www.useit.com/alertbox/9612.html - it's already so old that i thought, everybody knows it by now ;) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 9:10 PM Subject: App Design Hi all, I am thinking of structuring an application as follows, and would appreciate any advice and ideas of how to do this: There will be two frames. First is a navigation frame where the user presses a button to determine the JSP that is loaded into the second frame. Each possible JSP for the second frame will have form. If a user is entering data into the form, and then presses a button on the navigation frame to go to a different jsp/form, I want to save the partially entered form data from the page the user is leaving. Then when the user goes back to the first page they can continue where they left off. I have been prototyping an idea; the navigation frame uses JavaScript to submit the form and redirect the old page to the new desired page. So far I have accomplished that when the form is submitted the action does not really do anything, so the form data is saved in the bean. But how do I accomplish the redirect? Any ideas are greatly appreciated. Mark Glatzer *** Disclaimer This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and/or CONFIDENTIAL or both. This email is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this email is not an intended recipient, you have received this email in error and any review, dissemination, distribution or copying is strictly prohibited. If you have received this email in error, please notify the sender immediately by return mail and permanently deleting the copy you received. Thank you. *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Log4J and Struts - using Chiki's log4j configuration and getting tons of messages
Hi Matt I can only assume that the initial error (when you have no log4j.properties file) is down to the extensions you are using being dependant on log4j - which means you need the properties file so it knows what to do. Using the Chiki log4j sorts this out - but there are a couple of things which may be giving you too much detail in your logs. The category definitions only affect logging messages going thru that category, so changing them in the properties file will only affect the messages which go thru that category. Then there is the debug level as detailed in your web.xml One question to consider is which category the messages are coming through (from one of the extensions), and then include THAT category in your log4j properties file at the appropriate level. You should find some mention of the Category in use in the extensions documentation. By using the Chiki config for log4j, the used Category isnt mentioned - isnt set to any level - so you're getting all the messages. By including it and setting the level as required will reduce the number of messages. I'd check your web.xml too. As the one included here doesn't have debug levels set to zero...I'm not totally familiar with the extensions you are using (yet) but the messages must be coming from them if you are not using any loggin in your app yet. So check the docs that come with them (and examples) for any mention of the log4j dependancy and configuration re the Category being used.. Hope this helps Ghoot -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: 12 February 2002 23:50 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Log4J and Struts - using Chiki's log4j configuration and getting tons of messages Hello, I am trying to implement log4j in my application. I'm using the Struts nightly build. If I don't have a log4j.properties file in my WEB-INF/classes directory, I get the following error: log4j:ERROR No appenders could be found for category (org.apache.commons.digester). log4j:ERROR Please initialize the log4j system properly. I think this is being kicked off my one of the servlets in my web.xml because I haven't even written any code yet, but I am using Validator, Workflow and Tiles. So I copied the log4j.cfg file from Chiki's WEB-INF directory, renamed and put in in its place. Now I get more logging messages than I can stand, and I have changed all the debug and detail values in web.xml to 0. My log file on startup is over 1000 lines long. Does anyone have any idea how to configure this properly - or point me towards a resource that does. A simple search the archives is fine as well. Thanks, Matt Log4j.properties file: log4j.rootCategory=debug, stdout, R log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=%p [%t] [%c] %C{1}.%M(%L) | %m%n log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=onpoint.log log4j.appender.R.MaxFileSize=100KB # Keep one backup file log4j.appender.R.MaxBackupIndex=1 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n log4j.category.Init=DEBUG log4j.category.Config=DEBUG log4j.category.Actions=DEBUG log4j.category.Repository=DEBUG log4j.category.Persister=DEBUG log4j.category.Translator=DEBUG log4j.category.Cache=DEBUG log4j.category.Validator=DEBUG log4j.category.Registry=DEBUG log4j.category.Event=DEBUG First few lines of my log file: DEBUG main org.apache.commons.digester - Pop org.apache.struts.action.ActionForward DEBUG main org.apache.commons.digester - ignorableWhitespace( ) DEBUG main org.apache.commons.digester - endElement(,action,action) Here are the servlets in my web.xml: !-- Workflow Registry Servlet Configuration -- servlet servlet-nameregistry/servlet-name servlet-classcom.onpoint.webapp.workflow.RegistryServlet/servlet-class init-param param-nameregistry/param-name param-value/WEB-INF/workflow.xml/param-value /init-param init-param param-namedebug/param-name param-value999/param-value /init-param init-param param-namedetail/param-name param-value999/param-value /init-param load-on-startup1/load-on-startup /servlet !-- Wizard Activity Servlet Configuration -- servlet servlet-namewizard/servlet-name servlet-classorg.apache.commons.workflow.web.ActivityServlet/servlet-class init-param
Re: Editing a database record best practice?
Sadly, the web tier has special requirements for value objects that most (reasonable) value objects cannot meet. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg19338.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg08070.html But ActionForms should not be passed up to the business tier, except like any other JavaBean that can be mined through reflection. The general approach is to transfer the data from the ActionForm into a standard value object, that could, for example, be used in a remote call. Of course, this is just for data collection. For data presentation, any old value object you already have should work just fine. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Jonathan Gibbons wrote: OTT, as in amazing dull to code up yet another value object... I've got value objects coming out of my ears :) Jonathan Message History From: Adam Hardy [EMAIL PROTECTED] on 12/02/2002 09:49 PST Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: Editing a database record best practice? On Tue, 12 February 2002, Jonathan Gibbons wrote: I guess the really OTT answer is: User/GUI = Form Object, all strings Mid Tier = Value object holding equivalent fields for each form field, but in native data type, but no struts code. DB = EJB, local interfaces. OTT as in the case of an app which you know you're going to deploy on a webfarm? In which case the DB will probably be on a seperate server, the webservers on another, possibly with EJB on board, possibly EJBs on their own server? The technical issue is whether you can realistically pass a form object from a performance point of view from one server to another. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Somes missing tags in tld files ?
Hello, I read (http://jakarta.apache.org/struts/struts-logic.html) there's the notEmpty tag in the logic taglib. But, when I look at the struts-logic.tld file, nothing like that appears. What does it mean ? Does it mean that the logic:notEmpty tag will be included in Struts 1.1 ? For example, the same problem appears for the format attribute of the bean:write tag. It's not defined in the tld file!! Thank you Samuel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Somes missing tags in tld files ?
Yes. The logic:notEmpty tag is in the Nightly Build. The website is still confusing about which documents go with what. I've a plan for fixing it, and just have to clear some time to implement it. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Samuel Judith wrote: Hello, I read (http://jakarta.apache.org/struts/struts-logic.html) there's the notEmpty tag in the logic taglib. But, when I look at the struts-logic.tld file, nothing like that appears. What does it mean ? Does it mean that the logic:notEmpty tag will be included in Struts 1.1 ? For example, the same problem appears for the format attribute of the bean:write tag. It's not defined in the tld file!! Thank you Samuel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Somes missing tags in tld files ?
Samuel, Which version of Struts are you using? As much as I know, the information on the jakarta page reflect the nightly build, which could differ from your version. Marcel -Original Message- From: Samuel Judith [mailto:[EMAIL PROTECTED]] Sent: Friday, November 16, 2001 12:10 PM To: [EMAIL PROTECTED] Subject: Somes missing tags in tld files ? Hello, I read (http://jakarta.apache.org/struts/struts-logic.html) there's the notEmpty tag in the logic taglib. But, when I look at the struts-logic.tld file, nothing like that appears. What does it mean ? Does it mean that the logic:notEmpty tag will be included in Struts 1.1 ? For example, the same problem appears for the format attribute of the bean:write tag. It's not defined in the tld file!! Thank you Samuel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: App Design
ok, the link is rather old, and maybe also a bit dogmatic: But most of it still holds true. Apart from the usability-hassles described in the link, in my experience you can add a bunch of problems you get when you try to generate your frames programmatically (the simplest one being the requirement to generate a link to the preceding page(whatever that means when you use frames) that also had to work when javascript is deactivated - the history.back() at last works halfway consistent for almost all browsers, but it took them a while...) - then you have the problem with deep-links into the site (you almost always end up with an xml-file that contains the complete site-layout and from which you can generate right frameset - almost always buggy and hard to maintain...), synching data in different frames (using an equally bad mixture of javascript/sevlet-code...). There are some applications out there which almost all have to something with configuration (configuring a new car, a new pc and so on) which make heavy use of javascript and frames to maintain the state of the configuration: Although i agree that there almost always a whole lot of data flows from and to the browser, which can/should be cached in frames, in reality these configrurators almost always seem to be crashing short before purchasing your new car, which took you about an hour to configure... so, no, i don't see any real reason for using frames for other things than doing some static designer-portfolio-pages (but i think they are currently overusing flash for this purpose...) ps: excuse me for this elaborate rage, but i have been burnt before in projects where i was forced to use frames - Original Message - From: Keith [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 10:25 AM Subject: Re: App Design Is there a good argument for using frames? It needs to be good, they obviously are problematic to use. Beware the page linked to below is dated Dec. 1996 - most of what's in it is obsolete! --- stf [EMAIL PROTECTED] wrote: frames suck: I don't think it's a good idea to separate your page-flow onto two different layers, one being the javscript/frame-constellation, the other the struts config-files. What exactly are you trying to achive? If you just want to reuse your navigation, then go for some kind of template-engine(e.g. tiles, even simple, maybe parametrized includes will be better than frames..) - if you have a designer, who insists, that frames are more usable or just look better, have him read this: http://www.useit.com/alertbox/9612.html - it's already so old that i thought, everybody knows it by now ;) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 9:10 PM Subject: App Design Hi all, I am thinking of structuring an application as follows, and would appreciate any advice and ideas of how to do this: There will be two frames. First is a navigation frame where the user presses a button to determine the JSP that is loaded into the second frame. Each possible JSP for the second frame will have form. If a user is entering data into the form, and then presses a button on the navigation frame to go to a different jsp/form, I want to save the partially entered form data from the page the user is leaving. Then when the user goes back to the first page they can continue where they left off. I have been prototyping an idea; the navigation frame uses JavaScript to submit the form and redirect the old page to the new desired page. So far I have accomplished that when the form is submitted the action does not really do anything, so the form data is saved in the bean. But how do I accomplish the redirect? Any ideas are greatly appreciated. Mark Glatzer *** Disclaimer This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and/or CONFIDENTIAL or both. This email is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this email is not an intended recipient, you have received this email in error and any review, dissemination, distribution or copying is strictly prohibited. If you have received this email in error, please notify the sender immediately by return mail and permanently deleting the copy you received. Thank you. *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: classnotfound
You are being way too vague, Steve. Let's see the exact error msg, the relevant JSP and form bean code (including your package statement) and the action mapping in the struts config file. Mark Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Steven Dahlin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 5:51 PM I am getting an error message indicating that a class cannot be found. It occurs after entering a user login and password into login.jsp and pressing the submit button. The class that cannot be found is: logwork.entities.Users. I have the following structure for my app: logwork (the jsps reside here) | +--WEB-INF (web.xml, struts-config.xml, etc.) | +-- classes | +-- logwork | +-- entities (logwork.entities.Users extending ActionForm resides here) +-- bo (logwork.bo.UsersBO for the business objects) +-- db (logwork.db.UsersDAO for the data access) Can anyone tell me what I might be doing wrong or how I might provide clearer information? Thanks, Steve -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Basic Struts Question
Hi, My company is evaluating whether or not to introduce Struts into our application architecture as part of our next release, and I have a relatively simple/stupid question about how best to build the set of screens that we're using as part of our evaluation process. In this example, I have a screen that displays a list of users. The screen needs several request parameters to identify which list of users to display. From this page, the user can go to a separate worksheet to add an additional user to the collection, or modify an existing user, and when they successfully save the list page for the user collection they are modifying is redisplayed with the new data. The parameters for the list page need to be specified at run-time, since they are dependent on the selected list and the user logged in. For the list page, I have an action that uses the request parameters to get the list of data and add it to the request as an attribute so that the JSP can display the data. For the worksheet page, I've implemented a read action to get the data (in a modify scenario) and then forward to a worksheet page, and a save action to process the worksheet and save the data to the business tier. The confusion I'm having comes in when the save action successfully processes the request and needs to perform the forward to send the user back to the list page. The list page needs the list of users to be put into the request object for it. The list action looks for the additional data it needs to populate the list as request parameters, not as attributes, and Struts does not appear to auto-populate ActionForm beans from request attributes, just the parameters. So, which of the options below would appear to make the most sense when building a Struts based web app? - have the save action set the additional data as request attributes and have the success mapping forward to the get list action. The list action will just need to check if it's ActionForm object was populated from the request parameters, and if not, get the data it needs from the request attributes. - have the both the get list and save actions be capable of fetching the list data and populating it for the list screen, and have the save action's success mapping go directly to the list JSP. - build an ActionForward object to do a browser redirect using the struts-config.xml mapping to get the URI and then append additional parameters to the URI to get to the next page - store the information needed by the list page in the session and update it there as well as on the business tier (rather not do that since we already overuse the session to keep stuff around, and I was hoping to get the team to become better at keeping session usage down). Seems like the first option is the best, but I wanted to make sure I wasn't missing anything. Thanks for any help/advice. Robb Nedwick __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Editing a database record best practice?
EJBs have their uses and sometimes are required (JMS, for example). Further, an EJB (especially a session bean) is no slower than any other Java entity accessing a database (which has more to do with network latency, and database performance than EJB technology) and provides great separation of the view from the model, plus, with the latest efficiencies in JVM and container technology there is no performance hit for using EJBs in and of themselves. All things being equal, performance, as has always been the case, is mainly determined by the code. Finally, where in the world did you get the idea that Sun has a hardware stake in promoting EJBs? That took a great leap of imagination! Cheers! Mark P.S. .Net is great technology. Do not let the typically fanatical pro-Java/anti-Microsoft bias blind you to the possibilities. Java 1.1 already runs in it, C# is a great combination of the best of C and Java 2.0, and someone is bound to develop a compatible Java 2.0 byte compiler for the framework within a year (rumor is IBM is already doing it). My guess is that .Net will encompass Unix as well in a fairly short period of time and the world of Net application development will be split between EJB and .Net developers. Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- Sent: Tuesday, February 12, 2002 6:25 PM From: Vic Cekvenich [EMAIL PROTECTED] === Oh, and... avoid EJB (it tends to be overused by newer developers, and is slow to develop and slow performance. Sun's way of selling hardware, but when projects fail, manager makes you go to : MS .NET ) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Traffic
No. But you can read from the archives without being a member of the list. Mark -Original Message- From: Michael [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:09 PM To: Struts Users Mailing List Subject: RE: Traffic is it possible to be a member of the list an NOT get any email sent to me? i'd rather just read from archives.. -Original Message- From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 12:10 PM To: [EMAIL PROTECTED] Subject: Re: Traffic Subject: Re: Traffic From: Vic Cekvenich [EMAIL PROTECTED] === This list is cloned at news.basebeans.com so you can see and post everything and not have to delete. Vic [EMAIL PROTECTED] wrote: I really do agree that users of the mailing list should be *strongly* encouraged to search the archives (maybe just with STA, though, so they don't get too offended!). So many questions come up that have been tackled over and over again. I was off for a week last week and had almost 900 messages in my inbox to delete, which is crazy. Dave Galbreath, Mark [EMAIL PROTECTED] on 02/12/2002 07:27:17 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: RE: Traffic It's going to get worse. Nevertheless, you will never be able to manage the number/technical level of users in an open forum. SERVLET-INTEREST became too congested with basic setup and config questions by people too lazy to search the archive for an answer (and how many scores of questions have been asked here regarding ActionForm in just the past 2 weeks?) so a few guys created ADVANCED-SERVLET-INTEREST and began regulating the level of users. One thing that helped, however, was being brutally blunt with obviously lame users and telling them to STFA (search the f*cking archives), STFW (...web) and RTFM. This started a couple of flame wars, and the Sun moderator finally had to banish a few people, but the quality and quantity of posts changed considerably for the better. I'm not suggesting that's an answer, but my delete key has been getting a lot of attention lately Mark -Original Message- From: [EMAIL PROTECTED] Sent: Monday, February 11, 2002 9:36 PM Well, it's not dibilitating. I can hack it. I guess I'm neutral on this one. - Cody Barr, Scott [IBM GSA] [EMAIL PROTECTED] on 02/11/2002 08:01:41 PM I disagree. Most messages are relatively small, and so long as people dont send attachments there generally isn't too much of a problem. The delete key is a great filter :) Scott -Original Message- From: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 12:28 PM I second that motion. We do not have filtering capability here at my work so I have to manually delete messages! - Cody Mark Rines [EMAIL PROTECTED] on 02/11/2002 07:19:43 PM Phew, I vote that we split up this mail list into several topics such as installation, configuration, add-ons (such as strutsTests) and extending the various ActionXXX classes. I am really having trouble keeping up with all (over 110 just today) the email. Mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: iterate tag usage
I didn't see any code that suggested primitives were being passed. Nevertheless, there's no question primitive arrays are faster than Vectors (about 40 times faster!) and ArrayLists (about 4 times faster). Cheers! Mark -Original Message- From: Arron Bates [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:26 PM Mark, You're absolutely correct. As for the you can't use Object[] stuff read the code. Primitive arrays are perfectly fine, and most likely faster again than ArrayLists. Arron. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Best way to write Export files
Hi there, I have to write export files to an another server.The code I am using is not seams to be working fine .Some times it rewrites on an existing file.I am giving my code sample here access = ACCESS_WRITE; long time = System.currentTimeMillis(); long timeSpawned = time; // this routine tries 30 seconds // to open a file, if not successful while(!isOpen (((timeSpawned-time)/1000)30)) { timeSpawned = System.currentTimeMillis(); try { out = new BufferedWriter(new FileWriter(filename,true)); isOpen = true; } catch(IOException e) { } } } if(isOpen) { String line = ; for(int i=0; iattributes.length; i++) { String att = person.getAttribute(attributes[i]); if(att==null attributes[i].equals(PersonKeys.DATATYPE)) att = cha; if(att==null) att = ; line += att + delimiter; } out.write(line); out.newLine(); out.flush(); } Is there is an another better way to do this? appreciating your replay Alvin alvin kuttikkat antony Internet und Virtuelle Hochshule Directory Universität München Leopoldstr .3 80802 München Germany Office Tel + 49.89.21025979 Office Fax + 49.89.21025980
RE: iterate tag usage
Thanks all. My code works now. But I have one more question: when i use logic:empty or logic:notEmpty, I got error: No such tag empty in the tag library imported with prefix logic Could you tell me how to make it work? --- Henry Lu MCITphone: (734) 936-2063 University of Michigan Medical Center fax: (734) 763-4372 On Wed, 13 Feb 2002, Galbreath, Mark wrote: I didn't see any code that suggested primitives were being passed. Nevertheless, there's no question primitive arrays are faster than Vectors (about 40 times faster!) and ArrayLists (about 4 times faster). Cheers! Mark -Original Message- From: Arron Bates [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:26 PM Mark, You're absolutely correct. As for the you can't use Object[] stuff read the code. Primitive arrays are perfectly fine, and most likely faster again than ArrayLists. Arron. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: isTokenValid(request) is always returning false
A false parameter? :-) Well, for starters, what are you passing into isTokenValid() and what is the method testing for? Cheers! Mark Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Antony Stace [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 2:37 AM What would cause saveToken(request); if ( isTokenValid(request)) { System.out.println("isTokenValid(request) true"); } else { System.out.println("isTokenValid(request) false"); } To always print "isTokenValid(request) false". I am always getting the value of isTokenValid(request) being equal to false. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Ye olde ApplicationResources.properties ant -- tomcat?
Hi All, on setting up my new struts app, I found that ant isn't copying my ApplicationResources.properties from my src directory into the build or the deploy directories. When I compiled struts from source, ant managed to sort the properties file out for the example app, but I can't see anywhere in the build.xml files where this is being specified. Does anybody know what I'm on about? I'm going to try to get around it by putting the properties file directly in the tomcat webapps dir where it should go, but I'd appreciate being able to handle it properly. Thanks Adam Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Ye olde ApplicationResources.properties ant -- tomcat?
You need something like !-- Copy associated resource files -- copy todir=${web.build}/WEB-INF/classes fileset dir=${src.home} includes=**/*.properties/ /copy This may be being done when you compile, but not otherwise, but without seeing the build.xml Hope this helps Ghoot -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED]] Sent: 13 February 2002 13:09 To: [EMAIL PROTECTED] Subject: Ye olde ApplicationResources.properties ant -- tomcat? Hi All, on setting up my new struts app, I found that ant isn't copying my ApplicationResources.properties from my src directory into the build or the deploy directories. When I compiled struts from source, ant managed to sort the properties file out for the example app, but I can't see anywhere in the build.xml files where this is being specified. Does anybody know what I'm on about? I'm going to try to get around it by putting the properties file directly in the tomcat webapps dir where it should go, but I'd appreciate being able to handle it properly. Thanks Adam Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: isTokenValid(request) is always returning false
Thanks for the reply Mark. Well...that piece of code was just a test snippet. I have a problem in an Action - TestAction (with action = checkData), in TestAction.perform() the code which handles action=checkData I have if (action.equals("checkData")) { saveToken(request); //populate beans...etc } this populates a number of beans and these are used to display information in a jsp page. This page is just a confirmation screen for data which was entered in the previous screen. When the user hits the accept button on this page they go to TestAction(but with action=saveInDatabase). In TestAction.perform() for action=saveInDatabase I have if ( action.equals("saveInDatabase") isTokenValid(request)) { //save in database resetToken(request); } but the trouble is I always have isTokenValid(request) evaluating to false, so this part is always skipped so the data is not saved in the database :(. Cheers Tony On Wed, 13 Feb 2002 08:04:07 -0500 "Galbreath, Mark" [EMAIL PROTECTED] wrote: A false parameter? :-) Well, for starters, what are you passing into isTokenValid() and what is the method testing for? I am passing into isTokenValid() "request" which is one of the Action.perform() parameters. Cheers! Mark Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Antony Stace [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 2:37 AM What would cause saveToken(request); if ( isTokenValid(request)) { System.out.println("isTokenValid(request) true"); } else { System.out.println("isTokenValid(request) false"); } To always print "isTokenValid(request) false". I am always getting the value of isTokenValid(request) being equal to false. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Cheers Tony$B!#(B - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: iterate tag usage
You may have to get the tag separately from the online library or the nightly build. Cheers! Mark Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Henry Lu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 8:04 AM Thanks all. My code works now. But I have one more question: when i use logic:empty or logic:notEmpty, I got error: No such tag empty in the tag library imported with prefix logic Could you tell me how to make it work? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: isTokenValid(request) is always returning false
What is the value of request at this point? Cheers! Mark -Original Message- From: Antony Stace [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 8:14 AM if (action.equals("checkData")) { saveToken(request); //populate beans...etc } Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Basic Struts Question
I think you have the right idea with option 1. There's lots of old posts about this fiddly subject - it may take a while to dig for them. Try looking up workflow. I posted some of my code a while ago - no-one else seemed to think too much of it, but I still happily use it. if you search the archive:- http://www.mail-archive.com/struts-user%40jakarta.apache.org/ for ChainToPage, see messages under subject:- re: How to return to the page that called the action class? I want to re-work his thing - but I still like it's basic design. 1 - Replacing the boss slave get/setAttributes , as I have a general preference to pass data in value/message objects rather than in HaspMaps. 2 - Better names. 3 - code to handle irregular navigation (old objcts in the session). cheers - Keith. PS How many people have written a user list/maint thing? I'd expect there to be dozens of sites with a demo the code available. I'm not proud of my code that does this but I'll mail it to you direct if you want a look. I think it would help (but be gentle). --- Robb Nedwick [EMAIL PROTECTED] wrote: Hi, My company is evaluating whether or not to introduce Struts into our application architecture as part of our next release, and I have a relatively simple/stupid question about how best to build the set of screens that we're using as part of our evaluation process. In this example, I have a screen that displays a list of users. The screen needs several request parameters to identify which list of users to display. From this page, the user can go to a separate worksheet to add an additional user to the collection, or modify an existing user, and when they successfully save the list page for the user collection they are modifying is redisplayed with the new data. The parameters for the list page need to be specified at run-time, since they are dependent on the selected list and the user logged in. For the list page, I have an action that uses the request parameters to get the list of data and add it to the request as an attribute so that the JSP can display the data. For the worksheet page, I've implemented a read action to get the data (in a modify scenario) and then forward to a worksheet page, and a save action to process the worksheet and save the data to the business tier. The confusion I'm having comes in when the save action successfully processes the request and needs to perform the forward to send the user back to the list page. The list page needs the list of users to be put into the request object for it. The list action looks for the additional data it needs to populate the list as request parameters, not as attributes, and Struts does not appear to auto-populate ActionForm beans from request attributes, just the parameters. So, which of the options below would appear to make the most sense when building a Struts based web app? - have the save action set the additional data as request attributes and have the success mapping forward to the get list action. The list action will just need to check if it's ActionForm object was populated from the request parameters, and if not, get the data it needs from the request attributes. - have the both the get list and save actions be capable of fetching the list data and populating it for the list screen, and have the save action's success mapping go directly to the list JSP. - build an ActionForward object to do a browser redirect using the struts-config.xml mapping to get the URI and then append additional parameters to the URI to get to the next page - store the information needed by the list page in the session and update it there as well as on the business tier (rather not do that since we already overuse the session to keep stuff around, and I was hoping to get the team to become better at keeping session usage down). Seems like the first option is the best, but I wanted to make sure I wasn't missing anything. Thanks for any help/advice. Robb Nedwick __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: classnotfound
1 possible cause is when the package statement or compile output dir. has been changed:- Check every dir. on your class path for Users.class delete them all before compiling. K. Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ --- Galbreath, Mark [EMAIL PROTECTED] wrote: You are being way too vague, Steve. Let's see the exact error msg, the relevant JSP and form bean code (including your package statement) and the action mapping in the struts config file. Mark Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Steven Dahlin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 5:51 PM I am getting an error message indicating that a class cannot be found. It occurs after entering a user login and password into login.jsp and pressing the submit button. The class that cannot be found is: logwork.entities.Users. I have the following structure for my app: logwork (the jsps reside here) | +--WEB-INF (web.xml, struts-config.xml, etc.) | +-- classes | +-- logwork | +-- entities (logwork.entities.Users extending ActionForm resides here) +-- bo (logwork.bo.UsersBO for the business objects) +-- db (logwork.db.UsersDAO for the data access) Can anyone tell me what I might be doing wrong or how I might provide clearer information? Thanks, Steve -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: isTokenValid(request) is always returning false
I have not altered request at all at this point. It is how it is when it is passed to the perform() method. On Wed, 13 Feb 2002 08:29:42 -0500 "Galbreath, Mark" [EMAIL PROTECTED] wrote: What is the value of request at this point? Cheers! Mark -Original Message- From: Antony Stace [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 8:14 AM if (action.equals("checkData")) { saveToken(request); //populate beans...etc } Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Cheers Tony$B!#(B - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How can I use a background process with JBoss
Hi, I want to do the following: I have a ShoppingCart. The users clicks on order and the items from the ShoppingCart are moved to my OrderBean. ShoppingCart and OrderBean are EJB's. Now it comes to the problem. The order must be proccessed in background cause it will have a long durration. After the order has be proccessed the user should be notived somehow. How can I achieve this with JBoss and Struts ? What would be the best way to implement this Many thanks any any suggestions are welcome!!! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [JBoss-user] How can I use a background process with JBoss
a message bean can be a good idea... send an XML or text message to your message EJB, which will process the request in it's own thread... by the way, for long transactions, if you can avoid transactions (by default they timeout in 30 seconds. you can change that somewhere in the transaction config, but anyway this is costly for the DB) check the transaction mode used for the EJB... using NotSupported for is interesting if their is no risk of incoherence. note that such a non transactional bean can call transactional EJB (Required TX mode for example). each independent method call will be either Commit'ed or Rollback'ed... If you don't have Message EJB, you can try to add a Thread'able object in the Servlet context. I did it on Websphere to scan mail... then, either use the load-on-startup elemnt in web.xml or explicitly start and stop... as far as I understand servler context guaranty that only one instance of the thread is used you may also look about non HTTP servlet which may respond to any protocol... or even to soap clients... -Message d'origine- De: Dirk Storck [mailto:[EMAIL PROTECTED]] Date: mercredi 13 février 2002 14:17 À: Jboss User (E-Mail); Struts User (E-Mail) Objet: [JBoss-user] How can I use a background process with JBoss Hi, I want to do the following: I have a ShoppingCart. The users clicks on order and the items from the ShoppingCart are moved to my OrderBean. ShoppingCart and OrderBean are EJB's. Now it comes to the problem. The order must be proccessed in background cause it will have a long durration. After the order has be proccessed the user should be notived somehow. How can I achieve this with JBoss and Struts ? What would be the best way to implement this package fr.cdc.idt.receivemail; /** * Insérez la description du type ici. * Date de création : (04/01/02 12:10:45) * @author: */ import java.util.Date; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; import javax.mail.*; import javax.mail.internet.*; import fr.cdc.idt.sendmail.*; public class ReceiveMailServlet extends javax.servlet.http.HttpServlet { /** * Free any resources the servlet has acquired * that will not be garbage collected. */ public void destroy() { System.out.println(getClass().getName()+#destroy()); ServletContext cnt=getServletContext(); Object cobj=cnt.getAttribute(mailPollBean); if(cobj!=null){ ReceiveMailPollBean mailPollBean=(ReceiveMailPollBean)cobj; System.out.println(getClass().getName()+#destroy() bean stop); mailPollBean.stop(); System.out.println(getClass().getName()+#destroy() removeattribute); cnt.removeAttribute(mailPollBean); } super.destroy(); } /** * Process incoming HTTP GET requests * * @param request Object that encapsulates the request to the servlet * @param response Object that encapsulates the response from the servlet */ public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException { performTask(request, response); } /** * Process incoming HTTP POST requests * * @param request Object that encapsulates the request to the servlet * @param response Object that encapsulates the response from the servlet */ public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException { performTask(request, response); } /** * Returns the servlet info string. */ public String getServletInfo() { return super.getServletInfo(); } /** * Initializes the servlet. */ public void init() { // insert code to initialize the servlet here } /** * Initializes the servlet. */ public void init(ServletConfig cnf) throws ServletException { // insert code to initialize the servlet here super.init(cnf); ServletContext cnt = cnf.getServletContext(); //String mailhostParm = cfg.getInitParameter(mailhost); ReceiveMailPollBean mailPollBean = new ReceiveMailPollBean(); ReceiveMailBean receiveBean = mailPollBean.getReceiveMailBean(); receiveBean.setUserName(testportail); receiveBean.setPassword(testportail); receiveBean.setStoreType(imap); receiveBean.setFolderName(INBOX); receiveBean.setHostName(tsexchange.idt.cdc.fr); AttachmentAdapter attachementListener = new AttachmentAdapter() { public void onAttachement(AttachmentEvent event) { /* do the job */ } }; receiveBean.addAttachmentListener(attachementListener); mailPollBean.setPollingInterval(1000 * 30); mailPollBean.start(); // Thread.currentThread().sleep(1000*30); //mailPollBean.stop(); cnt.setAttribute(mailPollBean, mailPollBean);
Re: App Design
rage on! I want java to survive .net. If people use too much technology or over eloborate designs, their systems get expensive to write hard to maintain then it looks like java is not good. When I see the posts by people using frames I am pleased I avoid them. One of my aims is to write systems that a beginner can read a junior can maintain. As for EJB's - oops I may start to rant! I write a business logic class to a standard design pattern, it can be called from a Swing app or a struts Action. If I want to call it from a remote server or it needs to participate in a distributed transaction it should take only a few hours to write a wrapper around it to make it an EJB session bean. It needs to receive/return it's parameters as value objects (to save repeated calls acoss the network). But like 98% of systems I have no such requirement - so no EJB's - for now. So what's the big deal about them - can't most of us can remain blissfully ignorant of them? Personally I'd like to see that b^%$ PetStore written in 3 ways - 1 - As a pet store would actually want it (Small scale architecture) 2 - Mid scale 3 - Monster scale. And if we are really lucky No 1 write run nearly as fast as the .net version!! --- stf [EMAIL PROTECTED] wrote: ok, the link is rather old, and maybe also a bit dogmatic: But most of it still holds true. Apart from the usability-hassles described in the link, in my experience you can add a bunch of problems you get when you try to generate your frames programmatically (the simplest one being the requirement to generate a link to the preceding page(whatever that means when you use frames) that also had to work when javascript is deactivated - the history.back() at last works halfway consistent for almost all browsers, but it took them a while...) - then you have the problem with deep-links into the site (you almost always end up with an xml-file that contains the complete site-layout and from which you can generate right frameset - almost always buggy and hard to maintain...), synching data in different frames (using an equally bad mixture of javascript/sevlet-code...). There are some applications out there which almost all have to something with configuration (configuring a new car, a new pc and so on) which make heavy use of javascript and frames to maintain the state of the configuration: Although i agree that there almost always a whole lot of data flows from and to the browser, which can/should be cached in frames, in reality these configrurators almost always seem to be crashing short before purchasing your new car, which took you about an hour to configure... so, no, i don't see any real reason for using frames for other things than doing some static designer-portfolio-pages (but i think they are currently overusing flash for this purpose...) ps: excuse me for this elaborate rage, but i have been burnt before in projects where i was forced to use frames - Original Message - From: Keith [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 10:25 AM Subject: Re: App Design Is there a good argument for using frames? It needs to be good, they obviously are problematic to use. Beware the page linked to below is dated Dec. 1996 - most of what's in it is obsolete! --- stf [EMAIL PROTECTED] wrote: frames suck: I don't think it's a good idea to separate your page-flow onto two different layers, one being the javscript/frame-constellation, the other the struts config-files. What exactly are you trying to achive? If you just want to reuse your navigation, then go for some kind of template-engine(e.g. tiles, even simple, maybe parametrized includes will be better than frames..) - if you have a designer, who insists, that frames are more usable or just look better, have him read this: http://www.useit.com/alertbox/9612.html - it's already so old that i thought, everybody knows it by now ;) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 9:10 PM Subject: App Design Hi all, I am thinking of structuring an application as follows, and would appreciate any advice and ideas of how to do this: There will be two frames. First is a navigation frame where the user presses a button to determine the JSP that is loaded into the second frame. Each possible JSP for the second frame will have form. If a user is entering data into the form, and then presses a button on the navigation frame to go to a different jsp/form, I want to save the partially entered form data from the page the user is leaving. Then when the user goes back to the first page they can continue where they left off. I have been prototyping an idea; the navigation frame uses JavaScript to submit the form and redirect the old page to the
error running tile: Cannot find message resources
I tried to run tile tutorial and got Cannot find message resources error message. I am running struts 20020110 nightly and tomcat4.0.2. javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:735) at org.apache.struts.util.RequestUtils.message(RequestUtils.java:699) at org.apache.struts.taglib.html.BaseHandlerTag.message(BaseHandlerTag.java:568) at org.apache.struts.taglib.html.BaseHandlerTag.prepareStyles(BaseHandlerTag.java:623) at org.apache.struts.taglib.html.ImgTag.doEndTag(ImgTag.java:500) at org.apache.jsp.header$jsp._jspService(header$jsp.java:83) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107) at java.lang.Thread.run(Thread.java:484) __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How can I use a background process with JBoss
1 - Make the order process quick - it should be. Then you avoid the problem. Make user wait till it's done. 2 - Don't notify the user - let them do an enquiry to check if they want. If your system is any 100% reliable audited they will rely on it won't even want to be notified. 3 - Send the user an email when the order processing completes. As far as I know you can't interupt a web app from the server. 4 - Use a messaging system designed for asynchronous processing. MQ Series (maybe Java mesagin Service). --- Dirk Storck [EMAIL PROTECTED] wrote: Hi, I want to do the following: I have a ShoppingCart. The users clicks on order and the items from the ShoppingCart are moved to my OrderBean. ShoppingCart and OrderBean are EJB's. Now it comes to the problem. The order must be proccessed in background cause it will have a long durration. After the order has be proccessed the user should be notived somehow. How can I achieve this with JBoss and Struts ? What would be the best way to implement this Many thanks any any suggestions are welcome!!! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: App Design
I read the list this morning and read 20 messages about too much traffic and then read 30+ messages that were either labelled OT (which I assume stands for off-topic) and messages like this, which are interesting but have absolutely nothing to do with Struts. This isn't a poolman, expresso, EJB list, this is a Struts list. Talking about the others where they deal with Struts is OK. If people think there is too much traffic on this list, they can stop discussing off-topic things. I bet the traffic would go down 25%. My 2 cents Jay On Wed, 13 Feb 2002, Keith wrote: rage on! I want java to survive .net. If people use too much technology or over eloborate designs, their systems get expensive to write hard to maintain then it looks like java is not good. When I see the posts by people using frames I am pleased I avoid them. One of my aims is to write systems that a beginner can read a junior can maintain. As for EJB's - oops I may start to rant! I write a business logic class to a standard design pattern, it can be called from a Swing app or a struts Action. If I want to call it from a remote server or it needs to participate in a distributed transaction it should take only a few hours to write a wrapper around it to make it an EJB session bean. It needs to receive/return it's parameters as value objects (to save repeated calls acoss the network). But like 98% of systems I have no such requirement - so no EJB's - for now. So what's the big deal about them - can't most of us can remain blissfully ignorant of them? Personally I'd like to see that b^%$ PetStore written in 3 ways - 1 - As a pet store would actually want it (Small scale architecture) 2 - Mid scale 3 - Monster scale. And if we are really lucky No 1 write run nearly as fast as the .net version!! --- stf [EMAIL PROTECTED] wrote: ok, the link is rather old, and maybe also a bit dogmatic: But most of it still holds true. Apart from the usability-hassles described in the link, in my experience you can add a bunch of problems you get when you try to generate your frames programmatically (the simplest one being the requirement to generate a link to the preceding page(whatever that means when you use frames) that also had to work when javascript is deactivated - the history.back() at last works halfway consistent for almost all browsers, but it took them a while...) - then you have the problem with deep-links into the site (you almost always end up with an xml-file that contains the complete site-layout and from which you can generate right frameset - almost always buggy and hard to maintain...), synching data in different frames (using an equally bad mixture of javascript/sevlet-code...). There are some applications out there which almost all have to something with configuration (configuring a new car, a new pc and so on) which make heavy use of javascript and frames to maintain the state of the configuration: Although i agree that there almost always a whole lot of data flows from and to the browser, which can/should be cached in frames, in reality these configrurators almost always seem to be crashing short before purchasing your new car, which took you about an hour to configure... so, no, i don't see any real reason for using frames for other things than doing some static designer-portfolio-pages (but i think they are currently overusing flash for this purpose...) ps: excuse me for this elaborate rage, but i have been burnt before in projects where i was forced to use frames - Original Message - From: Keith [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 10:25 AM Subject: Re: App Design Is there a good argument for using frames? It needs to be good, they obviously are problematic to use. Beware the page linked to below is dated Dec. 1996 - most of what's in it is obsolete! --- stf [EMAIL PROTECTED] wrote: frames suck: I don't think it's a good idea to separate your page-flow onto two different layers, one being the javscript/frame-constellation, the other the struts config-files. What exactly are you trying to achive? If you just want to reuse your navigation, then go for some kind of template-engine(e.g. tiles, even simple, maybe parametrized includes will be better than frames..) - if you have a designer, who insists, that frames are more usable or just look better, have him read this: http://www.useit.com/alertbox/9612.html - it's already so old that i thought, everybody knows it by now ;) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 9:10 PM Subject: App Design Hi all, I am thinking of structuring an application as follows, and would appreciate any advice and ideas of how to
Re: isTokenValid(request) is always returning false
is your code in the right place? In the order you have it the token isn't in the request. at bottom of your page saveToken(request); // - I think this writes a hidden field in your jsp. // which ends up in the request after form is submitted. // send your page at top of page if ( isTokenValid(request)) { tests the token in the request. --- Antony Stace [EMAIL PROTECTED] wrote: Thanks for the reply Mark. Well...that piece of code was just a test snippet. I have a problem in an Action - TestAction (with action = checkData), in TestAction.perform() the code which handles action=checkData I have if (action.equals(checkData)) { saveToken(request); //populate beans...etc } this populates a number of beans and these are used to display information in a jsp page. This page is just a confirmation screen for data which was entered in the previous screen. When the user hits the accept button on this page they go to TestAction(but with action=saveInDatabase). In TestAction.perform() for action=saveInDatabase I have if ( action.equals(saveInDatabase) isTokenValid(request)) { //save in database resetToken(request); } but the trouble is I always have isTokenValid(request) evaluating to false, so this part is always skipped so the data is not saved in the database :(. Cheers Tony On Wed, 13 Feb 2002 08:04:07 -0500 Galbreath, Mark [EMAIL PROTECTED] wrote: A false parameter? :-) Well, for starters, what are you passing into isTokenValid() and what is the method testing for? I am passing into isTokenValid() request which is one of the Action.perform() parameters. Cheers! Mark Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Antony Stace [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 2:37 AM What would cause saveToken(request); if ( isTokenValid(request)) { System.out.println(isTokenValid(request) true); } else { System.out.println(isTokenValid(request) false); } To always print isTokenValid(request) false. I am always getting the value of isTokenValid(request) being equal to false. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Cheers Tony¡£ - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How can I use a background process with JBoss
It's not precisely a *background* thread, but you could use JMS. Post a message to a JMS queue, an EJB handles it and posts success/failure into another queue for you to read. This lets the app server handle the threading... Mark -Original Message- From: Dirk Storck [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 7:17 AM To: Jboss User (E-Mail); Struts User (E-Mail) Subject: How can I use a background process with JBoss Hi, I want to do the following: I have a ShoppingCart. The users clicks on order and the items from the ShoppingCart are moved to my OrderBean. ShoppingCart and OrderBean are EJB's. Now it comes to the problem. The order must be proccessed in background cause it will have a long durration. After the order has be proccessed the user should be notived somehow. How can I achieve this with JBoss and Struts ? What would be the best way to implement this Many thanks any any suggestions are welcome!!! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
problem with FormBean
Hi I am using form bean for the first time in struts . I wrote a simple form bean which sets and gets values. Also, I override the validate method in form bean with my logic. My action class does not do anything other than forwarding the control to some xyz jsp on success. So, now when I put in correct values for the text values(where validation succeeds and there is no error). It goes to the correct page i.e. xyz jsp. But when I do not put correct values in text boxes. It shows me HTTP 500 error. Can Any one tell me what I am doing wrong. Amit -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Ye olde ApplicationResources.properties ant -- tomcat?
Ah! I see. My build.xml had: !-- Copy associated resource files -- copy todir=${web.build}/library/classes fileset dir=${src.home} includes=**/*.properties/ /copy ! - for some bizarre reason the resource file was being copied into build/library/classes Thanks v. much. Adam On Wed, 13 February 2002, Emaho, Ghoot wrote: You need something like !-- Copy associated resource files -- copy todir=${web.build}/WEB-INF/classes fileset dir=${src.home} includes=**/*.properties/ /copy This may be being done when you compile, but not otherwise, but without seeing the build.xml Hope this helps Ghoot -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED]] Sent: 13 February 2002 13:09 To: [EMAIL PROTECTED] Subject: Ye olde ApplicationResources.properties ant -- tomcat? Hi All, on setting up my new struts app, I found that ant isn't copying my ApplicationResources.properties from my src directory into the build or the deploy directories. When I compiled struts from source, ant managed to sort the properties file out for the example app, but I can't see anywhere in the build.xml files where this is being specified. Does anybody know what I'm on about? I'm going to try to get around it by putting the properties file directly in the tomcat webapps dir where it should go, but I'd appreciate being able to handle it properly. Thanks Adam Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: error running tile: Cannot find message resources
There is two possibilities : * You have specified a message resource file in web.xml, but this file doesn't exist. (not the case if you use Tiles tutorial 'as is'). * You use a recent Struts version which require a resource file even if you don't specify it ;-( I have encountered this problem with latest nightly builds, and haven't dig in Struts yet to localize the problem (sound like a bug for me). I use a trick proposed by Hertzel Karbasi : define an empty resource file and specify it in your web.xml file. Cedric c tang wrote: I tried to run tile tutorial and got Cannot find message resources error message. I am running struts 20020110 nightly and tomcat4.0.2. javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:735) at org.apache.struts.util.RequestUtils.message(RequestUtils.java:699) at org.apache.struts.taglib.html.BaseHandlerTag.message(BaseHandlerTag.java:568) at org.apache.struts.taglib.html.BaseHandlerTag.prepareStyles(BaseHandlerTag.java:623) at org.apache.struts.taglib.html.ImgTag.doEndTag(ImgTag.java:500) at org.apache.jsp.header$jsp._jspService(header$jsp.java:83) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107) at java.lang.Thread.run(Thread.java:484) __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe,
HTML / Struts Help
Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
problem with nightly build
The binary download of the last three nightly build seems to be currupted. The file size seems to be too small. Am I missing something? Thanks in advance, Emiliano. -- Emiliano Albiani Corso Garibaldi, 19 55100 Lucca P.I. 01721430468 Tel. +393297028910 __ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help
Just define a hidden field in your form. Then when you press a button define an onclick event that sets the value of the hidden field. For example: struts-html:hidden property=action/ struts-html:submit property=Process onclick=form.action.value='Process' -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:12 AM To: '[EMAIL PROTECTED]' Subject: HTML / Struts Help Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Form Tags URL ... Goof-up!!!
Hi, I'm facing a lot of problems trying to maintain the extra path info in the URL. Few of these problems I've managed to work around by overriding methods in the base classes, specially ActionServlet class. The current problem that I have has to do with Form Tags. Lemme tell you the scenario to explain you the problem. I have a home page which has the login rm. Now I reach the home page using some URL like this http://myserver/servlet-name/extra-info/home. I'm using the form tag html:form to render the form. This unfortunately changes the form action to /servlet-name/login. And when the form is submitted this result in a URL as given below : http://myserver/servlet-name/login. As you would notice, the extra-info is gone. I dug into the FormTag code looks like this is the way it is supposed to behave (I can send you snippets of the code bcoz of which this behaviour occurs). Can anyone please tell me how to get around this problem. I think struts does a major amount of goof-up when it comes to extra path info it really amazes me to see how the designers of struts could have ignored such an obvious utility. Would appreciate any help from you guyz, Thanx in advance, VD. __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: problem with FormBean
It's a little difficult without seeing your implementation of validate(), your MessageResources bundle, the input property for your ActionMapping, and whatever custom taglib code you've implemented for handling the display in xyz.jsp. And while you're at it, http://www.tuxedo.org/~esr/faqs/smart-questions.html Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Dua, Amit [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 9:35 AM Hi I am using form bean for the first time in struts . I wrote a simple form bean which sets and gets values. Also, I override the validate method in form bean with my logic. My action class does not do anything other than forwarding the control to some xyz jsp on success. So, now when I put in correct values for the text values(where validation succeeds and there is no error). It goes to the correct page i.e. xyz jsp. But when I do not put correct values in text boxes. It shows me HTTP 500 error. Can Any one tell me what I am doing wrong. Amit -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: HTML / Struts Help
You would do it the way you'd do it an any web application. Here's how I do it: All my button field names start with btn. I would name these buttons btnProcess, btnViewByOrg and btnViewByProcess (or something similar). In my perform method, I'd put code like this: String button_pressed = null; Enumeration e = request.getParameterNames(); while ( e.hasMoreElements() ) { String param = (String)e.nextElement(); if ( param.startsWith(btn) ) { button_pressed = param; break; } } At this point, button_pressed tells you the name of the button that was pressed. I have a utility class that has this code in it and I use it everywhere. Jay On Wed, 13 Feb 2002, Mattos, John wrote: Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help
Name the buttons and give them a value; the name and value associated with the submit will be passed as a request parameter: private doSomething( request.getParameter( buttonName)); Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:12 AM So, how can I figure out what button was pressed in that Action class? Is there a way to do that? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Form Tags URL ... Goof-up!!!
Yeah, Ted! What he said! :-) -Original Message- From: cool dude [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:20 AM I think struts does a major amount of goof-up when it comes to extra path info it really amazes me to see how the designers of struts could have ignored such an obvious utility. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multi-language string resource strategy
H, we're developing with the space-is-cheap and they'll-always-want-something-different mentality. As such, we have very few application-level strings and keep most at a page-scope. This way, when marketing wants one word changed it's a very small change to the resource bundle rather than having to go through the pages and change resource keys all over the place. Andrew -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 9:29 AM To: [EMAIL PROTECTED] Subject: Multi-language string resource strategy Hi All, in my previous applications whenever I wrote multiple strings for languages, I just wrote strings for each page and sorted them based on page, but now with the struts framework, basing it on pages doesn't really work. What do people do? I was thinking of some sort of dictionary-like listing, so when the application is bigger, you can scan through looking to see if the string you want to write already exists. Adam Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multi-language string resource strategy
Check out http://jakarta.apache.org/struts/userGuide/building_view.html, section 3.2. Cheers! Mark -- Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:29 AM To: [EMAIL PROTECTED] Subject: Multi-language string resource strategy Hi All, in my previous applications whenever I wrote multiple strings for languages, I just wrote strings for each page and sorted them based on page, but now with the struts framework, basing it on pages doesn't really work. What do people do? I was thinking of some sort of dictionary-like listing, so when the application is bigger, you can scan through looking to see if the string you want to write already exists. Adam Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Some missing tags in tld files ?
thanks for answers I ran the Struts 1.0.1 version with Tomcat3.2.1 I've download a nighly build version... I replaced all tld files in the web-inf directory by those of the nighly build version. I replaced too my struts.jar. I run my application and I obtain this message: java.lang.NoClassDefFoundError: org/xml/sax/helpers/DefaultHandler So, I add a Xerces parser and I got this message: Root cause: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE I tested my application with Tomcat 4.01 and here is the message: index.jsp : java.lang.NoClassDefFoundError: org/apache/jasper/JspC Can someone help me ? thanks Samuel - Original Message - From: Ted Husted [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 12:17 PM Subject: Re: Somes missing tags in tld files ? Yes. The logic:notEmpty tag is in the Nightly Build. The website is still confusing about which documents go with what. I've a plan for fixing it, and just have to clear some time to implement it. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Java Web Development with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ Samuel Judith wrote: Hello, I read (http://jakarta.apache.org/struts/struts-logic.html) there's the notEmpty tag in the logic taglib. But, when I look at the struts-logic.tld file, nothing like that appears. What does it mean ? Does it mean that the logic:notEmpty tag will be included in Struts 1.1 ? For example, the same problem appears for the format attribute of the bean:write tag. It's not defined in the tld file!! Thank you Samuel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How do I leverage the struts approach within an EJB environment?
Could someone kindly provide an explanation on how to leverage the struts approach within an EJB environment? we have the component diagram showing the main struts components relative to the MVC pattern. Where do EJBs fit in? ActionServlet -instantiate--ActionForm | | |send |call | |-Action V | | Jsp |use| | |-ActionMapping-- |use | V TagLib Thanks, Paul Idusogie Technical Architect Consulting Services Stellent Inc. Golden Triangle Drive Eden Prairie, MN 55104 Desk: 952.656.2755 Fax: 952.903.2115 Email: [EMAIL PROTECTED] website: http://www.stellent.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help
Hey I was thinking about that (I actually have a hidden field already called toDo (still working on that name)) but the problem is that it has to change based on which button is pressed. I could use JavaScript to set the hidden field dynamically (I don't know if this will work with struts, but I think I can do document.forms[0].toDo.value=process (or whatever) but I'd rather just have the buttons submit then be able to sort out what was pressed in the perform method John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 (w) (646) 638-8391 (f) (800) 877-5301 (c) (917) 202-8450 (w) www.iNDEMAND.com This e-mail contains privileged and/or confidential information intended for the use of the addressee. If the reader of this e-mail is not the intended recipient, you have received this e-mail in error and any review, dissemination, distribution or copying is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by return e-mail and permanently delete the copy you received. Thank you. -Original Message- From: Wijewickrema , Dina E. [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:16 AM To: 'Struts Users Mailing List' Subject: RE: HTML / Struts Help Just define a hidden field in your form. Then when you press a button define an onclick event that sets the value of the hidden field. For example: struts-html:hidden property=action/ struts-html:submit property=Process onclick=form.action.value='Process' -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:12 AM To: '[EMAIL PROTECTED]' Subject: HTML / Struts Help Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: HTML / Struts Help
if you want to user javascript do it like this, import your buttons as image and use it as a hyperlink a href=javascript:{document.forms[0].action='%= request.getContextPath()%/do/admin/retrieveUser?username=%= company.getUserForm(i).getUsername() %criteria=%=companyData.getAccountName()%';document.forms[0].submit()} Details/a maybe it`s not the best solution, but you can now redirect to different actions for different buttons, you can change parameters in the url and so on -Ursprüngliche Nachricht- Von: Mattos, John [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 13. Februar 2002 16:42 An: 'Struts Users Mailing List' Betreff: RE: HTML / Struts Help Hey I was thinking about that (I actually have a hidden field already called toDo (still working on that name)) but the problem is that it has to change based on which button is pressed. I could use JavaScript to set the hidden field dynamically (I don't know if this will work with struts, but I think I can do document.forms[0].toDo.value=process (or whatever) but I'd rather just have the buttons submit then be able to sort out what was pressed in the perform method John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 (w) (646) 638-8391 (f) (800) 877-5301 (c) (917) 202-8450 (w) www.iNDEMAND.com This e-mail contains privileged and/or confidential information intended for the use of the addressee. If the reader of this e-mail is not the intended recipient, you have received this e-mail in error and any review, dissemination, distribution or copying is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by return e-mail and permanently delete the copy you received. Thank you. -Original Message- From: Wijewickrema , Dina E. [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:16 AM To: 'Struts Users Mailing List' Subject: RE: HTML / Struts Help Just define a hidden field in your form. Then when you press a button define an onclick event that sets the value of the hidden field. For example: struts-html:hidden property=action/ struts-html:submit property=Process onclick=form.action.value='Process' -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:12 AM To: '[EMAIL PROTECTED]' Subject: HTML / Struts Help Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help
you can set the property on the submit button and then use request.getParameter to get the value of the propery in your action. example : html:form action=someAction.do html:submit value=process property=toDo / html:submit value=view by org property=toDo / html:submit value=view by product property=toDo / /html:form In the perform method of your action you can then write : String s = request.getParameter(toDo); if ( s.equals(process)) process(); else if ( s.equals(view by org)) viewByOrg(); else if ( s.equals(view by product)) viewByProduct(); Greetings, Geert. -- Get your firstname@lastname email at http://Nameplanet.com/?su -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
how does ActionForm get a MessageResources object?
I'm using the Nightly Build. ActionServlet.getResources() is deprecated: Actions should call Action.getResources(HttpServletRequest) instead of this method, in order to retrieve the resources for the current sub-application. I am trying to use the MessageResources object to add an error in an ActionForm.validate() using the property's label, instead of hard-coding it: errors.add(property, new ActionError(errors.required, resources.getMessage(mainMenu. + property))); Is there any way for an ActionForm to use the nice MessageResource feature of Struts? Thanks --Joachim
Error page
How can I configure Struts to present a beautiful error page (without the stacktrace), if I receive a Servlet Exception or JSP Exception? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
how does ActionForm get a MessageResources object?
I'm using the Nightly Build. ActionServlet.getResources() is deprecated: Actions should call Action.getResources(HttpServletRequest) instead of this method, in order to retrieve the resources for the current sub-application. I am trying to use the MessageResources object to add an error in an ActionForm.validate() using the property's label, instead of hard-coding it: errors.add(property, new ActionError(errors.required, resources.getMessage(mainMenu. + property))); Is there any way for an ActionForm to use the nice MessageResource feature of Struts? Thanks --Joachim
Re: [JBoss-user] How can I use a background process with JBoss
Hi, Am Mittwoch, 13. Februar 2002 14:16 schrieb Dirk Storck: Hi, I want to do the following: I have a ShoppingCart. The users clicks on order and the items from the ShoppingCart are moved to my OrderBean. ShoppingCart and OrderBean are EJB's. It's funny to see how everyone is working on similar problems (even the names of my classes are the same :) ). Now it comes to the problem. The order must be proccessed in background cause it will have a long durration. After the order has be proccessed the user should be notived somehow. The EJB spec. doesn't allow threads, so I think you will have to use message driven beans (MDB, belongs to EJB 2.0). The notification could be done via email. How can I achieve this with JBoss and Struts ? What would be the best way to implement this I haven't used MDB's yet, but the trick is to start a time consuming operation with a MDB and let it notify you when it's ready; your Struts action class would simply start the thing and return. Joachim -- Dipl.-Ing. Joachim Schaaf | Projektleiter | mailto:[EMAIL PROTECTED] cataloom AG | Eupener Str. 148 | 50933 Köln | http://cataloom.com/ Tel: +49 221 4851807 | Fax: +49 221 4851907 | Mobil-Tel: +49 170 7667807 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help
This works, but then your users MUST have JavaScript enabled or your application will not work. We try to build applications that work if users have JavaScript or don't have JavaScript. It's just as easy to check this stuff on the server. In your application, maybe you have full control over the browser, but in most web applications, the developers don't have control over the browser, so depending on JavaScript might not be such a good thing. Just my opinion... On Wed, 13 Feb 2002, Thompson, Darryl wrote: Hello, When my JSPs contain multiple buttons that trigger different behaviour I use the DispatchAction... Here is a snippet of html for defining a button: html:button property=method value=LongDistance Service onClick=window.location=\'dispatchSalesRequest.do?method=longDistance\'/ html:button property=method value=CallingCard Request onClick=window.location=\'dispatchSalesRequest.do?method=callingCards\'/ //... In my struts-config.xml I create a mapping like this: action path=/dispatchSalesRequest type=com.algx.coe.app.action.sales.DispatchSalesOrderSetup name=SalesOrderForm scope=request input=/pg_salesOrder_edit.jsp parameter=method validate=true forward name=next path=/pg_acctCode_edit.jsp/ forward name=salesDetailpath=/addSalesDetail.do/ forward name=calllingCards path=/pg_callingCard_edit.jsp/ forward name=longDistance path=/pg_longDistance_edit.jsp/ /action Then in the DispatchSalesOrderSetup class I handle any pre-page processing in an execute(...) method before forwarding control to the appropriate page. The great thing about the DispatchAction class is you don't have to code any conditional logic since it uses reflection to map the request argument (in this case the method parameter) value to a method name in the DispatchAction subclass. Hope this helps... / Darryl -Original Message- From: Wijewickrema , Dina E. [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 9:16 AM To: 'Struts Users Mailing List' Subject:RE: HTML / Struts Help Just define a hidden field in your form. Then when you press a button define an onclick event that sets the value of the hidden field. For example: struts-html:hidden property=action/ struts-html:submit property=Process onclick=form.action.value='Process' -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:12 AM To: '[EMAIL PROTECTED]' Subject: HTML / Struts Help Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help
Hi John You can use the html:image tag and set the property to a value. Then in the action, you are able to find out, which button was presed like this : // find out if the create button was clicked Enumeration enum = request.getParameterNames(); int clickedButton = 0; for(int idx = 0; enum.hasMoreElements() clickedButton == 0; idx++) { String paramName = (String)enum.nextElement(); if(paramName.startsWith(VALUE-OF-PROPERTY-NAME)) { // what ever you want to do } } Marcel -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 4:12 PM To: '[EMAIL PROTECTED]' Subject: HTML / Struts Help Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help - Summary
Jay Thanks a lot. To summarize, here is my HTML !-- HTML Snippet-- html:submit property=btnProcess bean:message key=button.processSuspends / /html:submit html:submit property=btnViewOrg bean:message key=button.viewOrg / /html:submit html:submit property=btnViewProd bean:message key=button.viewProd / /html:submit !-- End of snippet-- and in my Action Class, I have the following String button_pressed = null; Enumeration e = request.getParameterNames(); while (e.hasMoreElements()) { String param = (String) e.nextElement(); if (param.startsWith(btn)) { button_pressed = param; break; } } Works like a champ Thanks a lot. the other thing I found out I could have done, was, based on the SAME HTML SNIPPET I could have a property on the ActionFormClass called BtnProcess (with getter and setter) and I could get its value as follows // in the Action Form.perform() ViewProcessSuspendsForm myForm=(ViewProcessSuspendsForm)form; System.out.println(From the Action Form, getProcess(), the value is +myForm.getBtnProcess()); // Note, the value I get from this corresponds to bean:message key=button.processSuspends / from the HTML, which is the label on the button loaded from the resource file. It happens to be Process Suspends. I like the first solution better. Anyway, thanks for all the responses and help. John John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -Original Message- From: Jay sissom [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:25 AM To: Struts Users Mailing List Subject: Re: HTML / Struts Help You would do it the way you'd do it an any web application. Here's how I do it: All my button field names start with btn. I would name these buttons btnProcess, btnViewByOrg and btnViewByProcess (or something similar). In my perform method, I'd put code like this: String button_pressed = null; Enumeration e = request.getParameterNames(); while ( e.hasMoreElements() ) { String param = (String)e.nextElement(); if ( param.startsWith(btn) ) { button_pressed = param; break; } } At this point, button_pressed tells you the name of the button that was pressed. I have a utility class that has this code in it and I use it everywhere. Jay On Wed, 13 Feb 2002, Mattos, John wrote: Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help
I think the design of struts is that you should have get/setters in your form beans for the button parameters rather than look at the request parms directly. in form bean boolean createButton; public void setCreateButton(String createButtonParm) { createButton = true; } public boolean isCreateButton() { return createButton; } in form bean reset have createButton = false; == Then in your action code you can test if (formBean.isCreateButton()) == hope that helps K. --- Andres Marcel (KASO 211) [EMAIL PROTECTED] wrote: Hi John You can use the html:image tag and set the property to a value. Then in the action, you are able to find out, which button was presed like this : // find out if the create button was clicked Enumeration enum = request.getParameterNames(); int clickedButton = 0; for(int idx = 0; enum.hasMoreElements() clickedButton == 0; idx++) { String paramName = (String)enum.nextElement(); if(paramName.startsWith(VALUE-OF-PROPERTY-NAME)) { // what ever you want to do } } Marcel -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 4:12 PM To: '[EMAIL PROTECTED]' Subject: HTML / Struts Help Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] = __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: HTML / Struts Help
John wrote: I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product So, how can I figure out what button was pressed in that Action class? Is there a way to do that? I'm not sure if this is struts-kosher, but it works. I have a form that includes two buttons: html:submit property=submit value=Submit / html:submit property=submit value=Forgot Password/ Then I added get/set methods for a submit property in the associated FormBean. The Action class can then determine which button was pressed by calling getSubmit and doing a string compare: String submit = myform.getSubmit(); if ( submit.equals ( Forgot Password ) ) { // etc... } Joel -- - Descriptor Systems Java, C++ and XML Training and Courseware www.descriptor.com ICQ: 150414760 - -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Reloading a page without refreshing Remote Scripting)
Hi I have to developed a Page in which user enters the Zip Code and fields like City Name, State Name have to be populated without refreshing the page. I have found one solution Called 'Remote Scripting'. But that does not seem to work. Can any one have any experience with Remote Scripting. Please Help me. Thanks Rao -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help - addendum to summary.
I like that solution. I Think I'll alter my solution so that I'm doing it this way. Originally, I was concerned about getting back Process Suspends or some other strange string from String getBtnProcess() ( a method on the ActionForm class) within the Action.perform() method, but then I realized I have access to the message resources, and that's where I'm getting that Process Suspends label anyway, so why not just compare them. I can therefore just do something like the following: // Action.perform() snippet follows: MessageResources application = actionServlet.getResources(); String thingToCompare = application.getProperty(button.button.processSuspends); I can then compare the results of getBtnProcess() with thingToCompare and do whatever I need to do. Good catch, thanks John John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:17 AM To: Struts Users Mailing List Subject: RE: HTML / Struts Help I think the design of struts is that you should have get/setters in your form beans for the button parameters rather than look at the request parms directly. in form bean boolean createButton; public void setCreateButton(String createButtonParm) { createButton = true; } public boolean isCreateButton() { return createButton; } in form bean reset have createButton = false; == Then in your action code you can test if (formBean.isCreateButton()) == hope that helps K. --- Andres Marcel (KASO 211) [EMAIL PROTECTED] wrote: Hi John You can use the html:image tag and set the property to a value. Then in the action, you are able to find out, which button was presed like this : // find out if the create button was clicked Enumeration enum = request.getParameterNames(); int clickedButton = 0; for(int idx = 0; enum.hasMoreElements() clickedButton == 0; idx++) { String paramName = (String)enum.nextElement(); if(paramName.startsWith(VALUE-OF-PROPERTY-NAME)) { // what ever you want to do } } Marcel -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 4:12 PM To: '[EMAIL PROTECTED]' Subject: HTML / Struts Help Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] = __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Reloading a page without refreshing Remote Scripting)
I did remote scripting in the ASP world. I haven't heard of it being used in the JSP world, but I haven't been around that long. Anyway, one time remote scipting is used is for dependent list boxes. For example after the user selects a country from one drop down list, the state/prov dropdown list is then populated w/ the appropriate data. An alternative to remote scripting in this case is to use JavaScript. All the data has to be pre-loaded into arrays, but then you can dynamicly populate dropdowns on the client side. Note too that remote scripting doesn't work w/ all browsers. I think we had to take the JavaScript approach w/ Mac browers. For an example, see http://www.cyclewacko.com. -Original Message- From: Rao, Sarveswara [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:14 AM To: 'Struts Users Mailing List' Subject: Reloading a page without refreshing Remote Scripting) Hi I have to developed a Page in which user enters the Zip Code and fields like City Name, State Name have to be populated without refreshing the page. I have found one solution Called 'Remote Scripting'. But that does not seem to work. Can any one have any experience with Remote Scripting. Please Help me. Thanks Rao -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multi-language string resource strategy
On Wed, 13 February 2002, Galbreath, Mark wrote: Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ I like your tagline. I guess before too long after talking to me you'll have to increase it to include a URL to RTFM Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Confused over check boxes
I've got a checkbox on a page. It's initial state needs to be checked. In my form I have a boolean value for the check box. It fails to detect correctly if the check box is set. In my reset method I set the check box to true (as this is the initial state), but the help says WARNING: In order to correctly recognize unchecked checkboxes, the ActionForm bean associated with this form must include a statement setting the corresponding boolean property to false in the reset() method. How am I supposed to deal with this situation? Thanks Ian Beaumont
problem with struts-form.tld
Hi, I have problem with Form tag lib where as soon as I try to import it I will get the following Error-Msg: [[[ Error parsing TLD '/WEB-INF/struts-form.tld': The tag handler 'org.apache.struts.taglib.html.ImageTag' does not have a setter for the attribute 'path' specified in the tld.. allaire.jrun.jsp.NoSuchAttributeException: The tag handler 'org.apache.struts.taglib.html.ImageTag' does not have a setter for the attribute 'path' specified in the tld. at allaire.jrun.jsp.JRunTagLibraryInfo.getPropertyType(../jsp/JRunTagLibraryInfo.java:732) at allaire.jrun.jsp.JRunTagLibraryInfo.buildAttributeInfo(../jsp/JRunTagLibraryInfo.java:705) at allaire.jrun.jsp.JRunTagLibraryInfo.buildTagInfo(../jsp/JRunTagLibraryInfo.java:683) at allaire.jrun.jsp.JRunTagLibraryInfo.initialize(../jsp/JRunTagLibraryInfo.java:627) at allaire.jrun.jsp.JRunTagLibraryInfo.init(../jsp/JRunTagLibraryInfo.java:199) at allaire.jrun.jsp.JRunTagLibraryInfo.lookupTLI(../jsp/JRunTagLibraryInfo.java:109) at allaire.jrun.jsp.JSPParser.taglibDirective(../jsp/JSPParser.java:842) at allaire.jrun.jsp.JSPParser.directive(../jsp/JSPParser.java:973) at allaire.jrun.jsp.JSPParser.parse(../jsp/JSPParser.java:921) ]]] I'm reference it in my .JSP file as: %@ taglib uri=/WEB-INF/struts-form.tld prefix=form % and, in my Web.XML: taglib taglib-uri/WEB-INF/struts-form.tld/taglib-uri taglib-location/WEB-INF/struts-form.tld/taglib-location /taglib I'm using jakarta-struts-1.0.1. Thanks for your help, -Bader Almahanyi -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
(NEWBIE question) problem with forms submitting with iterate tag
Hi all, I have 2 forms, form 1 is search, form 2 is order. Search has a searchAction. In this action the searh will be performed, and the order bean will be populated and added to the order. The order page has a logic:iterate tag which will loop over the list with results found, and some input fields. This works fine. If I find an error on the order field, I like to redisplay this page, but I get the no collection found. My guess is that the iterate tries to iterate over an empty bean, and thus creates the error. Here's my code SearchAction perform(...) ... ... SearchForm searchForm = (SearchForm) form; searchForm.performSearch(); OrderForm orderForm = new OrderForm(); orderForm.setSearchResults( searchForm.getSearchResults() ); request.setAttribute(orderForm, orderForm); return mapping.findForward(order); OrderForm validate() { // something is empty return errors } OrderAction perform(...) ... ... ... } How can I save the found searchResults? Gr Ronald Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer ---
A JNDI question
I know this is only slightly related to this maillist butthis seems to be a very active and savvy group. I am running Forte v3 with Tomcat 3.2. When I try to find an environment variable using a JNDI lookup: projectFile = (String) ic.lookup(java:comp/env/ProjectData); I get an error indicating that the java naming factory has not been initialized. Any ideas on how to set this up. (It works with Tomcat4.x). Thanks for your indulgence, bob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Loading pdf files using jsp
I have used iText successfully in my previous assignment. It works extremely well. If one wants 2 go bleeding edge, they can have a look at FOP from apache or WH2FO by Fabio Gianetti (works for simple word -- pdf conversion. If your word doc has tables inside of tables, this tool blows up.) FOP was a pain but worth learning. regards hemant - Original Message - From: Galbreath, Mark [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, February 12, 2002 12:11 PM Subject: RE: Loading pdf files using jsp Adobe used to have a Java library but there were so many issues with it (and Adobe did not support it) that they removed it from their downloads. http://support.adobe.com/devsup/devsup.nsf/docs/51759.htm I would suggest a Google search, however, because I know many people have asked this question (including me) over the years and someone is bound to have written one by now. Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:04 AM To: Struts Users Mailing List Subject: Re: Loading pdf files using jsp Maybe you meant that you wanted to WRITE a PDF file from JSP? Loading a PDF file from a JSP is no different than loading any other web page from JSP. If the client browser has the Adobe Acrobat plugin installed, any hyperlink to PDF files will spawn the PDF file in the requesting browser. You may need to ensure that your server is configured to accepct the PDF mime-type, but other than that, it's a simple deal. To write PDF's dynamically, there is a Java library that you can obtain that is free. You'll have to dig for it though, cause I simply cannot remember the name or where to get it. There are also numerous commercial libraries that assist with writing dynamic PDF's on the server. - Cody [EMAIL PROTECTED] on 02/12/2002 04:27:32 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject: Loading pdf files using jsp Hello, I want to load a PDF file from JSP. Is it possible. Regards Arun -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: A JNDI question
Tomcat 3.2 doesn't support this (there is an article about it on the tomcat mailing list archives). Tomcat 4 does support it, hence the reason it works. Ghoot PS If you have no luck tracking down the article, I'll try and find reference to it again. -Original Message- From: Bob Williams [mailto:[EMAIL PROTECTED]] Sent: 13 February 2002 16:51 To: Struts Users Mailing List Subject: A JNDI question I know this is only slightly related to this maillist butthis seems to be a very active and savvy group. I am running Forte v3 with Tomcat 3.2. When I try to find an environment variable using a JNDI lookup: projectFile = (String) ic.lookup(java:comp/env/ProjectData); I get an error indicating that the java naming factory has not been initialized. Any ideas on how to set this up. (It works with Tomcat4.x). Thanks for your indulgence, bob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: error running tile: Cannot find message resources
I am running the app as as is. I used the trick you suggested and it solved the resource problem. Another problem occured when accessing examples/rssChannels.jsp here is the exception, javax.servlet.jsp.JspException: Error - Tag Insert : Can't get definition 'examples.rssChannels.page'. Check if this name exist in definitions factory. at org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.java:496) at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:385) at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:342) at org.apache.jsp.rssChannels$jsp._jspService(rssChannels$jsp.java:69) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107) at java.lang.Thread.run(Thread.java:484) --- Cedric Dumoulin [EMAIL PROTECTED] wrote: There is two possibilities : * You have specified a message resource file in web.xml, but this file doesn't exist. (not the case if you use Tiles tutorial 'as is'). * You use a recent Struts version which require a resource file even if you don't specify it ;-( I have encountered this problem with latest nightly builds, and haven't dig in Struts yet to localize the problem (sound like a bug for me). I use a trick proposed by Hertzel Karbasi : define an empty resource file and specify it in your web.xml file. Cedric __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multi-language string resource strategy
On Wed, 13 February 2002, Andrew B Forman wrote: As such, we have very few application-level strings and keep most at a page-scope. This way, when marketing wants one word changed it's a very small change to the resource bundle rather than having to go through the pages and change resource keys all over the place. I forgot about that little gotcha. Find the best deals on the web at AltaVista Shopping! http://www.shopping.altavista.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RES: Want to check user is logged in every page server]
Hello Antony, I extend the ActionServlet and Write some code to test if the user is logged and if He has permission to acess a page. It's very flexibile because is not only a test of login or not login. I can test, for example, if user XYZ has permission to acess some URL after He is logged in. Régis Melo SoftSite Tecnologia -Mensagem original- De: Antony Stace [mailto:[EMAIL PROTECTED]] Enviada em: domingo, 27 de janeiro de 2002 23:25 Para: [EMAIL PROTECTED] Assunto: AW: Want to check user is logged in every page server] Hi In the struts example the method used( as many people have pointed out) to check that the person requesting the page is logged on is to have at the top of each jsp a tag like custom:checkLogonTag/ This tag should check to see if some sort of bean is present - this bean indicates the user has logged on successfully - (method 1). Do I need to do anything else or is this the safest way to ensure a user is loged on before serving them the requested page. Question, is there any point of having some sort of database record to indicate a user has loggon on and checking with that database record as well as the bean in (method 1) that the user is logged on? Cheers Tony You can do this with a custom tag custom:checkLogonTag/ of course you also need to implement this tag. this is what actually does the job: public int doEndTag() throws JspException { // Is there a valid user logged on? boolean valid = false; HttpSession session = pageContext.getSession(); if ((session != null) (session.getAttribute(name) != null)) valid = true; // Forward control based on the results if (valid) return (EVAL_PAGE); else { try { pageContext.forward(page); } catch (Exception e) { throw new JspException(e.toString()); } return (SKIP_PAGE); } } Take a look at the example Mailserver application that comes with Struts. -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 20. November 2001 10:42 An: Struts Users Mailing List Betreff: Want to check user is logged in every page server Hi Everytime a page is served from my Struts application, I want to check to make sure the user is logged in. If they are not then I want to send them to the login screen. What is the best way to go about this using Struts? Cheers Tony _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Want to check user is logged in every page server]
Question about that solution: isnt it so that the user will be checked ONLY when you try to submit a page? Or does ActionServlet get activated as well when you request a jsp? I didnt think this would happen, so the user credentials will only be checked if you go to *.do. Gr Ronald -Original Message- From: Régis Melo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 6:22 PM To: 'Struts Users Mailing List' Subject: RES: Want to check user is logged in every page server] Hello Antony, I extend the ActionServlet and Write some code to test if the user is logged and if He has permission to acess a page. It's very flexibile because is not only a test of login or not login. I can test, for example, if user XYZ has permission to acess some URL after He is logged in. Régis Melo SoftSite Tecnologia -Mensagem original- De: Antony Stace [mailto:[EMAIL PROTECTED]] Enviada em: domingo, 27 de janeiro de 2002 23:25 Para: [EMAIL PROTECTED] Assunto: AW: Want to check user is logged in every page server] Hi In the struts example the method used( as many people have pointed out) to check that the person requesting the page is logged on is to have at the top of each jsp a tag like custom:checkLogonTag/ This tag should check to see if some sort of bean is present - this bean indicates the user has logged on successfully - (method 1). Do I need to do anything else or is this the safest way to ensure a user is loged on before serving them the requested page. Question, is there any point of having some sort of database record to indicate a user has loggon on and checking with that database record as well as the bean in (method 1) that the user is logged on? Cheers Tony You can do this with a custom tag custom:checkLogonTag/ of course you also need to implement this tag. this is what actually does the job: public int doEndTag() throws JspException { // Is there a valid user logged on? boolean valid = false; HttpSession session = pageContext.getSession(); if ((session != null) (session.getAttribute(name) != null)) valid = true; // Forward control based on the results if (valid) return (EVAL_PAGE); else { try { pageContext.forward(page); } catch (Exception e) { throw new JspException(e.toString()); } return (SKIP_PAGE); } } Take a look at the example Mailserver application that comes with Struts. -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 20. November 2001 10:42 An: Struts Users Mailing List Betreff: Want to check user is logged in every page server Hi Everytime a page is served from my Struts application, I want to check to make sure the user is logged in. If they are not then I want to send them to the login screen. What is the best way to go about this using Struts? Cheers Tony _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Furore B.V. Rijswijkstraat 175-8 Postbus 9204 1006 AE Amsterdam tel. (020) 346 71 71 fax. (020) 346 71 77 --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer ---
RE: Want to check user is logged in every page server]
Regis, Would you please give some code example on how you extended the ActionServlet on how you did it? Thanks, Thinh -Original Message- From: Régis Melo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:22 AM To: 'Struts Users Mailing List' Subject: RES: Want to check user is logged in every page server] Hello Antony, I extend the ActionServlet and Write some code to test if the user is logged and if He has permission to acess a page. It's very flexibile because is not only a test of login or not login. I can test, for example, if user XYZ has permission to acess some URL after He is logged in. Régis Melo SoftSite Tecnologia -Mensagem original- De: Antony Stace [mailto:[EMAIL PROTECTED]] Enviada em: domingo, 27 de janeiro de 2002 23:25 Para: [EMAIL PROTECTED] Assunto: AW: Want to check user is logged in every page server] Hi In the struts example the method used( as many people have pointed out) to check that the person requesting the page is logged on is to have at the top of each jsp a tag like custom:checkLogonTag/ This tag should check to see if some sort of bean is present - this bean indicates the user has logged on successfully - (method 1). Do I need to do anything else or is this the safest way to ensure a user is loged on before serving them the requested page. Question, is there any point of having some sort of database record to indicate a user has loggon on and checking with that database record as well as the bean in (method 1) that the user is logged on? Cheers Tony You can do this with a custom tag custom:checkLogonTag/ of course you also need to implement this tag. this is what actually does the job: public int doEndTag() throws JspException { // Is there a valid user logged on? boolean valid = false; HttpSession session = pageContext.getSession(); if ((session != null) (session.getAttribute(name) != null)) valid = true; // Forward control based on the results if (valid) return (EVAL_PAGE); else { try { pageContext.forward(page); } catch (Exception e) { throw new JspException(e.toString()); } return (SKIP_PAGE); } } Take a look at the example Mailserver application that comes with Struts. -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 20. November 2001 10:42 An: Struts Users Mailing List Betreff: Want to check user is logged in every page server Hi Everytime a page is served from my Struts application, I want to check to make sure the user is logged in. If they are not then I want to send them to the login screen. What is the best way to go about this using Struts? Cheers Tony _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Want to check user is logged in every page server]
This uses a constant to determine if you wanted login checking to be on or off. Sometimes during development you might not want that requirement. Jeff Krueger public class TradeController extends PersistentSessionController { public void init() throws ServletException { super.init(); } protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { boolean status = super.processPreprocess(request, response); // Check for login if (status SeamConstants.LOGIN_ACTIVE) { // process the uri String requri = request.getRequestURI(); int p1 = requri.lastIndexOf(/); String page = requri.substring(p1+1); if(!(SeamConstants.LOGIN_DO.equals(page))) { // not the logion page - loginScreen.trade if(!(SeamConstants.LOGIN_SUBMIT.equals(page))) { // not the target of the login post - login String valid = (String)getServletContext().getAttribute(SeamConstants.LOGGEDINVAR); if((valid == null) || (!(valid.equals(SeamConstants.LOGGEDINVAL { // the user has not logged in, redirect to the login url RequestDispatcher disp = getServletContext().getRequestDispatcher(SeamConstants.LOGGIN_DISPATCH); disp.forward(request,response); return false; } } } } return status; } } -Original Message- From: Thinh Doan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:21 AM To: Struts Users Mailing List Subject: RE: Want to check user is logged in every page server] Regis, Would you please give some code example on how you extended the ActionServlet on how you did it? Thanks, Thinh -Original Message- From: Régis Melo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:22 AM To: 'Struts Users Mailing List' Subject: RES: Want to check user is logged in every page server] Hello Antony, I extend the ActionServlet and Write some code to test if the user is logged and if He has permission to acess a page. It's very flexibile because is not only a test of login or not login. I can test, for example, if user XYZ has permission to acess some URL after He is logged in. Régis Melo SoftSite Tecnologia -Mensagem original- De: Antony Stace [mailto:[EMAIL PROTECTED]] Enviada em: domingo, 27 de janeiro de 2002 23:25 Para: [EMAIL PROTECTED] Assunto: AW: Want to check user is logged in every page server] Hi In the struts example the method used( as many people have pointed out) to check that the person requesting the page is logged on is to have at the top of each jsp a tag like custom:checkLogonTag/ This tag should check to see if some sort of bean is present - this bean indicates the user has logged on successfully - (method 1). Do I need to do anything else or is this the safest way to ensure a user is loged on before serving them the requested page. Question, is there any point of having some sort of database record to indicate a user has loggon on and checking with that database record as well as the bean in (method 1) that the user is logged on? Cheers Tony You can do this with a custom tag custom:checkLogonTag/ of course you also need to implement this tag. this is what actually does the job: public int doEndTag() throws JspException { // Is there a valid user logged on? boolean valid = false; HttpSession session = pageContext.getSession(); if ((session != null) (session.getAttribute(name) != null)) valid = true; // Forward control based on the results if (valid) return (EVAL_PAGE); else { try { pageContext.forward(page); } catch (Exception e) { throw new JspException(e.toString()); } return (SKIP_PAGE); } } Take a look at the example Mailserver application that comes with Struts. -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 20. November 2001 10:42 An: Struts Users Mailing List Betreff: Want to check user is logged in every page server Hi Everytime a page is served from my Struts application, I want to check to make sure the user is logged in. If they are not then I want to send them to the login screen. What is the best way to go about this using Struts? Cheers Tony _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To
HTML tags setting attribute to null?
Hi, I am seeing an unexpected result while using Struts 1.01/1.02 (upgraded and tested before I wrote this message.) My application uses two beans to populate some struts HTML tags (text, checkbox and select). The process flow is to call an action to create the beans and add them the session. The action then forwards to a JSP page. The user makes selections and submits the form data on the page. Then a second action processes the submission. When this second actions tries to access the two beans in the session, they are null. The attributes have not been deleted, because they can be seen with a call to getAttributeNames, but the objects associated with the names are null. A third session bean, which is not used to populate any tags, is still available, so whatever is populating the tags is replacing the beans with null. Is this a feature? If so, is there some way to disable it? Sid -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Passing Action Errors from one perform() method to another perform() method - Expert help?
Hi all. I'm trying to do the following. In an Action.perform() method, I'm adding an ActionErrors object to the request as follows // Snippet from an Action.perform() method ActionErrors errors = new ActionErrors (); errors.add(Processed, new ActionError(Processing Done)); saveErrors(request, errors); return new ActionForward(/suspends.do); // End of first perform() snippet Notice that I'm forwarding to a .do, which means I'm in another perform() method in the SECOND perform() method, I want to do some preprocessing (get stuff from a database) then forward to a JSP, and INLCUDE the actionErrors object from the first perform() method. Here's how I'm doing that now // snipped from second perform() method, mapped to suspends.do ActionErrors errors = new ActionErrors(); errors= (ActionErrors)request.getAttribute(Processed); saveErrors (request, errors); return new ActionForward(/invoicing/suspendsSummary.jsp); // End of second perform() snippet am I going about this in the wrong way? Is this even possible? basically, I want to pass a message back to the jsp that is really a status message (as in.. I'm done processing) thoughts? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help - addendum to summary.
I am trying to do something similar, except with an HTML link. I have a hidden form field: html:hidden property=testHidden value=blah/ and then I try to set its value with an onclick function in my link: html:link forward=testAction onclick=javascript:document.getElementById('testHidden').value='Test'; Whenever I click the link, the testHidden field comes up as NULL. BUT, when I use a regular submit button, it says the original blah. Any ideas what I am doing wrong? -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:31 AM To: 'Struts Users Mailing List' Subject: RE: HTML / Struts Help - addendum to summary. I like that solution. I Think I'll alter my solution so that I'm doing it this way. Originally, I was concerned about getting back Process Suspends or some other strange string from String getBtnProcess() ( a method on the ActionForm class) within the Action.perform() method, but then I realized I have access to the message resources, and that's where I'm getting that Process Suspends label anyway, so why not just compare them. I can therefore just do something like the following: // Action.perform() snippet follows: MessageResources application = actionServlet.getResources(); String thingToCompare = application.getProperty(button.button.processSuspends); I can then compare the results of getBtnProcess() with thingToCompare and do whatever I need to do. Good catch, thanks John John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:17 AM To: Struts Users Mailing List Subject: RE: HTML / Struts Help I think the design of struts is that you should have get/setters in your form beans for the button parameters rather than look at the request parms directly. in form bean boolean createButton; public void setCreateButton(String createButtonParm) { createButton = true; } public boolean isCreateButton() { return createButton; } in form bean reset have createButton = false; == Then in your action code you can test if (formBean.isCreateButton()) == hope that helps K. --- Andres Marcel (KASO 211) [EMAIL PROTECTED] wrote: Hi John You can use the html:image tag and set the property to a value. Then in the action, you are able to find out, which button was presed like this : // find out if the create button was clicked Enumeration enum = request.getParameterNames(); int clickedButton = 0; for(int idx = 0; enum.hasMoreElements() clickedButton == 0; idx++) { String paramName = (String)enum.nextElement(); if(paramName.startsWith(VALUE-OF-PROPERTY-NAME)) { // what ever you want to do } } Marcel -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 4:12 PM To: '[EMAIL PROTECTED]' Subject: HTML / Struts Help Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] = __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
question re. accompanying Struts example
Hello everyone I am going through the Struts example v 1.0.1, and I ran into a problem that I am sure some of you have ran into or know the answer. In the above mentioned app, there is a SaveRegistrationAction action class with the following code I am interested in: if (isCancelled(request)) { if (servlet.getDebug() = 1) servlet.log( Transaction ' + action + ' was cancelled); if (mapping.getAttribute() != null) session.removeAttribute(mapping.getAttribute()); session.removeAttribute(Constants.SUBSCRIPTION_KEY); 1 //return(mapping.findForward(test; 2 return (mapping.findForward(success)); This is the following behaviour I have: 1- in the Registration form, I press the Cancel button, which will run through the above described code and the control goes to the logon.jsp page instead of going to the one defined by success which is main.jsp. question: how come? 2- if i comment the return (mapping.findForward(success)) line and place return ( mapping.findForward(test)), it does go to the main.jsp page but this is also not the right behaviour since the control should go to the page defined in test which is a html file. Any hints? thanking in you advance guys P __ Patria Handatjaia Lukman Java Developer NdexSystems Inc. 360 St-Jacques Ouest, Suite 2000 Montréal, Qc. H2Y 1P5 Office phone: 1-514-288-0908 Ext 110 [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
changing Built in Validation Error Message
I seem to have got it working, except that the error message reads... VALIDATION ERROR you must check the following. I see that it's getting it from errors.footer and errors.header in the resource file. I'd like to override that behavior temporarily, and just display the message Is there some sort of Message service that I can use, analogous to the Error service, or can I temporarily change the errors.header and errors.footer? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 1:09 PM To: '[EMAIL PROTECTED]' Subject: Passing Action Errors from one perform() method to another perfor m() method - Expert help? Hi all. I'm trying to do the following. In an Action.perform() method, I'm adding an ActionErrors object to the request as follows // Snippet from an Action.perform() method ActionErrors errors = new ActionErrors (); errors.add(Processed, new ActionError(Processing Done)); saveErrors(request, errors); return new ActionForward(/suspends.do); // End of first perform() snippet Notice that I'm forwarding to a .do, which means I'm in another perform() method in the SECOND perform() method, I want to do some preprocessing (get stuff from a database) then forward to a JSP, and INLCUDE the actionErrors object from the first perform() method. Here's how I'm doing that now // snipped from second perform() method, mapped to suspends.do ActionErrors errors = new ActionErrors(); errors= (ActionErrors)request.getAttribute(Processed); saveErrors (request, errors); return new ActionForward(/invoicing/suspendsSummary.jsp); // End of second perform() snippet am I going about this in the wrong way? Is this even possible? basically, I want to pass a message back to the jsp that is really a status message (as in.. I'm done processing) thoughts? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HTML / Struts Help - addendum to summary.
Did you try using Document.forms[0].testHidden.value instead? If that doesn't work, maybe you could do it in a JavaScript function and then submit the form manually using document.forms[0].submit (you'd have to make the submit button a regular button that calls the method in the onclick) You should be able to reference the .value of a hidden field from a JavaScript function if nothing else. John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -Original Message- From: Matt Koidin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 1:22 PM To: Struts Users Mailing List Subject: RE: HTML / Struts Help - addendum to summary. I am trying to do something similar, except with an HTML link. I have a hidden form field: html:hidden property=testHidden value=blah/ and then I try to set its value with an onclick function in my link: html:link forward=testAction onclick=javascript:document.getElementById('testHidden').value='Test'; Whenever I click the link, the testHidden field comes up as NULL. BUT, when I use a regular submit button, it says the original blah. Any ideas what I am doing wrong? -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:31 AM To: 'Struts Users Mailing List' Subject: RE: HTML / Struts Help - addendum to summary. I like that solution. I Think I'll alter my solution so that I'm doing it this way. Originally, I was concerned about getting back Process Suspends or some other strange string from String getBtnProcess() ( a method on the ActionForm class) within the Action.perform() method, but then I realized I have access to the message resources, and that's where I'm getting that Process Suspends label anyway, so why not just compare them. I can therefore just do something like the following: // Action.perform() snippet follows: MessageResources application = actionServlet.getResources(); String thingToCompare = application.getProperty(button.button.processSuspends); I can then compare the results of getBtnProcess() with thingToCompare and do whatever I need to do. Good catch, thanks John John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:17 AM To: Struts Users Mailing List Subject: RE: HTML / Struts Help I think the design of struts is that you should have get/setters in your form beans for the button parameters rather than look at the request parms directly. in form bean boolean createButton; public void setCreateButton(String createButtonParm) { createButton = true; } public boolean isCreateButton() { return createButton; } in form bean reset have createButton = false; == Then in your action code you can test if (formBean.isCreateButton()) == hope that helps K. --- Andres Marcel (KASO 211) [EMAIL PROTECTED] wrote: Hi John You can use the html:image tag and set the property to a value. Then in the action, you are able to find out, which button was presed like this : // find out if the create button was clicked Enumeration enum = request.getParameterNames(); int clickedButton = 0; for(int idx = 0; enum.hasMoreElements() clickedButton == 0; idx++) { String paramName = (String)enum.nextElement(); if(paramName.startsWith(VALUE-OF-PROPERTY-NAME)) { // what ever you want to do } } Marcel -Original Message- From: Mattos, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 4:12 PM To: '[EMAIL PROTECTED]' Subject: HTML / Struts Help Hi. I have a form that can be submitted by three different buttons, for example the buttons read (Button Labels) Process View by Org View by Product What I want to do is in the Action Class handling the submission, find out which button was pressed, and act accordingly, whether it's an actionForward (in the case of the view options) or kicking off another process (as will be done by the process button) So, how can I figure out what button was pressed in that Action class? Is there a way to do that? John Mattos Sr. Developer and Architect iNDEMAND 345 Hudson St. 16th Floor New York, New York 10014 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] = __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe,
SQL in Logic Bean or Action class
Just a simple design question. Having read through several posts and reading the Struts documentation. I was wondering what is the best design pattern regarding SQL placement. My thoughts were that I need to keep SQL out of the action class and pass all resultset data into Collections of beans. This helps keep from having tons of connections and resulsets sitting out there tieing up valuable database resources. The collection of databeans are then placed in a scope using the Controller(Action class)and made available to other logic processes in the scope and/or passed on to the view for data display. I am assuming this is because business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment. Is my interpretation that SQL is part of the Model and should be placed in Logic beans tweaked? Or is this a 6 and half dozen scenario? Or is there another pattern that I am missing altogether? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: SQL in Logic Bean or Action class
You are on the right track. Keep the sql with the model. The only thing is don't let your collection of databeans make it to the jsp. That would then tie your presentation to the model. Very bad. There should be another set of beans that represents more of what the view is like. Often times in the view beans all the data types will be string to make the validation a lot easier. Jeff Krueger -Original Message- From: Phase Communcations [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:40 AM To: Struts Users Mailing List Subject: SQL in Logic Bean or Action class Just a simple design question. Having read through several posts and reading the Struts documentation. I was wondering what is the best design pattern regarding SQL placement. My thoughts were that I need to keep SQL out of the action class and pass all resultset data into Collections of beans. This helps keep from having tons of connections and resulsets sitting out there tieing up valuable database resources. The collection of databeans are then placed in a scope using the Controller(Action class)and made available to other logic processes in the scope and/or passed on to the view for data display. I am assuming this is because business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment. Is my interpretation that SQL is part of the Model and should be placed in Logic beans tweaked? Or is this a 6 and half dozen scenario? Or is there another pattern that I am missing altogether? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: SQL in Logic Bean or Action class
A quick hypothetical scenario: I have an action class that needs to pass a list of addresses to the view for display. I have a logic bean that contains a sql call to a database and retrieves address info. The resulset returns the following fields in each record: NAME, ADDRESS, CITY, STATE, ZIP I have a databean that has the following methods: setName(), setAddress(), setCity(), setState(), setZip() An ArrayList(Collection) is created. For each record in the resultset the fields are used to populate the databean (ie NAME - setName()) by calling it's property setting methods. Each bean populated is added to the ArrayList. Upon the end of the resultset the ArrayList is passed into a scope (request for example) by the Action class and named addresslist. The list of addresses then become available to the view for iteration and display. Where am I crossing boundaries in this scenario? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 12:02 PM To: 'Struts Users Mailing List' Subject: RE: SQL in Logic Bean or Action class You are on the right track. Keep the sql with the model. The only thing is don't let your collection of databeans make it to the jsp. That would then tie your presentation to the model. Very bad. There should be another set of beans that represents more of what the view is like. Often times in the view beans all the data types will be string to make the validation a lot easier. Jeff Krueger -Original Message- From: Phase Communcations [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:40 AM To: Struts Users Mailing List Subject: SQL in Logic Bean or Action class Just a simple design question. Having read through several posts and reading the Struts documentation. I was wondering what is the best design pattern regarding SQL placement. My thoughts were that I need to keep SQL out of the action class and pass all resultset data into Collections of beans. This helps keep from having tons of connections and resulsets sitting out there tieing up valuable database resources. The collection of databeans are then placed in a scope using the Controller(Action class)and made available to other logic processes in the scope and/or passed on to the view for data display. I am assuming this is because business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment. Is my interpretation that SQL is part of the Model and should be placed in Logic beans tweaked? Or is this a 6 and half dozen scenario? Or is there another pattern that I am missing altogether? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Showing a result after a long running query
Hello all, I have looked at the struts docs and all over the net and I have posted to forums at java.sun.com. I want to show a user a page that says I am working on your problem and then when the processing is done I will send to them/display for them the output of the long running database query/process whatever. Note I do not want the working in progress page to be shown again if I hit the back button of the browser. I should just get to the form that I inputted my parameters into to get the process rolling. Does struts support this? Does anyone know how to do this with some other technology? This seems like a common problem and there should be an easy solution or at least you would think so. Thank You Jim Tyrrell -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Menu tag
Hello Vic, I use the HierMenu javascript menu builder, it works well in Struts, see link below http://www.webreference.com/dhtml/hiermenus/ if anyone knows of a better Horizonal menuing approach I would like to see/try it. regards, Daaryl -Original Message- From: Struts Newsgroup [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 4:40 PM To: [EMAIL PROTECTED] Subject: Menu tag Subject: Menu tag From: Vic Cekvenich [EMAIL PROTECTED] === Other than struts-menu tag, what is another menu tag? I want drop downs across the top? TIA, Vic -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: SQL in Logic Bean or Action class
You are crossing the boundary in your action class when you put the result sets arraylist in the session. In the action class you should transfer that information into a different array list of view classes and put that in the session. I know it sounds like a lot of work and overhead to instance all those classes, but it is worth it and there is a helper class that might be of some use to you, I believe it is called like beanPopulate or something, maybe someone else can give you more info on that. I haven't used it yet. Jeff Krueger -Original Message- From: Phase Communcations [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 12:15 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: SQL in Logic Bean or Action class A quick hypothetical scenario: I have an action class that needs to pass a list of addresses to the view for display. I have a logic bean that contains a sql call to a database and retrieves address info. The resulset returns the following fields in each record: NAME, ADDRESS, CITY, STATE, ZIP I have a databean that has the following methods: setName(), setAddress(), setCity(), setState(), setZip() An ArrayList(Collection) is created. For each record in the resultset the fields are used to populate the databean (ie NAME - setName()) by calling it's property setting methods. Each bean populated is added to the ArrayList. Upon the end of the resultset the ArrayList is passed into a scope (request for example) by the Action class and named addresslist. The list of addresses then become available to the view for iteration and display. Where am I crossing boundaries in this scenario? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 12:02 PM To: 'Struts Users Mailing List' Subject: RE: SQL in Logic Bean or Action class You are on the right track. Keep the sql with the model. The only thing is don't let your collection of databeans make it to the jsp. That would then tie your presentation to the model. Very bad. There should be another set of beans that represents more of what the view is like. Often times in the view beans all the data types will be string to make the validation a lot easier. Jeff Krueger -Original Message- From: Phase Communcations [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 11:40 AM To: Struts Users Mailing List Subject: SQL in Logic Bean or Action class Just a simple design question. Having read through several posts and reading the Struts documentation. I was wondering what is the best design pattern regarding SQL placement. My thoughts were that I need to keep SQL out of the action class and pass all resultset data into Collections of beans. This helps keep from having tons of connections and resulsets sitting out there tieing up valuable database resources. The collection of databeans are then placed in a scope using the Controller(Action class)and made available to other logic processes in the scope and/or passed on to the view for data display. I am assuming this is because business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment. Is my interpretation that SQL is part of the Model and should be placed in Logic beans tweaked? Or is this a 6 and half dozen scenario? Or is there another pattern that I am missing altogether? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Creating RadioButton Group using Nested Extension
Hello all, I am using the MonkeyStruts Nested Extension and need help creating a Radiobutton group from data retreived out of a Relational Table. Does anyone have a code example of this or something similar using the nested extension? Within my parent ActionForm (SalesOrderForm) I have a nested form (LongDistanceServiceForm) and this form can contain a collection of callingCard plans which must be rendered as a group of radio buttons. Thanks for any help, Darryl -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cannot find actionmappings or actionformbeans collection
I am totally stumped. I cannot figure out the error that is occurring below: root cause javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:773) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:481) at org.apache.jsp.login$jsp._jspService(login$jsp.java:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Jsp I have followed the details that various examples give, but the examples work but mine does not. I am calling a jsp which is setting a certain form for submitting the results. The login.jsp is : %@ taglib uri = /html prefix = html % %@ taglib uri = /logic prefix = logic % html:form action = /loginUser.do focus = UserLog html:hidden property = role value = user/ html:hidden property = actn value = login/ bUser:/b html:text property = UserLog size = 20/ bPassword:/b html:text property = Password size = 20/ html:submit value = Login/ /html:form The web.xml sets up translation of the *.do with: !-- ||| Standard Action Servlet Configuration ||| -- servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valueLogworkResources/param-value /init-param load-on-startup2/load-on-startup /servlet !-- | Standard Action Servlet Mapping || -- servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping The struts-config.xml is as follows: struts-config form-beans form-bean name= userForm type = logwork.entities.Users/ form-bean name= worklogForm type = logwork.entities.WorkLog/ /form-beans global-forwards forward name=loginpath=/login.jsp/ /global-forwards action-mappings action path = /loginUser type = logwork.action.UserAction name = userForm scope = request input = /login.jsp forward name = success path = /confirm.jsp/ /action /action-mappings /struts-config logwork.action.UserAction.java sits in the classes/logwork/action directory. If anyone can help me I would appreciate it. Thanks, Steve -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: problem with FormBean
Make sure you have the input parameter set in the appropriate action tag of the struts-config.xml. The parameter should be set to the page you posted from. bsr -Original Message- From: Dua, Amit [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 9:35 AM To: 'Struts Users Mailing List' Subject: problem with FormBean Hi I am using form bean for the first time in struts . I wrote a simple form bean which sets and gets values. Also, I override the validate method in form bean with my logic. My action class does not do anything other than forwarding the control to some xyz jsp on success. So, now when I put in correct values for the text values(where validation succeeds and there is no error). It goes to the correct page i.e. xyz jsp. But when I do not put correct values in text boxes. It shows me HTTP 500 error. Can Any one tell me what I am doing wrong. Amit -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: HTML tags setting attribute to null?
Please ignore this, it turned out to be a coding problem. Sid Stuart wrote: Hi, I am seeing an unexpected result while using Struts 1.01/1.02 (upgraded and tested before I wrote this message.) My application uses two beans to populate some struts HTML tags (text, checkbox and select). The process flow is to call an action to create the beans and add them the session. The action then forwards to a JSP page. The user makes selections and submits the form data on the page. Then a second action processes the submission. When this second actions tries to access the two beans in the session, they are null. The attributes have not been deleted, because they can be seen with a call to getAttributeNames, but the objects associated with the names are null. A third session bean, which is not used to populate any tags, is still available, so whatever is populating the tags is replacing the beans with null. Is this a feature? If so, is there some way to disable it? Sid -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Help with JavaScript in Stuts
How does one incorporate onchange JavaScript Handler on a html:text tag? I want onchange=update(1,3,4) on a html:text tag. 3,4 is a string that comes from the form This is failing :- logic:iterate id=actHour name=currentForm type=fal.ActivityHour property=actHourArray html:text size=6 maxlength=4 name=actHour property =faHrsDay1 indexed=true onchange=update(1,bean:write name=actHour property=value/)/ logic:iterate also tried onchange=update(1,%=actHour.value%) but the scriptlet is transferred as it is. Any suggestions? _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Character Encoding wrong just for ApplicationResources!
Hello All I have added the following to JSP files META http-equiv=Content-Type content=text/html, charset=UTF-8 %@ page contentType=text/html; charset=UTF-8 % html:html locale=true Change the locale in an Action to iw_IL And get: Constant strings inserted in JSP in Hebrew are OK. Just the Strings (html:message coming from Applicationresource are shown as ?? I have checked the messages in debug and found out that they come as from the resource. The constant string inserted in the JSP in Hebrew just to check the browser and they have been displayed right! Any assistance will be appreciated. Thanks Hertzel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Nightly builds producing 300 BYTE download
Just an FYI.. The 2/11, 2/12 and 2/13 nightly builds of struts 1.1 have been producing 163 BYTE packages. http://jakarta.apache.org/builds/jakarta-struts/nightly/ -tak __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Multiple struts-config.xml files?
I want to have multiple workflows, with users mapped to a particular workflow based on their role. I know that Struts doesn't support this now. Is there an intent to support this in the future? In the meantime, I'm interested in suggestions on the best way to implement this. Right now, I've done this: 1) I've created multiple ActionServlets, each of which reads it's own struts-config file. Each pair is the workflow for one role. 2) I've got a RoleDispatcherServlet that intercepts all Struts URLs, converts the URL to call the appropriate ActionServlet for the user's role, and forwards to that URL. Any additional suggestions or alternative methods are appreciated. Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Multiple struts-config.xml files?
I just had one ActionServlet, and for each action defined in it's struts-config.xml, there is a separate forward defined per role (prefixed by role name). role1_success role2_success etc. All forward name strings (e.g. success) get intercepted essentially by a super class Action and then the user's role is added to the forward name. The actual ActionForward is then looked up in the action mapping and returned to the Struts ActionServlet. Regards, Nick - Original Message - From: Press, Michael [EMAIL PROTECTED] To: 'Struts User List' [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 8:28 AM Subject: Multiple struts-config.xml files? I want to have multiple workflows, with users mapped to a particular workflow based on their role. I know that Struts doesn't support this now. Is there an intent to support this in the future? In the meantime, I'm interested in suggestions on the best way to implement this. Right now, I've done this: 1) I've created multiple ActionServlets, each of which reads it's own struts-config file. Each pair is the workflow for one role. 2) I've got a RoleDispatcherServlet that intercepts all Struts URLs, converts the URL to call the appropriate ActionServlet for the user's role, and forwards to that URL. Any additional suggestions or alternative methods are appreciated. Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Character Encoding wrong just for ApplicationResources!
your properties file have to be written in Unicode encoding, not the native encoding, or else java will screw your characters up, since java can only deal with unicode Hertzel Karbasi - OPTinity eBusiness Solutions wrote: Hello All I have added the following to JSP files META http-equiv=Content-Type content=text/html, charset=UTF-8 %@ page contentType=text/html; charset=UTF-8 % html:html locale=true Change the locale in an Action to iw_IL And get: Constant strings inserted in JSP in Hebrew are OK. Just the Strings (html:message coming from Applicationresource are shown as ?? I have checked the messages in debug and found out that they come as from the resource. The constant string inserted in the JSP in Hebrew just to check the browser and they have been displayed right! Any assistance will be appreciated. Thanks Hertzel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Character Encoding wrong just for ApplicationResources!
or you can covert your properties file strings from native to unicode using this method return new String(oldString.getBytes(), encoding); where encoding is the native encoding u used in your properties file more 'bout charset encoding/decoding on this page : http://tagunov.newmail.ru/i18n/i18n.html Hertzel Karbasi - OPTinity eBusiness Solutions wrote: Hello All I have added the following to JSP files META http-equiv=Content-Type content=text/html, charset=UTF-8 %@ page contentType=text/html; charset=UTF-8 % html:html locale=true Change the locale in an Action to iw_IL And get: Constant strings inserted in JSP in Hebrew are OK. Just the Strings (html:message coming from Applicationresource are shown as ?? I have checked the messages in debug and found out that they come as from the resource. The constant string inserted in the JSP in Hebrew just to check the browser and they have been displayed right! Any assistance will be appreciated. Thanks Hertzel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: cannot find actionmappings or actionformbeans collection
I found the problem was with the data source portion of the struts-config.xml file - Original Message - From: Steven Dahlin [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 12:37 PM Subject: cannot find actionmappings or actionformbeans collection -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: isTokenValid(request) is always returning false
saveToken() is in the action.equals("checkData") section of code, isTokenValid() is in the action.equals("saveInDatabase") section of code. The first time the user accesses this action they hit the checkData section, which has the saveToken, they do not go into the saveInDatabase section. The screen which is produced does not have any form in it(is this a problem). The user hits the save button and the same action.peform method is called, only this time action=saveInDatabase if (action.equals("saveInDatabase") isTokenValid(request) ) { } section is hopefully run. But it isn't since isTokenValid(request) is evaluating to false even though in the previous time in this function called saveToken(request). Why is the isTokenValid(request) evaluating to false even though I previously called saveToken(request) Thoughs/ideas anyone Cheers Tony On Wed, 13 Feb 2002 06:26:55 -0800 (PST) Keith [EMAIL PROTECTED] wrote: is your code in the right place? In the order you have it the token isn't in the request. at bottom of your page saveToken(request); // - I think this writes a hidden field in your jsp. // which ends up in the request after form is submitted. // send your page at top of page if ( isTokenValid(request)) { tests the token in the request. --- Antony Stace [EMAIL PROTECTED] wrote: Thanks for the reply Mark. Well...that piece of code was just a test snippet. I have a problem in an Action - TestAction (with action = checkData), in TestAction.perform() the code which handles action=checkData I have if (action.equals("checkData")) { saveToken(request); //populate beans...etc } this populates a number of beans and these are used to display information in a jsp page. This page is just a confirmation screen for data which was entered in the previous screen. When the user hits the accept button on this page they go to TestAction(but with action=saveInDatabase). In TestAction.perform() for action=saveInDatabase I have if ( action.equals("saveInDatabase") isTokenValid(request)) { //save in database resetToken(request); } but the trouble is I always have isTokenValid(request) evaluating to false, so this part is always skipped so the data is not saved in the database :(. Cheers Tony On Wed, 13 Feb 2002 08:04:07 -0500 "Galbreath, Mark" [EMAIL PROTECTED] wrote: A false parameter? :-) Well, for starters, what are you passing into isTokenValid() and what is the method testing for? I am passing into isTokenValid() "request" which is one of the Action.perform() parameters. Cheers! Mark Try before you cry: http://www.mail-archive.com/struts-user%40jakarta.apache.org/ -Original Message- From: Antony Stace [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 2:37 AM What would cause saveToken(request); if ( isTokenValid(request)) { System.out.println("isTokenValid(request) true"); } else { System.out.println("isTokenValid(request) false"); } To always print "isTokenValid(request) false". I am always getting the value of isTokenValid(request) being equal to false. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Cheers Tony__ - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Cheers Tony$B!#(B - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]